USB has become as
much a standard for connecting power to portable devices as it has for serial
communication. Recently, the power aspects of USB have been extended to cover
battery charging as well as AC adapters and other power sources. A tangible
benefit of this widespread use is the emergence of interchangeable plugs and
adapters for charging and powering portable devices. This, in turn, allows
charging from a far wider variety of sources than in the past, when each device
required a unique adapter. 

Arguably the most
useful benefit of USB’s power capabilities is the ability to charge batteries
in portable devices. Nonetheless, there is more to battery charging than
picking a power source, USB or otherwise. This is particularly true for Li+
batteries, in which improper charging can not only shorten battery life but
also become a safety hazard. A well-designed charger optimizes safety and the
user experience. It also lowers cost by reducing customer returns and warranty
repairs.

Charging batteries with USB requires balancing battery “care and feeding” with
the power limitations of USB and the size and cost barriers ever-present in
portable consumer device designs. This article discusses how to achieve this
balance. 

An array
of power sources
The USB
specification spans several generations of power management. The initial USB 1
and 2.0 specifications described two types of power sources (5-V 500-mA and 5-V
100-mA, respectively) for powering connected devices. These specs were not
written with battery charging in mind but intended to power only small
peripherals like mice and keyboards. Of course, this did not stop designers
from working out USB battery charging on their own. However, without a unified
guide, interoperability between different devices and chargers was hit-and-miss.
This limitation motivated the recent development of a supplementary USB
specification, the Battery Charging Specification, Rev 1.1, 4/15/2009 (BC1.1)¹,
that acknowledges charging and describes power sources that can supply up to
1.5 A. Though titled “Battery Charging Specification,” the document contains
nothing about the specifics of charging batteries. It deals only with how power
should be drawn from a USB port for charging. Actual charging methods are still
left up to the individual designs. 

Prior to BC1.1,
all USB power ports, when active (i.e., “not suspended,” in USB parlance), were
classified as either “low-power” (100 mA) or “high power” (500 mA). Any port
could also be “suspended,” which means nearly off but still able to supply 2.5 mA.
For the most part, ports on PCs, laptops, and powered hubs (a powered hub is a
USB breakout box with its own wall wart for bus power) are “high-power,” while
ports on hubs that receive no power other than what is supplied by the upstream
USB host are considered “low-power.” Once plugged in, a device is allowed
initially to draw up to 100 mA while enumerating and negotiating its current
budget with the host. Subsequently, it might be allowed to raise its drain to
500 mA, or it might be held at 100 mA. This is detailed in the USB Serial Bus
Specification Rev 2.0, section 7.2.1.4. 

BC1.1 goes beyond
the power distribution described in USB 2.0 by defining additional power
sources for charging. It defines three different source types: 

1)    
Standard
downstream port (SDP).
This is the same port defined by the
USB 2.0 spec and is the typical form found in desktop and laptop computers. The
maximum load current is 2.5 mA when suspended, 100 mA when connected and not
suspended, and 500 mA (max) when configured for that current. A device can recognize
an SDP with hardware by detecting that the USB data lines, D+ and D–, are
separately grounded through 15 kΩ, but it still needs to enumerate to be USB-compliant.
In USB 2.0, it is not strictly legal to draw power without enumerating,
although much of present-day hardware does just that and in violation of the
spec. 

2)    
Charging
downstream port (CDP).
BC1.1 defines this new, higher-current
USB port for PCs, laptops, and other hardware. Now the CDP can supply up to 1.5
A, which is a departure from USB 2.0 because this current can be supplied
before enumeration. A device plugged into a CDP can recognize it as such by
means of a hardware handshake implemented by manipulating and monitoring the D+
and D– lines (see USB Battery Charging Specification, section 3.2.3.). The
hardware test takes place before turning the data lines over to the USB
transceiver, thus allowing a CDP to be detected (and charging to begin) before
enumeration. 

3)    
Dedicated
charging port (DCP).
BC1.1 describes power sources like
wall warts and auto adapters that do not enumerate so that charging can occur
with no digital communication at all. DCPs can supply up to 1.5 A and are
identified by a short between D+ to D–. This allows the creation of DCP “wall
warts” that feature a USB mini- or micro-receptacle instead of a permanently
attached wire with a barrel or customized connector. Such adapters allow any
USB cable (with the correct plugs) to be used for charging. 

Additional
details on these port types are described in the USB Battery Charging Specification,
Rev 1.1, 4/15/2009. 

Detecting
the source type
The trick for a
device that connects to any USB receptacle and uses that power to run itself or
charge a battery is knowing how much current is appropriate to draw. Attempting
to draw 1 A from a source capable of supplying only 500 mA would not be good.
An overloaded USB port will likely shut down, blow a fuse, or trip a
polyswitch. Even with resettable protection, it will often not restart until
the device is unplugged and reconnected. In ports with less rigorous
protection, an overloaded port can cause the entire system to reset. 

A portable design
has choices about how to manage port detection. It can be compliant with BC1.1,
compliant only with USB 2.0, or noncompliant. If fully compliant with BC1.1, it
must be able to sense and limit input current for all USB source types,
including legacy USB 1 and 2.0 ports. If compliant with 2.0, it will charge
from SDPs after enumeration but may not recognize CDPs and DCPs. If it cannot
recognize a CDP, it can still charge and remain compliant but only after
enumeration in the same way that it would with an SDP. Other partially
compliant and noncompliant charging schemes will be discussed later. 

A device can
implement port detection using its own software or can employ a charger or
interface IC that detects by interacting with the USB D+ and D– data lines
without relying on system resources. The design’s partitioning of these roles
depends on the system architecture. For example, a device that already employs
a microcontroller or a dedicated IC to manage power may prefer to use that IC
for port detection and current selection as well. Because the device can
already communicate with the host over the USB connection, it can make charging
choices based on the results of enumeration and configuration. These choices
can be under the control of an applications processor or a separate
microcontroller that might handle power management and other system functions.
The system detects the port type, enumerates, and sends appropriate commands to
a charger. The charger handles the hardware and safety aspects of charging and
has built-in limits that will not allow the system to harm the battery (Fig. 1).

Fig. 1: Nonenumerating charger. The USB transceiver and
microprocessor handle USB enumeration. The microprocessor then sets the battery
charger to the correct parameters.

A different device might not be designed to
communicate with USB or does not want to devote system software to manage USB
charging. It just wants to use available USB ports as a power source. This
approach can be used to avoid complexity or in response to worries that a
software bug might cause incorrect charging. Because the system does not
enumerate, the best charging option is a self-enumerating charger IC. The
charger takes care of port detection and selects the appropriate USB load
current limit without requiring help from the system (Fig. 2).

Maxim_Fig2_Self-Enumerating-Charger

Fig. 2: A self-enumerating charger connects directly to the USB
data lines, allowing simple systems to fully utilize USB charging without a USB
transceiver or microprocessor resources.

USB connection terminology
At this point,
some USB terms deserve clarification. They are “attach,” “connect,” “enumerate,”
and “configure.” 

  • Attach: The
    physical process of plugging in the USB cable.
  • Connect: When
    the device (that you just plugged in) connects 1.5-kΩ pull-up resistance to the
    D+ or D– data lines.
  • Enumerate: The
    initial data exchange between the device and the host to identify device type.
  • Configure: Set
    device parameters.

In USB 2.0, it is
during enumeration and configuration that the device learns how much current a
USB port can source. Enumeration and configuration require a digital
conversation between the device and the host. BC1.1 expands the USB spec. In
addition to the USB 2.0 options, BC1.1 also allows “dumb” methods of
determining port type so that, with some ports, charging can take place without
enumeration. 

Port detecting
and self-enumerating charger
The MAX8895
determines how best to use available input power without relying on the system
to evaluate the power source. The charger automatically determines the adapter
type and can distinguish between: 

  • DCP: 500 mA to 1.5 A
  • CDP (host or hub): to 900 mA (580 mA
    during chirp) for high speed; to 1.5 A for low and fast speed
  • Low-power SDP (host or hub): 100 mA
  • High-power SDP (host or hub): 500 mA

The available
current can be used by the battery or the system or it can be split between
them. A built-in suspend timer automatically triggers suspend when no bus
traffic is detected for 10 ms.

In addition to automatically optimizing current from USB and adapter sources,
the MAX8895
also deftly handles switchover from adapter and USB power to battery power; it
allows the system to use all available input power when necessary (Fig. 3). This enables immediate
operation with a dead or missing battery when power is applied. All
power-steering MOSFETs are integrated, and no external diodes are needed. Die
temperature is kept low by a thermal regulation loop that reduces charge current
during temperature extremes.

Maxim_Fig3_MAX8895

Fig. 3: The MAX8895
charger self-enumerates with a USB source to optimally set charge current
depending on the type of connected power source. It can also maintain system
operation while bringing up a deeply discharged battery.

Adding port
detection
BC1.1 describes
hardware detection methods to determine port type. The expectation is that
integrated circuitry will be used for this, as with the MAX8895
in Fig. 3, or that this circuitry
will be included in the USB transceiver. Nevertheless, adding port detection,
or at least some subset of it, to an existing charger may sometimes be
preferred. Fig. 4 shows circuitry for
a rudimentary USB charger detection scheme that operates under control of the
system microcontroller. This approach can detect a DCP but cannot distinguish
between an SDP and a CDP. It treats both as an SDP, which means that in some
cases, it can miss the opportunity to draw more charging current from a CDP.
This shortcoming may be acceptable in low-budget designs.

Maxim_Fig4_USB-switch

Fig. 4: A high-speed USB switch
implements a limited form of USB charger detection.

The Fig. 4 connection implements limited
port detection as follows: When the portable device is attached to one of the
three port types, VBUS powers the U1 switch and the device’s microcontroller. A
low logic level on U1’s CB input puts it into detect mode, where the D+ line is
pulled up to the system logic voltage through 10 kΩ and D– is pulled to GND
through 100 kΩ. If a DCP is connected (which has D+ shorted to D–), then D–
will go high. If either an SDP or CDP is connected, D– and the detect output
will be low. If an SDP or CDP is detected, the system then drives CB low to put
the switch into data mode, which connects D+ and D– to the data path for enumeration
and other data transfer. There is a limitation of the above scheme: It will not
recognize and, hence, not immediately charge when attached to a CDP, although
it will charge from a CDP after enumeration. 

Complete port
detection is shown in Fig. 5. The MAX14578
contains all circuitry necessary to detect the connected device (USB cable and
USB CDP or dedicated charger) and control an external Li-ion battery charger.
The device implements USB Battery Charging Rev 1.1-compliant detection logic,
which includes data contact detection, D+/D– short detection, and CDP
identification. In addition, it includes a charge timer and weak-battery-voltage
monitor to support the USB BC1.1 “Dead Battery” provisions. 

The MAX14578
includes a data switch that is compliant with USB high-speed and original
(full-speed and low-speed) signals. It features low on-resistance (RON), low
on-resistance flatness, and very low capacitance. The CDN and CDP pins are also
ESD protected up to 15 kV per the Human Body Model.

Maxim_Fig5_USB-BC11

Fig. 5: Fully compliant USB BC1.1 port detection can be added to a
charger with the MAX14578
USB charging port detector and data-switch IC.

In Fig. 6, simple Li+ charging
functionality is added to a USB device. The MAX8814
can be configured to charge a battery from either 100-mA or 500-mA USB ports.
The circuit initializes at 100 mA. The microprocessor then enumerates the host
to determine its current capability. If the USB port is capable, the charging
current is increased by turning on N1 and R1 in the current-setting network.
The high-level charge is nominally set to 425 mA to avoid exceeding the SDP 500-mA
limit after tolerances are considered. The charger also includes an autobooting
circuit that provides an output signal (ABO) that notifies the system when an
external power source is connected. Although USB-compatible, Fig. 6 does not incorporate BC1.1, so
enumeration is required for charging.

Maxim_Fig6_MAX8814

Fig. 6: The MAX8814
provides a simple low-pin-count means of adding charging to a USB device.
Enumeration is under the control of the system, which monitors and controls
charge current with the ISET pin. This design is USB-compatible but does not
incorporate BC1.1, so enumeration is required for charging.

Other charge
strategies
The landscape for
USB battery charging can be complex. Portable USB-connected devices do not
follow one format and are subject to a variety of constraints — size, cost, and
charge time being the most obvious. Ranking these and other subtler issues can
help you choose a USB charger design. Among these additional design considerations
are: 

  • Must the device be capable of
    full-feature operation with a dead battery once external (USB or adapter) power
    is applied?
  • Are separate input connections required
    for USB and adapter power?
  • Does the device have the computing
    power and firmware to negotiate charging decisions with a USB port?
  • Can charge current be momentarily
    lowered to reduce heat dissipation, or is a switch-mode design required?
  • What input protection measures are
    needed?

Multi-input
charging
With BC1.1, it is
possible for devices to charge only from USB-defined sources. Those devices are
becoming more common, but you still may want to retain the option of charging
with an ordinary, possibly non-USB-compliant, adapter. This is best
accomplished with a dual-input charger that handles the switchover when one
external power source takes over for another. In the past, power handoff was
often done with either lossy OR-ing diodes or discrete MOSFET-comparator
circuits that can become complex when “sneak” current paths and switch timing
are considered. Fortunately, many charger ICs (Fig. 7) now include power handoff control. Integrating this
function does more than simply replace external components. It also improves
transition behavior during power changes because the integrated charger is
aware of what the switchover circuitry is doing.

Maxim_Fig7_MAX8844

Fig. 7: A dual-input charger like the MAX8844 handles charging
from both USB and adapter sources. This device also protects against input
overvoltages up to 28 V.

A common concern
with chargers that accept power from multiple sources, especially ones using a
common barrel connector, is the possible connection to an incorrect adapter. To
anticipate this, the MAX8844 prevents charging for inputs that exceed 7.5 V. It
can also withstand, as well as block, inputs up to 28 V. This protects the
battery, the charger, and downstream circuitry against inadvertent connection
to almost any known adapter type. In addition, the MAX8844 includes
overvoltage-protected LDOs, biased from the USB and adapter (IN) inputs, that
can supply 30 mA to the system. These LDO outputs (SAFEUSB and SAFEOUT) remain
on whether or not the charger is enabled. Other charger functions performed by
the device are battery detection; thermal limiting that reduces charge current
to maintain a low die temperature during ambient temperature extremes; and an
autobooting logic output that signals the system when external power is
applied. 

Battery-load
switching (smart power) vs. direct connection
In USB and
adapter-powered charging applications, a key design decision is whether the
charge circuitry will connect directly to the battery and the system load or
whether additional switching is needed to disconnect the battery from the
system when external power is connected. The two cases are illustrated in Fig. 8.

Maxim_Fig8_Smart-Power

Fig. 8: Illustration of direct connection charging and Maxim’s Smart
Power Selector technology.

The
direct-connection architecture is the simplest and most economical to
implement. Its main drawback surfaces if the battery is deeply discharged and
then external power is applied. In that case, the system may not be able to
boot until the battery reaches an acceptable level. In some applications, it
may be acceptable for a user to wait until the battery partially recharges
before full functionality is restored; however, in other applications,
immediate operation at external power connection is a “must,” regardless of the
battery state. In those latter cases, Maxim’s Smart Power Selector technology
allows the system to use external power while the battery is in a deeply
discharged state. See Fig. 9.

Maxim_Fig9_MAX8934

Fig. 9: A dual-input USB/adapter charger with Smart Power Selector
functionality like the MAX8934
can power the system immediately when external power is applied while it also
charges a dead battery.

In Fig. 9, a low-resistance (40-mΩ) on-chip
MOSFET between the system load output (SYS) and the battery (BAT) serves
multiple functions during charge and discharge operations. During charging,
this Smart Power Selector switch makes the best use of limited USB or adapter
power, utilizing input power not needed by the system to charge the battery. It
also lets the battery serve as a storage buffer, supplying load peaks that may
momentarily exceed the input current limit. During discharge, the switch
provides a low-loss path from the battery to the system. 

System software
again handles communication with a USB host and sends commands to the charger.
The MAX8394 manages the hardware aspects of charging and provides simple hooks
for setting charge parameters relevant to USB and adapter charging. USB input
current limits are preset to ensure that specified limits are not exceeded; a
user-set current is used for adapters. The charger also supplies a complete set
of status and fault signals to the system. 

The MAX8934
includes the latest charging safety features, including new
temperature-dependent charge protocols outlined by the Japan Electronics and
Information Technology Association (JEITA) that halt or reduce charging at
elevated temperatures. In addition, inputs have overvoltage protection (OVP) up
to 16 V, and the device limits temperature rise by throttling charging current
during extreme conditions. 

Switch-mode fast charges up to 2 A with minimal heat
Some compact
devices need high charge currents (well over 1 A) but cannot tolerate the
excess heat that those charge rates would generate in a linear charger. In
those situations, the MAX8903
(Fig. 10) operates a 4-MHz DC/DC
converter that keeps the component footprint small while still delivering up to
2 A to the battery from adapter sources. Like the MAX8934,
the MAX8903
is a dual-input design that accommodates USB and adapter inputs through
separate connections. Switchover between power sources is automatic as is handoff
between input power and battery power.

Maxim_Fig10_MAX8903

Fig. 10: The MAX8903
switch-mode charger with Smart Power Selector capability charges at up to 2 A
from adapter inputs and 500 mA from USB sources.

The MAX8903’s
4-MHz switching rate keeps the switch-mode converter’s passive components tiny
so that a 2-A charger made with this device can be smaller than a linear
equivalent once the lower power loss is factored in. In fact, due to heat
dissipation, most portable devices would not tolerate a 2-A linear charger
design under any conditions. 

Overvoltage and reverse-polarity protection built in
Although the USB
charging specification imposes some order on the power adapter and charger
landscape, USB design remains a generally chaotic environment for portable
devices, especially for those applications that opt to use the ubiquitous
barrel connector for power (common on many adapter-only and dual-input
devices). It is far too easy for consumers to connect a “found” adapter that
may have the wrong output voltage or even the wrong polarity. By integrating
±22-V protection at the charger power input, the MAX8900
adds peace of mind to these designs without requiring external protection
devices or MOSFET switches (Fig. 11).

Maxim_Fig11_switch-mode-charger

Fig. 11: Direct-connect switch-mode
charger with ±22-V overvoltage and reverse-polarity protection.

The MAX8900
is a direct-connect style charger with the system typically connected to the
battery. Its 3.25-MHz switch-mode design keeps components small while charging
at up to 1.2 A with minimal heat dissipation. In addition to bipolar input
protection, battery safety is enhanced by adjusting charge parameters as a
function of temperature in accordance with JEITA guidelines. 

NiMH charging
from USB

Maxim_Fig12_NiMH

Fig. 12: A one-cell NiMH USB-powered switch-mode charger.

Even though it
seems that Li+ cells have taken over the portable world, NiMH cells have not
been standing still. Surprisingly, NiMH energy per volume is only about 15%
lower than Li+, although energy per weight is still quite a bit less. The
biggest weakness of NiMH is its high self-discharge, which has largely been
solved by hybrid NiMH cells, such as the SANYO Eneloop cell, that retain as
much as 85% of their charge after one year. The attractions of NiMH cells are
cost, safety, and easy user replacement, at least when standard cells are
employed. 

Fig. 12 shows a small portable device that is
powered from one AA NiMH cell and charges from USB. The DS2710 charger switches
at approximately 150 kHz and charges the battery at 1.1 A (about 0.5⁰C for a
typical AA NiMH cell). The circuit gets more current into the battery (1.1 A)
than it gets from the USB port (500 mA) because a step-down ratio converts 5 V
at 500 mA to 1.5 V at 1.1 A at the battery. It should be noted that charging
can occur only with 500-mA or greater ports because proper charge termination
cannot be assured at low charge rates. Consequently, charging should not be
activated when enumeration determines that only 100 mA is available. The system
deactivates the charger by turning off Q2 to float the timer resistor at TMR. 

Another
particularly useful feature of this charger is that it senses battery impedance
to determine if an alkaline cell or a faulty battery is inserted. If that
occurs, charging suspends. This allows end users to plug in an alkaline battery
in an emergency and not worry about inadvertent charging. 

USB 3.0
The USB 3.0 spec
brings still higher data rates to USB. The power aspects of the spec are
similar to USB 2.0 except that a “unit load” is raised from 100 mA to 150 mA
and a high-power port has to supply six, rather than five, unit loads. This
means that a low-power USB 3.0 port can supply 150 mA, and a high-power USB 3.0
port can supply 900 mA. 

“Cheating”
— noncompliant USB charging
As with any
standard that is co-opted for purposes not originally intended, manufacturers
sometimes ignored portions of the USB 2.0 requirements in order to provide at
least a limited form of charging. One such noncompliant scheme used by a major
manufacturer was to draw no more than 100 mA under any circumstances so that
neither high- nor low-power hubs were overloaded. The downside of limiting
current to this level was that battery charge time was long, but if the device
spent a large part of the day docked to a USB port, that might still be
adequate. Besides a long charge time, there was another limitation to this
approach: If the system had a dead battery, full functionality would be delayed
until the battery reached a sufficient charge level. 

Another aspect of
noncompliant charging relates to the treatment of USB suspend. USB 2.0
stipulates that all devices must suspend (draw less than 2.5 mA) after a set
period of bus inactivity. Because charging was never included when this was
written, there was no consideration for a device continuing to charge a battery
while off but still attached. However, because most USB hosts do not actually
turn off power, this violation of the specification rarely prevented charging. 

A bolder
noncompliant scheme assumes that 500 mA will be available and instructs users
to plug into only powered ports and hubs that are capable of 500 mA. Again, because
most USB ports do not disconnect power, this approach can work in most cases.
When such a device is plugged into a port that cannot support 500 mA, the port
is supposed to shut down. However, the overload behavior of a USB port is not
always well-defined and can lead to system reset or damage. Fortunately, this
level of desperation is no longer required because battery charging is now an
active part of the USB specification. 

Wrap-up
Charging from USB
can take many forms, governed by the unique requirements of each USB device.
The USB Battery Charging Specification. Rev 1.1 finally adds much needed
uniformity to what was previously an ad
hoc
charging activity. The adoption of BC1.1 should lead to reduced cost
for manufacturers and consumers and greater interoperability as standard
adapters emerge. Nevertheless, the USB guidelines only cover how power is to be
taken from the port; they still leave power-management architectures and
charging specifics open to interpretation. That is where Maxim’s broad spectrum
of charging devices becomes important because they can help speed the design of
safe and reliable battery chargers for nearly any USB-connected portable
device. 

The chargers that
have been discussed are only a small sample of what Maxim offers. For more choices,
visit Battery Management. 

¹The USB Serial
Bus and charging specifications can be found at www.usb.org/developers/docs/

eneloop is a
registered trademark of Sanyo Electric Co., Ltd.
SANYO is a
registered trademark of SANYO Electric Co., Ltd.

Story
via Maxim Integrated