uPORT - A USB serial + watchdog + RTC module
Peter Jakacki
Posts: 10,193
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.
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.
Comments
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.
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.
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.
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.
Jim
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
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.
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
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' ?
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.
jim
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.
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
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.
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.
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.
@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.
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 . The same holds true for the P2D2.
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