I’m the past few years, most mobile devices have switched from the proprietary charging connectors to micro USB. While it has it’s issues, such as a crappy connector that will fail, it was a great change in my mind. For the certification board, the goal was to build a USB device charger. That turned out to be more complicated than I had originally anticipated. You cannot just plug a device in and provide power. Some devices will just draw power, but that is a violation of the USB standard. Adafruit has a good article about designing their mintyboost and the troubled they encountered with this issue, it was what started me researching this issue. Some of the information here was found in that original post, but most of it came from maxim integrated’s application note named The Basics of USB Battery Charging: A Survival Guide (number 4803).
USB standard
The USB standard specifies how much current can be drawn and how a device should request power. By default, a USB 2.0 device is only allowed to draw 100mA before enumeration. After enumeration, it can request up to 500mA from the host. The host can then allow this or deny it and the device is supposed to follow this. That is called power arbitration. USB 3.0 increased these numbers to 150 and 900 respectively. This still does not satisfy the power requirements for many modern devices, and continues to require enumeration before allowing more than 100mA current to the device.
Most USB powered devices such as fans and lights (in general, those devices which do not require USB communication, and as such do not enumerate as USB devices) will just go ahead and draw however much power they require from the USB port. They do not enumerate, and as such cannot follow the rules for requesting more power. This can be an issue, as USB 2.0 ports are only required to be able to supply up to 100mA, though most can safely supply a much larger number. However, devices which enumerate will (in general) follow the standard and only draw as much power as the USB host allows.
This becomes an issue when you are building a USB charger though. Adding USB chips onto chargers is a complete waste of space and money - their only purpose would be to let the device know that it can draw higher amounts of current. However; even if there is power on the VUSB line, if the device does not enumerate it will not draw more than 100mA. Sometimes they do not draw any amount of current if they cannot enumerate - their behavior depends on the specific implementation of the USB stack.
Enter the Battery Charge Specification
The Battery Charge Specification is a supplementary USB specification. The current version is the Battery Charge Specification, Rev1.1, 4/15/2009 (shortened to BC1.1 throughout this post). Before BC1.1, USB devices were either classified as low power (using less than 100mA and not requiring enumeration to draw the full amount) and high power (using up to 500mA, but requiring enumeration and power arbitration before drawing more than 100mA). Even this is not enough though. To remedy this issue, BC1.1 defined three source types:
- Standard Downstream Port (SDP): Your standard USB port. The port must be able to provide 100mA, and can be configured to provide up to 500mA (max), granted that the host can actually supply that amount of current. An SDP can be recognized in hardware by detecting that the SUB data lines, D+ and D- are separately grounded through 15kΩ, but it still must enumerate to be USB compliant. Though much present day hardware draws power without enumerating, this behavior is in violation of the spec.
Charging Downstream Port (CDP): This is newly defined in BC1.1. It is similar to an SDP, however it can supply up to 1.5A before enumeration. A CDP can be recognized by means of a hardware handshake - this takes place before turning the data lines over to the USB transceiver, which allows a CDP to be detected before enumeration and allows USB compliant devices to draw power before or even without enumerating.
Dedicated Charging Port (DCP): This is another newly defined type in BC1.1. This is for adapters which can provide power to USB devices, but do not enumerate. It allows charging to occur without any digital communication. As defined in BC1.1, these can supply up to 1.5A (though practically there are some which supply less and some which supply more) and can be identified by a short (200Ω resistor is usually used) between D+ and D-.
Complications
Ideally this standard would solve all of our USB charging issues, but as always there are complications. Practically what happens is that some devices follow some of the standard. Most USB wall adapters that I have taken apart use what looks like a resistor divider network to set specific voltages on D+ and D- (this is what the minty boost does). But, as you can see in Adafruit’s article, this doesn’t always work. Some tablets look for both lines to be held at 1.2V, some phones want the data lines to be shorted together, some want 2.7V on D+ and 3.0V on D- (not necessarily correct values, but just used as an example).
Originally for the Amplab basic soldering board, I was going to put a resistor divider with a potentiometer so that the setting could be adjusted. That is ugly though, and it is not a complete solution. It would have worked for some devices, but then you would run into one which wouldn’t work. At that point, you’d have to take out your screw driver to adjust the pot. But then it would no longer work with your other devices. You would also have no idea where the pot needed to be adjusted to. The other people working on this project as well as myself were unhappy with this solution.
The One Chip Wonder
One of the others on the project found an excellent chip. The TPS2511 is a USB dedicated charging port controller and current limiting power switch. It automatically provides the correct electrical signatures on the data lines to charge compliant devices amount a few different charging schemes. From the datasheet, it seems like an excellent chip, though I have not actually tried it out yet - currently the boards are at the fab house. As long as it works as expected, I will most likely include this (or a similar chip) in my future USB charging devices - that is, if I ever make any more. There is also a similar chip which does not include the pass transistor (TPS2513).
That’s all for now, I’m not sure when the next post will be, but it will probably be about the cert board again. It might also be about the clock - I have yet to start coding for that. As always, thanks for taking the time to read and I hope that you learned something useful.