cancel
Showing results for 
Search instead for 
Did you mean: 

STML152 EXTI9_5 and USB

jwill343231
Associate
Posted on February 26, 2013 at 06:37

While trying to get an interrupt working that monitors the USB VCC voltage to detect USB cable connection/disconnection, I found a very strange problem. Whenever USB is enabled (as it should since that's what I'm monitoring), the EXTI9_5 interrupt will not fire. This is despite my attempts to ensure that EXTI9_5 interrupt has higher (lower value) priority.

If I disable USB by not allowing the USB connection to start, the interrupt triggers as expected, so the initialization code is correct in that sense.

After looking at the reference code for the STM32L152D-EVAL, I noticed that in the Mass Storage section, the Joystick interrupts are disabled before the USB is enabled:

/* Disable the JoyStick interrupts */

  Demo_IntExtOnOffConfig(DISABLE);

They joystick uses the same EXTI9_5 interrupt.

This is in mass storage start. So, I am suspecting that there's something  that prevents EXT (I'm using EXTI6 ) from working with USB. Is this the case? Why is the joystick disabled beforehand? Are the USB interrupts interfereing with EXTI9_5?

I'd appreciate any insight into this.
2 REPLIES 2
tsuneo
Senior
Posted on February 26, 2013 at 08:52

> Whenever USB is enabled (as it should since that's what I'm monitoring), the EXTI9_5 interrupt will not fire.

Does your board mount a USB ESD protection chip, like USBLC6-2 ?

USBLC6-2

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00050750.pdf

This chip disturbs detection of VBUS drop (ie. disconnection of USB plug).

This chip has an internal diode across D+/D- and VBUS.

D+ -->|-- VBUS

While D+ pull-up is enabled, the VBUS voltage is kept in 'high'' level, passing through this diode. In this reason, ESD protection chips with high-side diodes aren't good for USB devices, which require VBUS sense. USBLC6-2 should be applied just for the downstream ports of hosts/hubs.

Replace the chip with the other one, which doesn't have high-side diode, like

NUP4016P5T5G

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

It is a pity that the reference designs, such as ST STM3210B-EVAL, STM32L152D-EVAL (optional), Keil MCBSTM32, mount this chip. If you've already mount this chip, cut the VBUS trace to this chip.

Tsuneo

jwill343231
Associate
Posted on February 26, 2013 at 16:14

Tsuneo,

Thank you very much for your answer.  Yes, I do have the default ST ESD protection diodes on the USB data lines. It seems that with the pullup enabled, there is still 1.5V present on the line, so clearly this will cause issues with the logic levels and will prevent it from being detected.

I'll just use another technique to detect USB connection/disconnection.