Parallax P2-EVAL (P2ES chip) pcb demo code

124

Comments

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

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • @dgately, try DIV = 2 and MUL = 25 (still gives 250 MHz dot clock)

  • jmgjmg Posts: 13,928
    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?
    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: https://forums.parallax.com/discussion/123709/commented-graphics-demo-spin<br>
  • jmgjmg Posts: 13,928
    potatohead wrote: »
    Where is this area?

    Nearest the XTAL corner, just below the AX in Parallax.
  • 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...
    Prop Info and Apps: http://www.rayslogic.com/
  • 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
    Livermore, CA (50 miles SE of San Francisco)
  • jmgjmg Posts: 13,928
    edited 2018-12-28 - 19:19:49
    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.

  • Quick change to "all_cogs_blink.spin2" gets the leds flashing...
    Prop Info and Apps: http://www.rayslogic.com/
  • 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.
    Terry's Workbench

    Feel the need for speed between your PC's com port and Prop?
    Try the FTDI 245 and the FullDuplexParallel Object.
    Check out my spin driver for the Parallax "96 x 64 Color OLED Display Module" Product ID: 28087
    22FPS video from the P2 on the Parallax "96 x 64 Color OLED Display Module" https://www.youtube.com/watch?v=ja84rf38QHM
  • 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.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • RaymanRayman Posts: 9,716
    edited 2019-01-10 - 11:18:55
    Just open the bmp file on computer to see what birds should look like
    I think they are yellow
    Prop Info and Apps: http://www.rayslogic.com/
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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?
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • evanhevanh Posts: 7,920
    edited 2019-02-19 - 10:11:34
    Here's mine:
    *SNIP* ... replaced with an updated attachment of a full working example with expanded routines built in:
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • 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.
    "We suspect that ALMA will allow us to observe this rare form of CO in many other discs.
    By doing that, we can more accurately measure their mass, and determine whether
    scientists have systematically been underestimating how much matter they contain."
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • I want to use it as a subroutine.
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • Btw I have been attempting to port simpleserial to p1 pasm not having much luck.
    Thanks
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • Looking at your example I think I see my error.
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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.
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Hey thanks a lot for the help. I will look for the P2PASM.
    Martin
    “Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it.”
    “You only live twice:
    Once when you are born
    And once when you look death in the face”
  • 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
    Terry's Workbench

    Feel the need for speed between your PC's com port and Prop?
    Try the FTDI 245 and the FullDuplexParallel Object.
    Check out my spin driver for the Parallax "96 x 64 Color OLED Display Module" Product ID: 28087
    22FPS video from the P2 on the Parallax "96 x 64 Color OLED Display Module" https://www.youtube.com/watch?v=ja84rf38QHM
Sign In or Register to comment.