I have found that many USB wall chargers use a resistive voltage divider to set the D+ and D- pins to a specific voltage, usually between 2 and 3 volts. Other USB wall chargers short the D+ and D- pins together with no connection to anything else. From my experience some devices will not accept a charge rate above 500mA on the chargers using the voltage dividers, but will charge up to their max input on a charger with the data pins shorted. I have read things that suggest the opposite may be true as well, but have been unable to verify this. I am hoping to figure out which method provides the best compatibility with all USB devices.
What is the ideal way to handle data pins D+ and D- on a USB power adapter to be compatible with fast charging on devices? ... I am hoping to figure out which method provides the best compatibility with all USB devices.
It is for practical purposes impossible to make a truly universal charger using any combination of unchanging shorts or resistors on the USB charger or target device data lines because you are contending with manufacturers who are attempting to stop you doing exactly what you are trying to do. For example, Apple implement a number of charging control schemes using various combinations of resistor dividers, arranged so that only a "matching" power supply and target equipment will work together. While arguments could be advanced that such arrangements allow optimum charging performance, it is not obvious how this can be the case for Lithium Ion / Lithium Polymer batteries and a more than adequate degree of charging control can be and is achieved by many other manufacturers without using such techniques. An example of one such Apple arrangement is provided below.
However, by walking in the footsteps of others who have already investigated this area you can achieve a reasonably good compromise.
Many manufacturers do not publish specifications of their custom arrangements and the best you can do is either analyse their products yourself or learn from those who have done this already and who kindly make their knowledge available.
One such source is the documentation for the Lady ADA / ADA fruit Mintyboost USB charger.
This is more a saga than a tutorial!!! :-). You can start at the end and work back to find how the latest version uses what they know to maximise compatibility of start at the early accounts and follow their development path. Both approaches are valid depending on how much you want to know.
Here The mysteries of Apple device charging tells you about, well, the mysteries of Apple device charging - and some other useful material along the way.
Ugh / Wow! - one Apple resistor arrangement. This is from an official iPhone 3GS charger:
Here is their version 2 compatibility list which is worth looking at if you are trying foir a universal solution, as it lists a number of examples where the standard charger does NOT work but where a "cable hack" allows it to work fully or partially.
Here is a list of results using the version 3 Minty Boost with a range of cellphones
If you emulate their interface you should be able to achieve similar compatability.
Update - late 2016:
USB Dedicated Charging Port Controllers:
SE user florisla has noted the existence of 'new' ICs aimed at providing dedicated USB charging port capabilities. He notes as an example the TI
"TPS2513A-Q1, TPS2514A-Q1 USB Dedicated Charging Port Controller"
The best way of summarising its capabilities are a look through the summary given on its data sheet - see below:
I found this page answers your question clearly. I quote the relevant parts below.
The BC1.2 outlines three distinct types of USB port and two key monikers. A "charging" port is one that delivers currents higher than 500mA. A "downstream" port signals data as per USB 2.0. The BC1.2 specification also establishes both how each port should appear to the end device, and the protocol to identify what type of port is implemented. The three USB BC1.2 port types are SDP, DCP, and CDP (see Figure 1):
- Standard Downstream Port (SDP) This port features 15kΩ pulldown resistors on both the D+ and D- lines. The current limits are those discussed above: 2.5mA when suspended, 100mA when connected, and 500mA when connected and configured for higher power.
- Dedicated Charging Port (DCP) This port does not support any data transfer, but is capable of supplying charge currents beyond 1.5A. It features a short between the D+ and D- lines. This type of port allows for wall chargers and car chargers with high-charge capability without the need for enumeration.
- Downstream Port (CDP) This port allows for both high-current charging and data transfer fully compliant with USB 2.0. It features the 15kΩ pulldown resistors necessary for the D+ and D- communication, and also has internal circuitry that is switched in during the charger detection phase. This internal circuitry allows the portable device to distinguish a CDP from other port types.
Even with the BC1.2 specification available, some electronics manufacturers develop custom protocols for their dedicated chargers. When you attach one of their devices to a fully compliant BC1.2 charging port, you may still get the error message, "Charging is not supported with this accessory." Despite this message, these devices may still charge, but the charge currents can be extremely small. Fortunately, almost all of these proprietary dedicated chargers identify themselves by a DC level set on the D+ and D- lines by a resistor-divider between 5V and ground
One might consider data signal levels are 0.0–0.3 V for logical low, and 2.8–3.6 V for logical high. Without a voltage dividing network to two shorted data pins, the voltage on them is free to float. Even though twisted data wires providing some shielding from stray electromagnetic signals, they can still potentially induce unpredictable voltages on the line. On the other hand, a voltage dividing network clamps the voltage at a safe 2.5v.
There is no ideal way to handle USB data pins to provide compatibility and "fast charge". There could be many different chargers, and there are many USB devices/phones/tablets that need charging. Historically there were two approaches:
The device is a "smart device". It tries to detect various signatures of the port it is connected to, and selects the proper charging mode for itself. The device obviously does this sequentially, and it takes time to wade through timeouts.
The charging port is a smart port. This idea was implemented in some TI chips and SMSC/Microchip hubs. The idea for the charging port is/was to assert different charging port signatures (Apple 2/2.7V, Sony, sequencing by BC1.1, BC1.2, or Dedicated charger/China standard, etc) one at a time. Again, since there were no way to have a reliable feedback that the charger signature is the right one for a particular device (other than to measure supplied/consumed current), the sequencing takes a lot of time, needs VBUS off-on resets, etc. More, a USB device's battery might be in several different states of charge, (dead, weak, fully charged, etc.), the consumed current cannot be a reliable indicator of anything, the system wait time becomes undeterministic, so the search/switch algorithm cannot yield anything good.
Real trouble happens when both port and device are trying to be "smart". Then everything gets screwed, and all bets are off.
The USB Battery Charging specifications 1.2 tried to impose a restriction: the port is passive, and the device initiates sequential signature and measures the port response, and only then the device turns into full consumption mode (if it needs it). The limit was VBUS=5V.
The QualComm QC (quick charging) method went a step further, and allows increasing the default USB voltage from 5V to 9, 12, 15, and 20V. After the device asserts some low-level signaling sequence on D+/D-, it then signals to the charger which voltage level it can accept by asserting certain DC combinations of voltages on D+ and D- wires. It is very simple method.
The new USB Power Delivery specifications are providing means for a port and a device to be both really smart. The initial specification called for serial protocol over VBUS (to make it happen the VBUS must be free of heavy capacitive de-coupling). This specification is now abandoned in PD Rev3.0 with advent of Type-C connector, and the negotiation between power roles of ports and devices (producers and consumers) is meant over a dedicated CC wire (Communication Channel).
In addition to full PD negotiations, the Type-C cables are meant to have electronic markers, little ICs in one of overmolds, who should advise consumers (sinks) and producers (sources) on how much current a particular cable can handle. [All USB3.1 C-C cables are required to have the eMarkers embedded, but I have not seen one yet in open market].
As of time of writing (Jan 2017), every electronics department (including Walmart) might have about 20% (1 out of 5) chargers with QC functionality, and none with PD functionality. I have some gut feeling that this proportion will not change.
In summary, the most compatible charging port signature seems to be of China-style, with D+/D- shorted together and floating relative to GND and VBUS.