cancel
Showing results for 
Search instead for 
Did you mean: 

Software USB plug and unplug detection

Kuikui
Associate III
Posted on January 22, 2011 at 16:35

Software USB plug and unplug detection

3 REPLIES 3
tsuneo
Senior
Posted on May 17, 2011 at 14:22

> but because of a reverse current in a chip, I have 1.5V on the detection pin when USB is unplugged.

1) What is the MCU type number?

2) Is any TVS diode array connected to D+/D-/VBUS lines?

For self-powered device, select a TVS chip without high-side diode on D+ line. For example,

ON semi 

NUF2030XV6

http://www.onsemi.com/pub_link/Collateral/NUF2030XV6-D.PDF

NUP4016

http://www.onsemi.com/pub_link/Collateral/NUP4016P5-D.PDF

etc.

High-side diode disturbs VBUS detection. VBUS voltage is kept high at disconnection, passing through this diode and D+ pull-up. Some EVAL boards mount USBLC6-2 for self-powered device, but it's wrong choice.

USBLC6-2 (good for bus-powered, but not for self-powered)

http://www.st.com/stonline/products/literature/ds/11265.pdf

Tsuneo

Kuikui
Associate III
Posted on May 17, 2011 at 14:22

Hi chinzei,

I'm using an STM32F102R8, 3.0V self-powered.

Yes, I have a TVS diode array connected to Gnd / D-/D+ / VUSB ( a TPD2E001DRS from TI )

I didn't think about this issue ... I just ordered 1k pieces of TPD2E001DRS :D

Damn it ... Now the best thing to do is to add a diode ''somewhere''..

Thank you very much Chinzei !

Nevertheless, now that hardware is ''bugged'', is there any way to solve this issue with software detection ?

Thanks !

tsuneo
Senior
Posted on May 17, 2011 at 14:22

> Nevertheless, now that hardware is ''bugged'', is there any way to solve this issue with software detection ?

Unfortunately, there isn't any good workaround for this issue by firmware operation.

To examine VBUS voltage, D+ pull-up should be disabled. ie. soft-detach. Your firmware will do this procedure while the bus is in suspend. But, when the D+ pull-up is enabled again, the PC may accidentally wake up by this soft-attach.

''Remote Wakeup of USB Devices'' on MSDM

http://msdn.microsoft.com/en-us/library/ff537628(VS.85).aspx

Note:  UHCI (Universal Host Controller Interface) USB host controllers do not distinguish between remote wake signaling and connect change events on root hub ports. This means the system will always wake from a low system power state if a USB device is connected to or disconnected from a root hub port, if there is at least one device behind the UHCI controller that is armed for wake.

Tsuneo