P2D2 - An open hardware reference design for the P2 CPU

1151617181921»

Comments

  • jmgjmg Posts: 13,522
    .. Can someone give this a once over and correlate that with the CP210N-QFN20 pinout to check for compatibility? This assumes that alternate CP2102N functions are not enabled.

    Looks OK to me.

  • T Chap wrote: »
    Why EFM over CP?

    The original intention of a support micro was to provide some monitoring such as temperature, voltage, and watchdog/reset etc. Then a change was made from a PIC to an EFM8BB and then to the USB variant to also provide USB serial. The CP2102N is pin compatible but can only provide the USB serial which is fine if we forego the monitoring functions for the moment. In the long run the EFM8UB3 will provide the monitoring and USB serial functions.

    Isn’t hindsight wonderful :(

    Shame the hindsight wasn’t 3 weeks ago :(

    Guess the next rev could change the pinout to use compatible CP2102 pinout so either CP2102 or EFM8BB could be used. The monitoring functions could be linked by solder blobs to bridge pads. Of course space is extremely tight.
    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)
  • jmgjmg Posts: 13,522
    Cluso99 wrote: »
    Guess the next rev could change the pinout to use compatible CP2102 pinout so either CP2102 or EFM8BB could be used. The monitoring functions could be linked by solder blobs to bridge pads. Of course space is extremely tight.
    Yes, I think that is exactly what Peter is doing.
    I've also tracked my P2D2Pi fork, to include the same jumpers, they seem to fit ok, 1 on top, 2 on bottom, default bridged.


  • That source seems to be missing VCPXpress.h but that might be with the Keil suite. I read somewhere that the CP2102N uses the EFM8UBx so it would be very nice indeed to have the source code for that, but I can see the conflict of interest there.

    Google search has found that VCP header source here if you need it for testing your EFM8 device with serial over USB... the VCPXpress header and library file appear to be from Silabs.

    https://github.com/ahtn/efm8_sdcc/tree/master/efm8/mcu/EFM8UB1/VCPXpress
  • @rogloh - thanks. I will have new pcbs and more parts next week and probably make up some on Thursday. They should work fine so hopefully I will be able to send them express post same day.
    The newer parts are the 24MHz preprogrammed Si5351 chips which I will use for the P2 clock and also CP2102N for USB serial, unless of course I manage to get the EFM8 up and running before then.
    I've also will have heatsink PCBs and while these are just 1oz copper (cheap), they are all copper both sides although the pcb is two thirds length to allow rear mounted microSD and RTC etc. This is just a cheap way to check effectiveness of such a pcb layer.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
  • roglohrogloh Posts: 1,067
    edited 2019-06-01 - 01:02:29
    Sounds good Peter, though just wondering if you don't fit the EFM8 device to the P2D2 will we still have full control of the flash vs SD vs serial boot selection for the P2? Isn't the micro required to pullup/down the appropriate boot pins depending on the boot order desired? I didn't see any other resistor strapping options in the recent P2D2 schematics so I was presuming the micro could be configured to do that job. Perhaps with a CP2102 we need to use some external resistors to achieve this?

    Update June 1 11:00am: actually just ignore what I mention above Peter... I just located that 10k pullup on P61R to VB in your schematic so if the flash is not populated that resistor would probably also be removed to also let you boot from SD etc according to P2 boot logic table in latest P2 Google documentation. (Assuming it is still valid, perhaps it is out of date if any tweaks were made in the respin for booting, not sure there as it mentions it needs more editing).

    In my own application I sort of bypass the EFM8 for P2 serial downloads and can either try to use Wifi or another USB enabled micro (AVR) to communicate with the P2 so I'm not too concerned what is fitted on the early P2D2 as long as external P62/P63 serial pin programming still works, but the EFM8 device does seem like it should be rather versatile once you learn how to get it to work.
  • jmgjmg Posts: 13,522
    edited 2019-06-01 - 01:52:35
    .. unless of course I manage to get the EFM8 up and running before then..
    Partial progress to report.
    I've imported a EFM8UB1 example (since UB3 exact example does not exist yet) , and ported their UART0 to UART1, and EFM8UB3 register sets.
    Whacked SS about until it mostly does what I intend, and I have a build and download, that seems to run at expected 48MHz and appears as COM38 when running.
    Polling loop runs at 276.812kHz which is between some predictions of
    48M/86/2 = 279069
    48M/87/2 = 275862
    Sim suggests ~ 75c for this loop, which is in right ballpark as it does not cover all opcode slowdown causes. (only other sysclk choice is 24.5MHz, ie clearly not that, plus I suspect it will not attach as COM38 at 24.5MHz )

    .. but no terminal will connect to this visible COM38... :(

    My EFM8UB1 board is damaged, so I cannot check that alternative ...
    So I dig deeper, and find an older C8051F381, and build the USB_UART example for that, no changes.
    Does not want to launch debug, but does seem to download, so I connect F381 card alone, and that shows as COM38 again.
    This COM38 I can connect to, so the issue is not in any PC drivers or in a proven example, but maybe the UB3.VCPXpress library needs work ?

    Any minor mistakes in UART1 details, should not prevent Terminal Connect ? Connect attempts have no long term effect on the polling loop, so it is not locking up.

    UB3 Build reports Program Size: data=133.6 xdata=472 const=110 code=9950
    F380 build reports Program Size: data=113.5 xdata=472 const=285 code=9718
    ie look quite similar. (different target boards )
  • I've come across that UB3 VCP code in the link that rogloh sent but I may wait until I get a UB3 dev board in my parts order since that includes the standard debug interface etc. I can try it out then.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
  • jmgjmg Posts: 13,522
    I've come across that UB3 VCP code in the link that rogloh sent....
    That link seemed a little strange to me.
    It tags as
    efm8_sdcc/efm8/mcu/EFM8UB1/VCPXpress/
    so appears to be for UB1 not UB3 and it is not clear if that is a Keil lib (appears to have no source) or a SDCC lib.

    Other useful info:
    For your assembler, attached is an edited SI_EFM8UB3_Defs.inc I made that adds tagged with compare from UB1. ie UB3 is almost a superset of UB1, (they remove UART0, add CLU0..3, add Timer5.., improve SMbus, remove i2cslave ..)
    I've not dug into the USB depths, but the SFRs all align UB1==UB3.

  • I just when to the home link and downloaded the whole project. There's UB3 there but I'm having a little play with it now.

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
  • jmgjmg Posts: 13,522
    I just when to the home link and downloaded the whole project. There's UB3 there but I'm having a little play with it now.

    I think that VCPXpress.lib is a copy of the SiLabs Keill one, as it is identical in size to my one here, and compare says ==
    C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/8051/Device/EFM8UB3/VCPXpress/
  • Peter JakackiPeter Jakacki Posts: 8,331
    edited 2019-06-06 - 03:37:12
    While I am waiting to assemble the new P2D2r3 pcbs next week (I have them now) I decided to play a little bit. First off, I attached a "heat-sink" pcb to the r2 version that I've been testing and left it to run at 325MHz. So far, so good.
    Just for fun though I've taken the BREAKOUT game I wrote in Tachyon for the P1 VGA text mode and started to convert that for the P2 in TAQOZ. It's taken just minutes to write some initial code and test interactively on the monitor, even with TAQOZ console output appearing on the bottom 4 lines.

    This is the code so far, just very basic stuff, but have a look what it does.
    pub *BREAKOUT*		PRINT" BREAKOUT FOR THE P2 - 190606" ;
    
    	*** SOUNDS ***
    
    --- hitting a wall sound
    pub BONK	ROUT PIN 300 HZ 50 ms MUTE ;
    
    	*** WALL ***
    
    ( CONSTANTS )
    300		:= backwall	--- gap behind walls (down really low for the photo)
    32		:= bricks	--- number of brick columns
    4		:= walls
    640 bricks /	:= brickw	--- width of brick
    10		:= brickh	--- height of brick
    
    --- initialize the brick wall with 4 rows of random colored bricks/tiles from backwall (gap)
    ---		walls *    bricks      position next brick                      width & height with random color panel
    pub WALLS	walls 0 DO bricks 0 DO I brickw * x   J brickh * backwall + y   brickw w brickh h   RND >B 1 MAX panel   LOOP LOOP ;
    
    	*** BALL ***
    
    3 := ballw	3 := ballh
    
    --- ball position variables
    word bx		word by		word abx	word aby
    
    pub BALL ( color -- )		bx W@ x by W@ y ballw w ballh h panel ;
    
    	*** PADDLE ***
    
    --- paddle xy
    word px		word py
    
    --- draw the paddle
    pub PADDLE ( color -- )		px W@ x py W@ y 20 w 3 h panel ;
    
    4608 x 2176 - 466K

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
  • While I am waiting to assemble the new P2D2r3 pcbs next week (I have them now) I decided to play a little bit. First off, I attached a "heat-sink" pcb to the r2 version that I've been testing and left it to run at 325MHz. So far, so good.
    Just for fun though I've taken the BREAKOUT game I wrote in Tachyon for the P1 VGA text mode and started to convert that for the P2 in TAQOZ. It's taken just minutes to write some initial code and test interactively on the monitor, even with TAQOZ console output appearing on the bottom 4 lines.

    This is the code so far, just very basic stuff, but have a look what it does.

    Nice work!
  • Nice Peter :smiley:
    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)

  • The original intention of a support micro was to provide some monitoring such as temperature, voltage, and watchdog/reset etc. Then a change was made from a PIC to an EFM8BB and then to the USB variant to also provide USB serial. The CP2102N is pin compatible but can only provide the USB serial which is fine if we forego the monitoring functions for the moment. In the long run the EFM8UB3 will provide the monitoring and USB serial functions.

    I've lost the plot.

    This seems to go back a decade+ to why the Prop doesn't have any hardware onboard.
    Wasn't USB always seen as a requirement, and the standard response was as always to just use an object?
    Or is the above for later generation high speed USB?
    I guess the question is, is basic USB v1 still doable just as a standard OBEX object?
    ---- This space available for rent ----<br>
  • koehler wrote: »

    The original intention of a support micro was to provide some monitoring such as temperature, voltage, and watchdog/reset etc. Then a change was made from a PIC to an EFM8BB and then to the USB variant to also provide USB serial. The CP2102N is pin compatible but can only provide the USB serial which is fine if we forego the monitoring functions for the moment. In the long run the EFM8UB3 will provide the monitoring and USB serial functions.

    I've lost the plot.

    This seems to go back a decade+ to why the Prop doesn't have any hardware onboard.
    Wasn't USB always seen as a requirement, and the standard response was as always to just use an object?
    Or is the above for later generation high speed USB?
    I guess the question is, is basic USB v1 still doable just as a standard OBEX object?

    The 12Mbps USB circuit works, but we don't have USB code to put into ROM for boot purposes.
  • jmgjmg Posts: 13,522
    koehler wrote: »
    I guess the question is, is basic USB v1 still doable just as a standard OBEX object?
    Yes, see the USB threads and also the Python thread.
    koehler wrote: »
    Wasn't USB always seen as a requirement, and the standard response was as always to just use an object?
    Not really.
    As Chip says, there was no room in the ROM, and USB is not stable enough to go into ROM yet, but there are other caveats too
    * USB needs a higher SysCLK, whilst at boot 20MHz+ RCFAST is all that is available.
    * USB is resource hungry. IIRC the ROM loader can download all 8 COGs, but a USB core needs 1-2 COGs

  • Many micros with onboard usb also seem to rely on external debug micros or serial USB chips mainly because onboard usb depends upon firmware, which can be overwritten or disabled etc. I think the only solution that will always work is to have dedicated usb serial. Wouldn't it be nice if that was built into the micro or the p2!

    Tachyon Forth - compact, fast, forthwright and interactive
    useforthlogo-s.png
    --->CLICK THE LOGO for more links<---
    P2 +++++ TAQOZ INTRO & LINKS +++++ P2 SHORTFORM DATASHEET
    P1 +++++ Latest binary V5.4 includes EASYFILE +++++ Tachyon Forth News Blog
    Brisbane, Australia
Sign In or Register to comment.