Shop OBEX P1 Docs P2 Docs Learn Events
Parallax P2-EVAL (P2ES chip) pcb demo code - Page 4 — Parallax Forums

Parallax P2-EVAL (P2ES chip) pcb demo code

124

Comments

  • Ha, finally a shop and desk somehow reminding me of my 'office'.

    Enjoy!

    Mike
  • @dgately, try DIV = 2 and MUL = 25 (still gives 250 MHz dot clock)

  • jmgjmg Posts: 15,171
    Cluso99 wrote: »
    Seems like touching the P2 chip has nothing to do with cooling the chip. Perhaps it is either capacitance or grounding related.

    Just where you touch matters, as does the pressure, so I changed to a 3.5mm drill (flat end) and that shows a sensitive area in the die, which will be the VCO/PFD spot.

  • Where is this area?
  • jmgjmg Posts: 15,171
    potatohead wrote: »
    Where is this area?

    Nearest the XTAL corner, just below the AX in Parallax.
  • RaymanRayman Posts: 14,553
    ozpropdev's mistake on oscillator made me check my own code...
    Seems I had _XOSC set wrong in the VGA demo's I posted.
    I'm surprised it works with _XOSC=%01, but it did...
    Changed to _XOSC=%10 now...
  • Tubular wrote: »
    @dgately, try DIV = 2 and MUL = 25 (still gives 250 MHz dot clock)
    And, Rayman's: change: _XOSC=%01 to _XOSC=%10...

    Yes, this stopped the jitter (about 10 minutes and still rock-steady)@!

    dgately
  • jmgjmg Posts: 15,171
    edited 2018-12-28 19:19
    Rayman wrote: »
    ozpropdev's mistake on oscillator made me check my own code...
    Seems I had _XOSC set wrong in the VGA demo's I posted.
    I'm surprised it works with _XOSC=%01, but it did...
    Changed to _XOSC=%10 now...

    Yes, all 3 cap choices seem to oscillate fine.
    The 0pF one is not really Zero, as there is still PAD IO capacitance, and package and PCB capacitance.

    On my tests I get +144 ppm , -6.7 ppm, -53 ppm for the 3 settings, so the best Xtal match is the %10 setting.
    The %01 does bump the crystal quite a long way high.

    I've not tried change of the C's while running yet, but given the Xtal source does not like being enabled too early, it seems P2 can be disturbed by noise.
    The Xtal C switches are unlikely to be 'soft' & the worse case would be connecting a C with the opposite voltage to the XI,XO at that instant.
    I'd guess it's probably unsafe to change Xtal C's on the fly, but my forth is not good enough to code a test.

  • RaymanRayman Posts: 14,553
    Quick change to "all_cogs_blink.spin2" gets the leds flashing...
  • Rayman wrote: »
    Here's the V32i VG 640x480x8bpp example adapted for real P2.
    Clock set to 250 MHz.
    Looks very solid.

    I think the changes originated from ozpropdev…

    P4=vsync, P0=hsync, P1..P3 are RGB...

    Thank you for posting this Rayman. Should the video signals be...

    P1 B
    P2 G
    P3 R

    ??

    Should the birds be Yellow or Blue?

    Thanks in advance.
  • Cluso99Cluso99 Posts: 18,069
    Today I went looking for the autobaud setting when the Monitor/Debugger is called by the ROM using "> " + Ctl-D + <cr>. The same applies to calling TAQOZ.

    When the Monitor or TAQOZ is called via the ROM, the autobaud setup value (and set to 8 bits) is in the COG at $169 (the variable a0).

    I couldn't do what I wanted, but thought I'd post it here in case anyone wanted to know the value the smartpins are set to.
  • RaymanRayman Posts: 14,553
    edited 2019-01-10 11:18
    Just open the bmp file on computer to see what birds should look like
    I think they are yellow
  • Yes yellow, "Sun Conure"
  • For Cluso

    I was wondering if you had a serial terminal routine for the p2 that is a stand alone. I am trying to tease out the serial portion only.
    Could you help.
    Cluso's P2ES-EVAL-Demo-002 for P2-ES v32i Silicon
    Thanks
    I will post this in the forums.

    Martin
  • Cluso99Cluso99 Posts: 18,069
    Not currently at my pc.
    Do you just want the serial with Tx and Rx or do you want the extras such as hex, string, etc?
  • evanhevanh Posts: 15,848
    edited 2019-02-19 10:11
    Here's mine:
    *SNIP* ... replaced with an updated attachment of a full working example with expanded routines built in:
  • evanhevanh Posts: 15,848
    It needs some cogRAM variables and #constants defined as well. They're pretty self explanatory I think. Eg:
    CON
    	_XTALFREQ     = 20_000_000                              ' crystal frequency
    	_XDIV         = 2                                       ' crystal divider to give 10MHz
    	_XMUL         = 25                                      ' crystal / div * mul
    	_XDIVP        = 1                                       ' crystal / div * mul /divp to give _CLKFREQ (1,2,4..30)
    
    	_XOSC         = %01                             'OSC    ' %00=OFF, %01=OSC, %10=15pF, %11=30pF
    	_XSEL         = %11                             'XI+PLL ' %00=rcfast(20+MHz), %01=rcslow(~20KHz), %10=XI(5ms), %11=XI+PLL(10ms)
    	_XPPPP        = ((_XDIVP>>1) + 15) & $F                 ' 1->15, 2->0, 4->1, 6->2...30->14
    	_SETFREQ      = 1<<24 + (_XDIV-1)<<18 + (_XMUL-1)<<8 + _XPPPP<<4 + _XOSC<<2
    	_ENAFREQ      = _SETFREQ + _XSEL                        ' %0000_000e_dddddd_mmmmmmmmmm_pppp_cc_ss  ' enable oscillator
    
    
    'Serial functions for data logging
    	rx_pin        = 63
    	tx_pin        = 62
    	baud_rate     = 115_200
    	clock_freq    = _XTALFREQ / _XDIV * _XMUL / _XDIVP
    
    

    You can see I pillaged Cluso's sysclock setting constants. Those are rather nice.
  • To Cluso,
    I want to be able to tx numbers and characters and r1x strings etc. I am going to port over my P1 asm tutorial and work with my gps as a start with P2 asm. I would also ask for comments so I can understand what is happening. I am presently attempting to port over SimpleSerial to P1 so I can understand what is going on.

    Thanks

    Martin
  • I want to use it as a subroutine.
  • To Cluso,
    Re: Not currently at my pc.
    Do you just want the serial with Tx and Rx or do you want the extras such as hex, string, etc?


    Yes is possible.

    Thanks
  • Here are two different serial routines for P2. They're written in Spin rather than pasm, but porting to pasm should be straightforward. SimpleSerial works by bit-banging; SmartSerial uses the smart pins.

    (The file extension is .spin for SimpleSerial because it can work on P1 as well. SmartSerial, because it uses the smart pins, can only work on P2.)
  • I will look at them, thanks. I assume I can run these in spin2gui or one of the other gui's that I have seen in the forums.
    Btw in Cluso's P2ES-EVAL-Demo-002 for P2-ES v32i Silicon I am looking at stuff like this:
    _rlongcoghub =$fcfe4.

    I have been scanning the P2 documentation searching for these $fcf3e4. They do not come up. Some clarification please.
    Thanks
  • Btw I have been attempting to port simpleserial to p1 pasm not having much luck.
    Thanks
  • I just looked at the spin2 version. I have this and attempted to do a simple print but had issues using spin2gui. Can you give me an example program please.
    Thanks
  • SmartSerial.spin2 basically works just like FullDuplexSerial. Here's a sample program:
    ' SmartSerial hello world program
    ' just repeats "hello, world!" over and over
    
    CON
      oscmode = $010c3f04
      freq = 160_000_000
      baud = 2_000_000 ' default baud rate for loadp2 / spin2gui
    
    OBJ
      ser: "SmartSerial.spin2"
    
    PUB demo
      clkset(oscmode, freq)
      ser.start(63, 62, 0, baud) ' P2 serial default pins
      repeat
         ser.str(string("Hello, world!", 13, 10))
    


  • I will try this. For some reason I get errors regarding finding the smartserial obj. It is in the library for spin2gui but does not see it.
    I will let you know.

    Thanks
    Martin
  • Looking at your example I think I see my error.
  • Cluso99Cluso99 Posts: 18,069
    pilot0315 wrote: »
    I will look at them, thanks. I assume I can run these in spin2gui or one of the other gui's that I have seen in the forums.
    Btw in Cluso's P2ES-EVAL-Demo-002 for P2-ES v32i Silicon I am looking at stuff like this:
    _rlongcoghub =$fcfe4.

    I have been scanning the P2 documentation searching for these $fcf3e4. They do not come up. Some clarification please.
    Thanks

    In my examples, I am using the ROM routines to do the serial. Those entry points are listed as ROM addresses.
    If you want to see the ROM code you will need to compile using P2PASM. Peter has a link to the listing somewhere.
    Sorry, still haven't had time to chase this up yet. Maybe mid-week.
  • Hey thanks a lot for the help. I will look for the P2PASM.
    Martin
  • Um, help me understand why you perform clkset() inside the demo object. Why? I don't recall this in spin 1. You set the clock settings in the top spin file and never had to set it again.

    Thanks,
    Terry
Sign In or Register to comment.