Electronic – How to use a greater USB charge current without device enumeration

usbusb device

I'm designing a device with USB communications, using an STM32F105 microcontroller. It has a LiPo battery, which charges from the USB port using an LTC4077 charge controller. It will generally use a high-current charging port to charge the battery, but will sometimes be plugged into a PC for data communications.

To stay within the USB specification, the charge controller initially allows a charge current of 100mA. If the STM32F enumerates with an appropriate USB host, it asserts a logic line telling the charge controller to take 500mA.

I have a power switch in between the battery/charger and the rest of the circuit. When the switch is off the microcontroller doesn't have power, and the battery will charge at 100mA.

Q: How do I charge at a higher current without microcontroller intervention?

The USB Battery Charging Spec 1.2 (found here) gives different hardware options for charging ports, to allow "Portable Devices" (like mine) to determine the capabilites of the charging port without enumeration. For example, a "Dedicated Charging Port" (with no communications capability) puts a 200-Ohm resistor between D+ and D-. If the Portable Device detects this connection, then it can assume the device can supply higher current.

I have found some charge-management IC's, such as the MAX77301, which handle this detection and set their charge current levels appropriately. However, they do their own enumeration, and do not pass through the USB data. I assume they can't be placed in parallel with the data communications path.

What am I missing? What is considered good practice, to accomplish what I am looking to do?

Thanks.

Best Answer

You can put a charge detector in parallel as long as you keep the stubs extremely short. I have done this before with a Fairchild charge detector. Don't remember the exact part number off the top of my head.

Or you could take a look at the BQ24392 from TI. It does its own enumeration (well, not enumeration... it does the charger detection upon initial connection, then connects the USB bus to the host), but it passes the detection results out, and it incorporates a USB bus switch so that the USB traces pass through it to the host. No stubs. It is specifically designed with USB 2.0 in mind. It correctly detects every type of charger in the known world, whether the charger is compliant with USB specifications or not.

But there may be a simpler option. How big is your battery? For smaller batteries (say less than 1 Ah) it may be easiest to simply always enable the 500 mA of current draw from USB. Of course, this means you will not comply strictly with the USB spec which dictates that until a profile is assigned, you have to stay under 100 mA. But in practice, it will work OK. It is rare, nowadays, to find a host which will object to the 500 mA being pulled from the USB port.