Embedded Development & Embedded Programming

USB Charging Protocol

Hello everyone my name is Alex Krejcie and I'm a Project Engineer here at DMC. Today I'm going to be talking to you a bit about USB charging and powering of devices.

So, just a brief outline of what I'm going to discuss today. First, I'm going to go over USB, the protocol and sort of how it came to be, and then I'm going to specifically about battery charging specification that was released in 2009 and the three different charging ports that were defined there and then also Apple's own proprietary charging specification.

So, USB has really become the standard of connectivity for devices these days. However, when it was originally created it was not intended as a power supplying bus or a charging bus but the widespread use of it and the availability then of a five volt power line solely adapted it into a power bus or a charging bus. Because of that, there was an addendum created in 2009 to address this use of USB cables.

Just a quick outline of the different cables you are likely to see. Typically nowadays you see a type AB and then a different micro, usually a micro B adaptor for cell phones and the like. And then on the left I just have the wiring: most USB lines containing the five volt power line, a ground, and then two data lines, or plus and minus lines.  I'm not going to get into too much detail about the specific USB communication protocol today, more just talking about the power and charging portion of it.

So, as I said in 2009 The USB Foundation released the battery charging specification and this spec. filled in gaps for power supply and battery charging that were not present in the original spec., and primarily introduced three different types of ports: the standard downstream port, which is what everybody is used to using as a standard USB communication port, and then a charging downstream port, and a dedicated charging port. And then on the next page here this is just a short summary of the different hardware configurations of these three ports from the connection side.

So, the first one I'll talk about is the standard downstream port; and this is what you're used to seeing just on your computer or any other device that communicates with your phone or USB device. It allows up to 100 milliamps before the negotiation, so before your computer talks to the USB device and decides what it is. After negotiation it can supply up to 500 milliamps and then this has been upped to 0.9 amps or 900 milliamps for USB 3.0. It also has to be capable of going down 2.5 milliamps if the host computer device suspends this, your phone or something. So, essentially if you put your laptop to sleep or something, it's going to tell the device to suspend and only draw 2.5 milliamps.

In terms of recognizing this port, the USB data-lines are just going to be pulled to ground, through a 15 kilo-ohm resister it can go all the way up to 25 but this is how a certain device detects whether or not it's been connected to a standard downstream port. 

The next port that was added was the charging downstream port. Now this is a multi-purpose port so it still has capabilities of doing communications but it has increased the capability of power draw up to 900 milliamps for high speed communication and all the way up to 1.5 amps for lower full speed USB communication. The detection of this style port requires a hardware handshake which is in more detail in section 3.2.3 of the spec. and this typically requires some sort of hardware support, either on your computer or whatever you're plugging your device into and this isn't widely seen but there's hubs and different chips that can be implemented to essentially include this hardware and allow whatever device you're plugging in to detect that it's getting plugged into a charging downstream port.

And then lastly, we have the dedicated charging port, and this is what we will typically see in wall warts, any sort of just power only USB connection you'll see for charging your phone or plugging in and powering your device. And this is allowable, up to 1.5 amps, and obviously there's things that don't meet this spec. that can even supply more than that. And this is detected essentially by shorting your two data-lines together. This is a charging only port, it can't do any sort of communications so they short the D+ and D- lines together and that's the way that you indicate that this is a dedicated charging port.

And then lastly, on top of all that there's the Apple propriety specification. So, Apple released their own spec. for charging prior to the USB spec. being released because they wanted a standard to have all their devices adhered to. And the Apple spec. is purely for charging only ports so if you are plugging into a wall wart or something like that, it essentially includes three device classes that allow either a 500 milliamp, 1 amp or 2 amp power draw and these devices are determined by measuring the voltages on the D+ and D- lines and these are typically achieved by doing resister dividers on your supply voltage.

So, if anybody wants a little bit more information on this topic, below is the USB.org document library essentially with all these different specs, and then I also have listed here a couple of sites that produce hardware that is capable of doing the hardware handshake for charging downstream port. Thank you for listening today, hope you learned a little something and feel free to check out DMC's website or call us for more information. Thank you.