Shop OBEX P1 Docs P2 Docs Learn Events
uPORT - A USB serial + watchdog + RTC module — Parallax Forums

uPORT - A USB serial + watchdog + RTC module

Peter JakackiPeter Jakacki Posts: 10,193
edited 2020-09-22 06:31 in Propeller 2
Here's the UB3 USB serial from the P2D2 implemented as a plug-in or solder-in module. The module is 1" x 0.57" and is meant to plug in vertically just as you see it in the pictures. As well as a standard 10-pin 0.1" header, it also has an inner 20-pin 50mil header.
I decided to use the QSOP24 pin version for some extra I/O that can also double as A/D inputs as well as other functions.

uPORT Features:
* CP2102 driver compatible (commonly included in Windows & Linux)
* Up to 8Mbd operation
* P2 reset control - holds P2 in reset until power is good.
* Smart P2 serial loader reset forces serial boot (overrides Flash/SD)
* Watchdog over I2C or I/O toggle
* Clock output to replace crystal on minimal systems
* RV-3028 RTC with 11,000uF supercap (option for 0.22F)
* 8 I/O with 220ohm resistor can drive LEDS directly or function as 12-bit A/D etc
* Baud-rate select via I2C overrides USB set baud
* 16kB I2C EEPROM emulation
* 4 LED indicators (flip-side option)
* Si5351 clock gen initialization if present

So you can even mount a uPORT onto a plug-in breadboard or operate it as an in-line module or integrated into your design.
The clock output is something that jmg has been working on and I will have to check that this hardware has the correct I/O port for that but this is something that jmg may comment on.

I decided to add an extra I2C command that writes directly to the baud-rate register so that a P2 can instruct the uPORT to use a specific baud-rate regardless of what the host side thinks it is, but I will have to test this out.

If you have a P1 design then the uPORT can replace the EEPROM (up to 16k) and also the clock too.
Can also be optioned trimmed down to an 0.8" 8-pin module without RTC loaded and also the 100mil pins can be trimmed at any time to fully access the 50mil pins.


Coming soon!

note: the gerber viewer is having a problem with my drill file which I will resolve later. There are also a few little things left to fix up with the silkscreen etc.
5a0de2c35828d2bc3252fc7f152a73.png542602c68faeebcd71372e74ecc0c4.png
718 x 423 - 159K
714 x 431 - 183K
«1

Comments

  • Here is the current schematic for the module. I allowed for 4 LEDs on the flip-side but I haven't yet decided what to do with them yet.

    uport%20schematic.png
    2328 x 1062 - 187K
  • Cluso99Cluso99 Posts: 18,069
    Nice Peter :sunglasses:
  • Nice Peter designs nice modules :smiley:
    I could see a lot of use for these in my projects. Moreover, I think there might be a chance for a more advanced micro in place of the excellent UB3 in the future if the need be. The prices for the 32 bitters with USB are coming down, especially in volume purchases so financially it might make more sense at some point but this one already looks soooo nice.
  • While it looks like the EFM32 series in QFN32 has 128kB Flash, there mightn't be that much of an advantage for this type of module other than the extra Flash. While the M0 core can do some things better, it is not better at the I/O level, and it is still 48MHz too.

    When you consider that most USB UARTs are just plain dumb and not inexpensive unless you grab the fake CP2102 ebay module, it makes you think, surely they can do better. Well, this one will be cheap to make so I will be getting quotes on A&T on a reasonable volume of these and see how they take on the open market. But for now, they are exactly what I need for a general-purpose USB UART, both external, and on-board for prototypes.


  • Oh, yes.
    To use your own words "...they are exactly what I need for a general-purpose USB UART, both external, and on-board for prototypes." is a perfect descriptions of my present needs too. And the timing seems to be perfect as well.
  • Does this work with a P1?
    jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-09-22 13:53
    RS_Jim wrote: »
    Does this work with a P1?
    jim

    Works with anything of course, but especially the P2 and P1 because of the extra smart serial load features but also because of EEPROM emulation. The I2C bus has been tested to about 3Mbps too btw. You can use this as a simple USB serial bridge of course, just ignore the other lines if you want. For the P1 you would naturally connect the I2C lines so that gives you access to the RTC if fitted and to the UB3 for watchdog modes, baud setting, EEPROM emulation, and 12-bit A/D channels. The A/D has it's own reference and you can also read the internal A/D channels that connect to the temperature sensor and the USB bus data lines etc. If you use the uPORT's reset it will pull-down the P1's reset until power is good, so this handles even very slow ramps or low supply volts etc.

    I will probably test out a bare P1 DIP chip with this module and see how well the clock output mode works. Emulating the P1 EEPROM would require more testing and it can only handle about 16k to 20k anyway. It has to look like a EEPROM during serial load and during boot. Anyway, it's a really good way to get 12-bit A/D as well as the USB serial.

    One neat little feature I will have programmed in is the ability for the target MCU to override the USB baud rate, either by an I2C command at boot or as set into Flash by the command so it automatically configs the baud rate. This means if your P1 app is set for 115200 and the PC has the wrong setting, it won't matter, it will just work.
  • Great! Looking forward to getting one soon. Will delay aquisition of a new prop plug and a/d chips for a project where I need both.
    Jim
  • jmgjmg Posts: 15,173
    edited 2020-09-22 21:49
    Here is the current schematic for the module.

    This is the 24pin QSOP pin mapping I've developed with, which allows External 48MHz in, for better precision on the Clock Generate and capture features.

    If you want to use CLKOUT features, you may want to shuffle your pins to use this pinout, as the output needs to be on CLU2, and the EXTCLK needs to be on P0.3
    The code auto-selects EXTCLK, by checking for a clock signal on the pin.
    I've also tested 48MHz-UB3 from Si5351, which needed small shuffles to delay the test until the Si5351 was updated.
    Select of the lowest (2mA) drive from the Si5351 looks to give nice soft 48MHz edges but still rail-rail & is also fine on the 20MHz to P2
    ~~~~~~~~~~~~~~~~  24 Pin QSOP24 pinout EFM8UB3 Smart UART & RESET etc ~~~~~~~~~~~~~~~~
    P0.0  SPI_SCK    wires to P60R - Flash.CK
    P0.1  SPI_MISO   wires to P58R - Flash.SO   Default WDOG pin for 24 pin 
    P0.2  SPI_MOSI   wires to P59R - Flash.SI                     (on UB3Eval remove C6,1n)
    P0.3  EXTCLK optional 48MHz CMOS OscIN                         (on UB3Eval remove C7,1n) ±10ppm, Auto sense.
    P0.4  UART1_TX
    P0.5  UART1_RX
    P0.6  CLU_OUT  24b Freq Generator and LED2.k, fGen = 48MHz/2N, default 1.000Hz at POR
    P0.7  SPI_SS    wires to P61R - Flash.CSN
    P1.0  i2c_SDA  Loads Si5351A (if found) during P2 reset, UB3 is slave i2c for P2 run 
    P1.1  i2c_SCL  Loads Si5351A (if found) during P2 reset, UB3 is slave i2c for P2 run 
    P1.2  SDON  and Reset Button to GND 
    P1.3  RES_P2  10k Pulldown, so HW resets during UB3 init and startup
    P1.4  VDD(analog) P2 1v8 via series R 
    P1.5  Spare or PWM OUT, via RC DAC to UB3.VCTCXO Flash-trim post assembly 
    P1.6  Spare (analog)         Toggles in main()  
    P2.0  C2D-BootLoader (tie low at reset for DFU), drives LED1.k with activity LED flickers during Serial download.
    P2.1  P2 'CTS' handshake, 5k6 to UART1_RX, for L=Pause signal to P2 - P2 wins but can sense the load & pause. This will be tricky, as need to avoid false start UART edge.
          P2 has COMP_DAC comparator mode below 
    RST/c2K  
    Inbuilt: 32b time capture on i2c selectable pin, 24b signal generator on P0.6
    On P2D2 LED3 is P2.P61 
    Currently SPI pins are connected but not used apart from being 32b captured.
    
  • jmgjmg Posts: 15,173
    One neat little feature I will have programmed in is the ability for the target MCU to override the USB baud rate, either by an I2C command at boot or as set into Flash by the command so it automatically configs the baud rate. This means if your P1 app is set for 115200 and the PC has the wrong setting, it won't matter, it will just work.

    I'm not sure how useful doing that is, in the real world ?

    It consumes valuable P1 code space, and any time the PC reconnects to the USB-UART it will redefine the baud rate from the PC side, and so lose any P1-defined value.

    All PC apps I know of, define the baud when they define the serial port.

    The UB3 powers up to default to 115200 baud, until the PC connects and defines other rates.
  • @jmg - The 48MHz oscillator in the UB3 has about 1.5% precision which is of course much better than RCFAST and also usable by the P1 & P2 PLL.

    In regards to baud rate override, I have plenty of apps that have a specific baud rate and it helps that when I connect to it that this would be "automatic". Certainly this is the case with Bluetooth connections where it doesn't matter what baud you use on the terminal since the receiver is preset, and can be the same with direct USB connection to the UB3. Since I maintain an assembly version of the original code along with the extra commands it is an easy matter to prevent the PC overriding the baud rate if the Prop has instructed it to use a specific baud rate instead. This makes no difference to the PC side of things really since the baud setting from the PC only affects the "UART", in this case the UB3.

    While the clock could be useful bear in mind that super small super precise crystals are super cheap these days too. There are still a lot of designs though that insist on using those HC49/4 monsters though :)

  • Cluso99Cluso99 Posts: 18,069
    @jmg - The 48MHz oscillator in the UB3 has about 1.5% precision which is of course much better than RCFAST and also usable by the P1 & P2 PLL.

    In regards to baud rate override, I have plenty of apps that have a specific baud rate and it helps that when I connect to it that this would be "automatic". Certainly this is the case with Bluetooth connections where it doesn't matter what baud :smiley: you use on the terminal since the receiver is preset, and can be the same with direct USB connection to the UB3. Since I maintain an assembly version of the original code along with the extra commands it is an easy matter to prevent the PC overriding the baud rate if the Prop has instructed it to use a specific baud rate instead. This makes no difference to the PC side of things really since the baud :smiley: setting from the PC only affects the "UART", in this case the UB3.

    While the clock could be useful bear in mind that super small super precise crystals are super cheap these days too. There are still a lot of designs though that insist on using those HC49/4 monsters though :)
    Obviously too much time on my hands :sunglasses:
  • jmgjmg Posts: 15,173
    @jmg - The 48MHz oscillator in the UB3 has about 1.5% precision which is of course much better than RCFAST and also usable by the P1 & P2 PLL.

    When connected to USB, the UB3 averages a clock lock of a tad under 0.1%.
    (It wobbles about by the step size of the trim, as it checks & corrects every USB frame.)

    The main appeal of external clocks, is for the Capture and Generate features in the UB3 firmware - if those are not used, the USB-locked stability could be fine. Certainly it is ok for baud related generation.

    The UB3 can be programmed to generate a clean 50% 4.8MHz or 6MHz via the simple 48M/2N pathway, but I did also manage to get the CLU block to generate an averaged 5.000MHz
    - plots attached show how the P1 PLL smooths the jitter on the 5.000MHz
    Maybe that filtered jitter is 'good enough' ?


  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-09-23 14:25
    I managed to connect up the top 4 LEDs which I still consider optional since they are mounted on the flip-side. But RX an TX are connected and 2 I/O can driver the X and Y. There's also a tiny dual red+green LED option further down the board that could be used although if the 0.2F supercap was fitted, it would obscure the LED.

    The basic unit will not need RTC or the LEDs and I will get these made up on 1mm substrate. This module is really tiny but packs a solid serial punch.


    @jmg - the 6MHz is what I use on many P1 designs to generate a 96MHz clock. I can pick up tiny 6mm long 6MHz cylindrical crystals for 10cents. I think the QFN20 coupled with a P1 though could provide a very compact solution especially if it emulated enough EEPROM too. In fact, the QFN20 could be placed underneath the P1 itself, then it almost becomes a true single chip MCU, with USB serial to boot! I don't think the clock output makes much sense for the more complex P2 though where it is just as easy to use cheap and tiny SMD crystals which are more readily available and cheaper at 10MHz and above.
    2104 x 1215 - 268K
    2104 x 1215 - 312K
  • How many $ & when ?
    jim
  • @RS_Jim - These are forbidden questions, didn't you know that ? :)
    I'm sure Peter will let us know when he's ready. He's just teasing us now. I'm trying to wait patiently and save money for the goodies.
  • How much you say? For the basic USB serial +support features, think under $10 USD and even much less again if I can get a moderate volume produced. My aim is to blow the cheap and dumb usb serial converters out of the water and make it a no-brainer to use a uPORT instead.

    All the cheap converters use fake chips, and even if they were genuine, they're still dumb. The RTC version though will cost about $5 extra as these are premium parts and I don't expect to get many orders for RTC versions anyway, but then again you never know.

    The basic unit will do serial up to 8Mbd and also have the smart reset, power monitor and watchdog functions as well as A/D and EEPROM emulation.

    All four LEDs on top there are functional now with rx tx and two programmable types. Firmware can be easily updated too but even so, many of the configurations including USB descriptor etc can be set via I2C. There's even a tiny reset button on the other side of the microUSB socket.
    You can only upload new firmware though over USB when the C2D pin marked D is pulled low on power-up. It then appears as a simple HID device to the PC for the hex loader. Alternatively, connecting directly to the C2 lines marked C and D from your target MCU permits full debug and programming of the chip, and while I have routines written in TAQOZ, I don't expect this to be used normally, maybe as more of a programmable A/D module perhaps.

    JLCPCB quote 2 cents per blank pcb :)
    2530 x 1461 - 277K
    2530 x 1461 - 350K
  • ErNaErNa Posts: 1,752
    You are simply the best....
  • Peter, you should consider going whole hog with wiring harness and get a little Amazon shop going.
    Blow FTDI and Keyspan out of the water.
  • koehler wrote: »
    Peter, you should consider going whole hog with wiring harness and get a little Amazon shop going.
    Blow FTDI and Keyspan out of the water.

    Yes, this is along the lines I was thinking, but Amazon is probably a better idea. I figure I need to supply pin headers and discrete cables much like they do for the standard modules. This particular module is designed for mounting directly to the breadboard or pcb but I could do a slight variation to suit USB dongle style better perhaps.
  • koehler wrote: »
    Peter, you should consider going whole hog with wiring harness and get a little Amazon shop going.
    Blow FTDI and Keyspan out of the water.

    Yes, this is along the lines I was thinking, but Amazon is probably a better idea. I figure I need to supply pin headers and discrete cables much like they do for the standard modules. This particular module is designed for mounting directly to the breadboard or pcb but I could do a slight variation to suit USB dongle style better perhaps.

    If this addition of pin headers and cables helps to increase sales revenue or is necessary for some other unknown reason then fine but please at least keep it as an option and not the only bundle. Some of us (many, I think) would prefer it as a bare module without that additional bloat.
  • Here is a uPORT made up out of the new pcbs. I just hand pasted and placed this and put it in the toaster oven for 4 minutes, then added the LEDs on the flipside and reflowed that with the hot air from the gas iron. This one has the RTC parts on it too. All looking good so far.
    3783 x 2437 - 1M
  • Cluso99Cluso99 Posts: 18,069
    edited 2020-10-13 10:25
    Looks good Peter :smiley:

    Are there any issues with the microUSB sitting higher at the front due to the flange being on the pcb? I have been thinking about this on my pcb when it gets panelised as I intended to have a NPT routed slot to allow for teh flange during assembly.

    I see the square pads have been slightly cut on the outer edge. Did JLCPCB trim the clearance? - they quote min as 0.25mm ~0.010"

    BTW just been reading about KiKit for panelising gerbers.
  • Cluso99 wrote: »
    Looks good Peter :smiley: ...

    Are you kidding ? It's gorgeous and so tiny.
    And I bet it works !

    Peter, I just hope these leds on the flip side aren't going to be actually mounted on the commercial version and are just a POC, are they ? Desoldering them would be a little pain and a waste of time.
  • @Maciek - I haven't checked it out fully but the chip programmed fine via USB and came up as a CP2102 (but much more) and I loaded the leds for testing purposes too. I think many would appreciate the leds just to see that their board is receiving and transmitting etc. Btw, desoldering 2 pin smds is very simple, just apply more solder with the iron to one end and watch the whole part float off the pcb! (or else hot air from the gas iron).

    @Cluso99 - I think it's important to have the flange help guide the plug in and the fact that it sits that millimeter or so off the board doesn't seem to affect the mounting at all. Maybe the next version might allow for it to be flat but you wouldn't notice it otherwise. The vgroove looks a bit aggressive in this pcb at least. I will check the others and make more allowance for it next time.
  • @"Peter Jakacki" - I understand. Do it your way. That's what I'd do anyway. I can solder/desolder pretty much anything (save the bga or wlcsp for the lack of proper tools) and those leds I might even like :).
  • Ready to order 2!
    Jim
  • RS_Jim wrote: »
    Ready to order 2!
    Jim

    And I was ready to do the same even when Peter first mentioned he's going to make the board. The only thing I'm unsure of is the quantity :smiley:. The same holds true for the P2D2.
  • Off I go to pick the stuff I need to sell to buy these boards. A kidney perhaps ...
  • @Maciek
    lol, The kidney is off the list. Lets see, an old basic stamp what is a micro-controller, sx key and a bunch of chips and I might even include my P1 demo board with VGA output. Would that get me the p2d2? I have the pennies saved for the uPORT .
    Jim
Sign In or Register to comment.