Device power cycles when USB shield is connected? - Page 1
Forum section: electronics / projects

author: Boscoe
author_rank: Frequent Contributor
timestamp: August 08, 2017, 02:01:10 pm
content: Hi all,I'm currently working on an MCU based battery powered device which is charged by USB. When the device is battery powered and you plug the USB connector into the device, or just brush the USB shields, the device will power cycle do to large transients on the power supply lines in the device. This problem is particularly prominent when the device is grounded through the debug interface. I have even tried connecting the USB shield on the device to GND through a 1M resistor but the project persists.Has anyone else experienced this or understand what is happening?Thanks!

author: anishkgt
author_rank: Frequent Contributor
timestamp: August 08, 2017, 04:47:20 pm
content: I think your solution maybe in post#2 on this similar threadhttps://www.eevblog.com/forum/projects/help-interfacing-ftdi-with-existing-project/

author: Boscoe
author_rank: Frequent Contributor
timestamp: August 09, 2017, 08:13:56 am
content: Unfortunately my case isn't similar to theirs. The 5VUSB rail in my application is only connected to the battery charger IC on the board which determines the power path, cell or USB power. I see this issue just when the two shields are connected - nothing else.

author: capt bullshot
author_rank: Super Contributor
timestamp: August 09, 2017, 09:13:15 am
content: I've seen quite often circuitry behave strange or going borked - common to all was USB shield not connected to circuit GND, or even worse - some kind of impedance (ferrite bead or inductor) in the shield to GND path.I don't know what make people believe that _not_ solidly connecting the USB shield to circuit GND is a good idea. Must be some kind of misunderstanding of law of physics.Connect the USB shield solid to your circuit ground, same point as the GND wire from inside the USB cable. Don't try anything else (except for proper isolation using a DC/DC and a USB isolator chip) - it just won't work.By solid I mean ground plane, not PCB traces, pigtails or whatever. If you have a ground loop to break, you cannot do this at the USB port (except with a proper USB isolator)BTW - You mentioned USB charging - do you have current sense resistors in the GND path? This changes things, you'll have to avoid DC ground loops, but doesn't free you from high frequency grounding your shields, try connecting the shield to GND using ceramic capacitors.

author: Boscoe
author_rank: Frequent Contributor
timestamp: August 09, 2017, 01:14:15 pm
content: Quote from: capt bullshot on August 09, 2017, 09:13:15 amHi Capt.,So the circuit originally featured a direct connection from the shield to GND. In this case, naturally, these was a potential between the two grounds (caused by the loop). When connecting the shield a large current would flow to balance the two potentials causing a large spike in the power supply rails thus causing power cycling. Having review the circuit a component that would be particularly vunerable to this and always ending up in an undefined state did not have a decoupling capacitor on it's power input, adding one improved the circuit.As for grounding the USB shield, many very large companies advise different things often contradicting themselves too. I have been through all of this before. I have an easier case where I do not have ANY USB comms - the USB is only used for power delivery.

author: capt bullshot
author_rank: Super Contributor
timestamp: August 09, 2017, 02:09:18 pm
content: Quote from: Boscoe on August 09, 2017, 01:14:15 pmOK, that's fine, you found the issue with the missing decoupling capacitor, good work.Regarding the grounding: In my experience, if you have a computer as the host (even if for charging only), then you'd expect the GND wire and the cable shield tied together at the computer side. Depends on the computer if the computers GND is tied to safety earth or not, but cable shield is tied to GND anyway. Best handled with GND wire and shield tied together at your side also (as this improves CMRR on the signals - doesn't matter in your case).For an USB charger, I'd expect the cable shield tied to anywhere in the world - simply expect the worst you can think of. Most USB chargers I can imagine don't have safety earth, so the output is floating. In case the charger has safety earth, everything can happen: any combination of tied to safety earth and floating for shield and GND.That's all OK as long as your device is floating. I think you know when the ground loops come into the game - if your device has more than one connector. In my experience, it's been still the best way to handle this to tie all the shields / GND together as solid as possible, to avoid the ground loop current flow through your circuit but bypass it the shortest way - if you cannot apply proper isolation. So the influence of the inevitable transient currents (while plugging in) and static (typically line frequency) currents on your circuit is minimized (by bypassing these currents).Decoupling keeps the difference between the potentials of your circuit constant while the transient event - that's what you just found out and what keeps your circuit working as these transients happen.As an opposite example - I had two USB hubs dying from transient GND currents flowing through them. The USB connector shells were connected to circuit GND via some inductive component, leading to enough voltage drop across to kill the USB hub chip. Shorting these ferrite beads saved the life of the third hub (of the same kind).Another one: For some mystery reason (I had connected the USB connecter shell to GND which was formerly left unconnected), one of the devices we build was way less suspectible to EMC.