74
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Some useful hints may be acquired from the official USB "Battery Charging" specs, e.g. here. \$\endgroup\$
    – JimmyB
    Jul 29, 2014 at 8:18
  • \$\begingroup\$ If you are just looking for a quick solution you can go with a dedicated charging port controller. See my answer here: electronics.stackexchange.com/a/246670/41430 \$\endgroup\$
    – bcelary
    Jul 19, 2016 at 1:11

3 Answers 3

40
\$\begingroup\$

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):

  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.
  2. 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.
  3. 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.

figure 2

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

Figure2


Added Comment:
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.


For more details, check out the Page I sourced or take a look at USB.org's PDF describing the USB Battery Charging BC 1.2 specification

\$\endgroup\$
39
\$\begingroup\$

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.

Mint Boost home page
Overview
Walk through of design process - of value to designers

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:

enter image description here


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.

eg the above takes you to special cases such as the Samsung D series "hack" here or the RAZR V3 modifications here


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:

enter image description here

\$\endgroup\$
10
  • 3
    \$\begingroup\$ Nice answer, but it is not clear why manufacturers would opt for a custom charging signal. If a 'universal' charger uses shorted pins (e.g. as specified in the BCS 1.2 spec) WHY would a device producer not want their device to charge with it? \$\endgroup\$
    – jiggunjer
    Apr 20, 2015 at 8:23
  • 7
    \$\begingroup\$ @jiggunjer You have apparently not met the most successful seller of "IT" consumer products in the world :-). They specialise in making theiur gear only work with their gear. (Hint: Apple) \$\endgroup\$
    – Russell McMahon
    Apr 20, 2015 at 14:17
  • 4
    \$\begingroup\$ I have, and that's one of the reasons I don't own any of their products :) I just reasoned that compatibility sells--but maybe their marketing says otherwise. Theres also products with custom chargers that can not be bought seperately, forcing people to test dozens of 3rd party brands. I just find it hard to see the good in that design strategy... \$\endgroup\$
    – jiggunjer
    Apr 20, 2015 at 16:15
  • 3
    \$\begingroup\$ As to Apple and their lack of compatibility: Its worked both for (increased profit margin) and against them (reduced gross sales), the net effect is hard to tell. As of the time composing this comment, Android devices sales world wide far out number Apple device sales. I wont ever buy apple because of their incompatibility or price, and monopolistic market behaviors. I do not think that I am alone in this \$\endgroup\$ Aug 4, 2016 at 14:23
  • 3
    \$\begingroup\$ You could add to your (otherwise fine) anser that the most compatible solution these days is to use a Dedicated Charge Port controller chip, like a TI TPS2513A. \$\endgroup\$
    – florisla
    Nov 8, 2016 at 8:48
11
\$\begingroup\$

2017 update:

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:

  1. 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.

  2. 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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.