Working with USB powered microcontrollers on the bench - Page 1
Forum section: electronics / general

author: ledtester
author_rank: Super Contributor
timestamp: February 06, 2021, 06:13:10 am
content: A lot of microcontroller modules -- e.g. Arduino, Teensy, etc. -- can be powered via USB which also powers your circuit. But you'll want to remove power when making circuit changes, and plugging/unplugging a USB cable is inconvenient.I was wondering how others like to manage USB-powered microcontrollers when you're developing with them on the bench. Do you:- power the uC and circuit from a separate power supply, and perhaps use an isolated USB connection for comms only?- cut the power from the uC to your circuit with a switch and keep the uC is reset when making changes?- something else?Lately I've been plugging the uC module into a USB hub that has a power switch for each port and that's been working pretty well.

author: Ian.M
author_rank: Super Contributor
timestamp: February 06, 2021, 03:27:47 pm
content: There's a greater issue here than simply powering down your project boardMany experimenters have damaged host ports and even motherboards by making mistakes with USB powered devices, e.g. shorting a higher voltage rail to a MCU I/O pin which if it blows the MCU's ground bondwire, has a high risk of taking out the host port and/or if there's no anti-backfeed circuit in the Vbus line, risks taking out the whole host motherboard.A sacrificial powered hub, strapped to PC chassis ground, helps, as it reduces the risk of the host port being damaged, but if you want to be 100% certain your host is protected, you need USB isolation. However that has its own issues: e.g. most USB 2.0 isolators cant do 480 Mbps High Speed mode, and don't pass USB Low/Full speed detection upstream properly - you usually have to set a switch to configure the speed. USB 3.0 isolators exist that don't have that problem and can handle all USB 2.0 speeds properly (maybe with the assistance of a downstream USB 3.0 hub), but their cost is comparable to a good quality replacement motherboard.The USB 2.0 standard requires the USB data lines to tolerate being shorted to USB ground for min. 24H, preferably indefinitely. Connected devices should also tolerate loss of Vbus. Its therefore acceptable to simply switch Vbus, without any need to switch the data lines. Worst case, the data lines will get dragged down via the device's protection diodes and be seen as a SE0 state resulting in disconnection. I therefore suggest the use of an ideal diode with current limit e.g. T.I'sLM76202-Q1, which also includes high side switch functionality, current monitoring and fault detection. Inserted in the Vbus line, it could be used to provide target power switching, over-current, and back-feed protection. A TVS diode array designed for USB data line protection, with some 50mA polyfuses in 0603 or similar packages in the data lines on the device side would also be required to minimize the risk of host port damage in the event that catastrophic failure of the target overvoltages its USB pins.However the convenience of simply powering down your target board to work on it only really applies to solderless breadboards and breakout board + duPont jumper lashups. If you need to solder on your target board, unless you know for certain that your iron has a floating ESD safe bit, you should fully physically disconnect it as there is a significant risk of damage due to the ground loop that forms at the instant of bit contact, either due to induced voltage or due to discharge of charged capacitors or from batteries in the circuit, and if the bit isn't properly grounded there's a high risk of damage from leakage currents from mains elements, Y capacitor leakage in SMPSU powered solderstations, or simply transients from switching power to the element for temperature contol.

author: tszaboo
author_rank: Super Contributor
timestamp: February 06, 2021, 11:15:23 pm
content: I have a self made board with a fast 500mA IC based limit switch on it. It has a switch to power off the port.I typically plug this into one of those "USB charger doctor" doodads, that measure the current and the voltage of the USB.

author: fourfathom
author_rank: Super Contributor
timestamp: February 06, 2021, 11:30:52 pm
content: Quote from: ledtester on February 06, 2021, 06:13:10 amThat's what I do, but how often do you make on-the-fly circuit changes anyway? Unplugging the cable has never been a major inconvenience.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 06, 2021, 11:34:26 pm
content: For Full-Speed (12 Mbit/s) HID stuff, I use a cheap fleabay ADuM3160 isolator (followed by a powered USB 2 hub if I need > 200mA @ 5V, with the hub getting isolated DC power) and circuit grounded to whatever I'm doing.For High-Speed (480 Mbit/s) USB stuff, I first verify the circuits at Full-Speed, before omitting the isolator (but still using an USB hub between the host and the device, in the hopes that it'll be the hub and not the host port that will go bÖrk if my bumblefuckery catches up with me).But I'm definitely more a software dude and not an EE, and need to limit the extent of the hardware damage I cause.