This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB still draws current after being disabled

Other Parts Discussed in Thread: MSP430F5529

We are currently using the MSP430F5529 chip with our prototype. There is an issue with the USB drawing current when it is not in use.

Before USB was enabled, the board  would draw 80 uA of current. After calling the function USB_setup(TRUE, TRUE) at start up the board would draw 209 uA while in low power. I fixed this by only calling the setup function after the USB was plugged in. But after it is unplugged, it starts drawing the 209 uA again.

So I tried calling these functions when the USB is disconnected:

USB_reset();
USB_disable();
USB_setEnabledEvents(0x0000);
USB_disconnect();

However, the device still draws 209 uA so it seems like this is not successfully disabling the USB. So my question is, how do you successfully reverse the current draw caused by the function USB_setup(TRUE, TRUE)?

For quick reference, here is the current draw for the different scenarios mentioned:

1. USB not enabled at all: 80 uA

2. USB enabled at beginning of program: 209 uA

3. USB only enabled after it is plugged in: 80 uA (before plugged in) -> 209 uA (after being plugged in and then unplugged)

  • For anyone with the same problem, it came down to this line in the USB_init function:

    USBPHYCTL   =     PUSEL; 

    This enables the DP and DM lines for USB, but it is not disabled in the USB_disable function. So I just added USBPHYCTL &= ~PUSEL when USB is disconnected and the current went back down to 80 uA.

  • Hi Christopher,

    This is a good point - we will file this to be improved in the USB API. Thanks for pointing it out!

    -Katie

  • Hello,

    I believe the order in which the USB APIs are called would have helped with your issue so you would not have had to set the USBPHYCTL &= ~PUSEL in the USB_disconnect() function.

    After you un-plug the USB cable, calling the following APIs in the following order should bring down the current:

    USB_disconnect()

    USB_disable()

    The following is stated in the comments for the USB_disable() API in usb.c file:

    //! If a handleVbusOffEvent() occurs, or if USB_getConnectionState() begins

    //! returning ST_USB_DISCONNECTED, this function should be called (following a

    //! call to USB_disconnect()), in order to avoid unnecessary current draw.

     

    Regards,

    Arthi Bhat

**Attention** This is a public forum