USB ESD protection problem and improved USB detect circuit for battery powered devices

I encountered this problem on the Atmel SAMD21 Xplained Pro Evaluation Kit.

The data-logging device that I developed is mainly battery powered, but uses USB every once in a while to download the data and recharge the internal battery. A resistor divider (R307 and R308) is used to detect when USB +5V is connected. This generates a rising edge interrupt on PA14 and wakes up the ARM micro from STANDBY sleep mode. The ARM micro then starts the USB stack, which enables an internal 1.5kΩ pull-up resistor to +3V3 on USB D+ (pin PB05). For more info regarding the pull-up resistor read this page regarding USB speed identification. The pull-up resistor basically tells the USB Host “hey, I’m here” and the operating system proceeds to enumerate the USB device.

The problem rears it’s head when USB is disconnected. USB +5V disappears, but the 1.5kΩ pull-up resistor to +3V3 stays enabled. There is a unintentional current path through the USB ESD protection diode D300 and the PA14 node voltage drops down to 1.2V (logic high), not 0V (logic low) as expected. Consequently, the ARM micro keeps the USB stack and the pull-up resistor enabled and wastes 33μA the whole time. That’s a lot if you want to make the device last a year.

 

vbus-sense-influenced-by-pull-up-on-dp

Here is my improved circuit:

improved-usb-protection-and-detect-circuit

Yes, I know, it’s not earth shattering… I just tweaked the resistor divider values and added an extra resistor (R30). Here are some sound engineering calculations that proves that it will work over all tolerances (and that’s the difference):

resistor-divider-calculations

When USB +5V is present (actually, it could be as low as 4.35V), the minimum voltage on PA14 will be 1.956V, which is still above the maximum threshold of 1.906V.

When USB +5V is absent, the USB Speed pull-up resistor will pull PA14 up to 0.966V (worst case), which is still below the minimum threshold of 1.040V (when VDDIO is 3.465V).

It is possible to unintentionally power up the device via low value resistor R1 when USB is connected, but R30 limits the amount of parasitic current that flows into GPIO pin PA14. Remember that there are internal ESD protection diodes connected to each GPIO pin of the ARM micro and this will form an unintentional current path to the VDDIO supply rail.

UPDATE!

I recently came across an alternative solution to the problem. There are ESD protection devices, for example WE-TVS 82400102 (Digi-Key part number 732-4473-1-ND) that have a diode to block the parasitic current flow:

3 replies
  1. Phang Moh
    Phang Moh says:

    Hi Pieter,

    By detecting the VUSB being removed (detect low instead of high), you could perform a USB detach that would disable the 1.5kΩ pull-up resistor?

    • Pieter Conradie
      Pieter Conradie says:

      Hi Phang,

      Thanks for posting 🙂 Referring to the original SAMD21 schematic, the SAMD21 is unable to detect that VUSB is removed, because +3V3 is being supplied via the 1.5kΩ pull-up resistor and the voltage at PA14_USB_VBUS is about 1.2V. The SAMD21 can not detect that VUSB is removed and therefor does not disable the 1.5kΩ pull-up resistor.

      I have recently come across another solution. There are ESD protection parts with a diode to block the parasitic current flow, for example WE-TVS 82400102 (Digi-Key part number 732-4473-1-ND). I have updated my post with this new info.

      Best regards,
      Pieter

      • Phang Moh
        Phang Moh says:

        Hi Pieter,

        Thanks for the reply. I’m doing probably the same thing as you (logging and using the USB only once in a while to pull out the logged data) but I’m using a battery (Li-SOCL2) without any regulator. That diode is a simpler solution, thanks for pointing that out.

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply