AN2361 USB-Powered Battery Charger for NiCd/NiMH Batteries Author: Svyatoslav Paliy Associated Project: Yes Associated Part Family: CY8C24794 Software Version: PSoC Designer™ 5.4 Related Application Notes: For a complete list of the application notes, click here. To get the latest version of this application note, or the associated project file, plea se visit http://www.cypress.com/go/AN2361. This application note describes a USB-powered battery charger for NiCd/NiMH batteries that permits rapid recharging. Dedicated PC-based software has been developed to monitor and control the charging process in real time and to display data in a graphical user interface. The charger can be embedded into consumer, office, and industrial applications. It needs no drivers and starts working immediately when plugged into a USB port. A battery can be left in the charger for any length of time without the risk of overcharge. Contents Introduction Introduction ....................................................................... 1 Rapid Battery Charging ..................................................... 2 Charger Hardware ............................................................. 2 Charger Firmware ............................................................. 5 State Transition Descriptions........................................ 6 USB Connection ................................................................ 7 PC Utilities and Debugging ............................................... 7 Design Modifications ......................................................... 8 Summary ......................................................................... 10 Related Application Notes ............................................... 10 Appendix A. Charger Schematic ..................................... 11 Appendix B. Board Photo ................................................ 12 Worldwide Sales and Design Support ............................. 14 The growing popularity of wireless computer peripherals such as the wireless mouse, keyboard, and similar devices is likely to spur demand for a device that can be recharged rapidly. Rechargeable batteries are also widely used in peripheral and non-computer-related appliances. The charger described in this application note can easily be incorporated into computer peripherals. For example, one battery can be located in a mouse or another wireless device, and a second battery inserted into a combination host/charger that is connected to the USB port of a computer. When the battery in the peripheral device is drained, you can simply swap the two batteries. Moreover, this charger can charge or discharge user batteries under manual charge control. You can control the charger from PC software, immediately stopping or starting the charge process. As an added option, it is possible to discharge the battery before charging. This allows you to control the charge level of batteries using a discharge-charge cycle. This application note describes how the charger works, its various aspects, and how it can be modified: www.cypress.com Rapid battery charging Charger hardware Charger firmware USB connection PC utilities and debugging Document No. 001-17400 Rev. *E 1 USB-Powered Battery Charger for NiCd/NiMH Batteries Figure 1. NiCd/NiMH Battery Pack Voltage in Time Graph Design modifications VBAT Appendixes Stop charge point Battery is fully charged Rapid Battery Charging This charger uses the pulse method for nickel-based batteries, which makes rapid battery charging possible and preserves battery health. Table 1 lists the main charger characteristics. The battery is charged by constant current impulses of 5second duration, alternated with 0.5-second latent periods during which no charge is applied. Then the charger measures the battery voltage. When the battery voltage stops increasing or starts decreasing, the battery is fully charged. Figure 1 shows the charge termination criteria and the battery voltage upon full charge. Time Charge Timeout The charge stage should be limited by a timeout that extends for approximately 120 to 150 percent of the estimated time required to charge NiCd/NiMH batteries with expected maximal capacity. Table 1. Main Charger Characteristics No. Parameter Name Two Cells Three Cells 1 Voltage indicating battery presence, V 0.5 0.75 2 Recharge voltage level, V 1.8 2.7 3 Emergency charger stop voltage, V 3.5 5.25 4 Discharge stop voltage, V 1.0 1.5 INT – Switched capacitor–based integrator. Charger Hardware The charger system is shown in Figure 2. See Appendix A. Charger Schematic for more details. The acronyms used in Figure 2 are defined as follows: USB – Full-speed Universal Serial Bus engine used to receive control data from the PC and send data about charger status and battery states to the PC. DSM – Delta-sigma modulator for current regulator control output. ADC – Incremental analog-to-digital converter used to measure battery voltage. AMUX – Analog multiplexer used to switch between two analog signals for measurement. CPU – Central processor core to implement charge algorithms and perform charge control functions. INA – Switched capacitor-based instrumentation amplifier. www.cypress.com Document No. 001-17400 Rev. *E 2 USB-Powered Battery Charger for NiCd/NiMH Batteries Figure 2. Charger System with Switching Regulator Current Sense Q1 Charge Current D3 L1 R9 R10 R11, R12, R13 D4 PC Discharge Current Q2 VCC Battery Pack P2[1] P2[3] R19 Charge + Power USB Data Vb+ Sense Vref USB + INA + INT VINA VINT P0[3] RS-Trigger DSM Charge GND - Reset Power Vb- Sense D1 P5[0] P4[4] R4 Set R5 Q Red P2[0] P5[2] D5 CPU D2 P0[7] Green R3 P0[1] AMUX ADC R5 P0[5] R8 PSoC Internals The main task of the charger is efficient use of the maximum allowed current from the USB bus (0.5 A) to minimize total charge time. The amount of the current drawn from a USB is insufficient for a fast battery charge with a fixed amount of the current. It is the current drawn from the USB that is controlled rather than the charge current. The battery charge current is determined by the instantaneous battery voltage, keeping regulator input power maintained at a constant level. The current regulator uses a hardware control loop. The hardware control loop consists of an instrumentation amplifier (INA) to handle a current sense resistor (R9) signal; a differential integrator (INT), which acts as an integrating difference amplifier; and a delta-sigma modulator (DSM) as a voltage-to-pulse-density converter. This loop controls the MOSFET gate duty cycle to keep the input current constant. This hardware control loop method enables the greatest use of available USB power. This implementation uses three configurable switched capacitor blocks: one for the instrumentation amplifier, one for the differential integrator, and one for the delta-sigma modulator. The configuration of parameters of the switched capacitor block is described in AN2041 – Understanding Switched Capacitor Analog Blocks. The following equations describe the operation of the regulator: VINA VINA C AINA C INA V BINA VP 2[3] ; INA P 2[1] CF CF C C INA A INA F VINA is the output voltage of the instrumentation amplifier, and C AINA , CBINA , CFINA , C AINT , CBINT , and CFINT are values of the capacitors in the switched capacitor blocks. For correct operation, C AINA must be equal to CBINA . VP2[1] and VP2[3] are the voltage on the PSoC®1 pins P2[1] and P2[3], respectively. Rsense is the current sense resistor value. Ibus is the current drawn from the USB power source. VINT is the differential integrator output. Vref is the bandgap reference voltage. In steady state, the integrator’s differential input voltage, Vref – VINA, is driven to zero. Thus, the target value of the regulator charging current can be calculated as follows: I bus If CFINA C AINT Vref CBINT C AINA Rsense CFINA =16, C AINT =2, Equation (3) ; Vref =1.3V, CBINT =14, C AINA = CBINA =31, and Rsense = 0.2 Ω, the charging current is equal to 0.479 A. The charging current can be adjusted by changing the capacitor values. However, the USB specification enforces a 0.5-A current limitation. The regulator’s typical operating waveforms are shown in Figure 3. As the battery charges up, the pulse density of the delta-sigma modulator decreases, as expected. Equation (1) Rsense I bus ; C AINA CBINA ; C INT C INT VINT AINT Vref BINT VINA dt ; C C F F www.cypress.com Equation (2) Document No. 001-17400 Rev. *E 3 USB-Powered Battery Charger for NiCd/NiMH Batteries Figure 3. Integrator Output (Upper Trace) and Delta-Sigma Modulator Output (Lower Trace) Figure 4. Regulator Efficiency 85 80 Effi, % 75 70 65 60 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 Uout, V VP0[1] and VP0[5] are the voltages on pins P0[1] and P0[5], respectively. The value ∆nV is the ADC value without the amplifier and ADC offset voltages. The value nmax is the maximum ADC code, with a value equal to 2047 for an 11-bit incremental ADC. The value Vbat is battery voltage, and GV is the input amplifier gain, equal to 1. The value Vref is the bandgap reference voltage (1.3 V), and βV is the resistive divider coefficient, which is equal to 0.25 for R3 = 150 kΩ, R5 = 100 kΩ, and R8 =150 kΩ divider resistors: a) When Battery Voltage is 3.9 V V Equation (5) The ADC and regulator share comparator bus 1. Because the regulator and ADC never work simultaneously, the comparator bus reconnects by firmware to the ADC to provide measurement. The comparator bus reconnects to the delta-sigma modulator for hardware control of the charge state. See the Charger Firmware section. b) When Battery Voltage is 1.3 V The battery charge current is determined by input current, battery voltage, and regulator efficiency. Regulator efficiency based on real measurements is shown in Figure 4. Note that low efficiency at low voltage output is caused by voltage drops on diodes D3 and D4. The battery voltage is measured by an ADC using a resistive divider to condition the signals to the allowed level. Correlated double sampling is used to null AD offset errors. The ADC first measures voltages on pin P0[1] and offset errors on pin P0[5]. The battery voltage is calculated as the difference between the voltages measured on P0[1] and P0[5]. The derived voltage measurement is shown in the following equation: Equation (4) www.cypress.com 1 R3 R8 1 R5 The MOSFET Q4 allows the battery to be discharged before a charge. If Q2 is activated, the current from the battery flows though R11, R12, and R13, shown in schematics in Figure 2 and Figure 7, which are connected in parallel to provide greater thermal dissipation, See Appendix A. Charger Schematic. This battery discharge feature can be activated only from the PC software as an option for battery training; it is not automatic. The charger can be used in applications that require leaving the battery in the charger after the charge cycle, even if the PC power is turned off. Overcharging the battery can cause permanent damage or decrease battery capacity. To prevent battery overcharge, battery charging is initiated only after PC start when the battery voltage falls below a predefined limit. This limit is called the “charge restart condition.” But if you insert the battery in the charger, the charger starts immediately, without testing the voltage. Document No. 001-17400 Rev. *E 4 USB-Powered Battery Charger for NiCd/NiMH Batteries To detect that a battery was changed when the charger was not powered from a USB, a simple RS-trigger, powered from the battery, is used. The RS-trigger automatically enters the reset state after the power goes on. Thus, changing the battery automatically resets the trigger. If the battery is not replaced in the charger, the recharge starts only if the battery voltage has fallen below a predefined limit. When the battery is changed, a charge is initiated regardless of battery voltage. The RS-trigger is built from two bipolar transistors, Q3 and Q4. As a result of nonsymmetrical resistances in bases (R4 versus R5) and collector circuits (R1 versus R2), a reset state is always triggered upon power up. Refer to Appendix A. Charger Schematic. Two LEDs, green and red, are used to indicate the charger state. When the charger is connected to the USB, both LEDs are switched on. After device enumeration, the LEDs indicate the charger state. A green LED means a charge is in process. When both LEDs are turned off, everything is functioning properly but no charge is being applied to the battery at this time, possibly because the battery is fully charged or there is no battery in the charger. A red light indicates an error condition. The following section provides more information about the charger state. One digital block and interrupt-based firmware are used for charge-time control. The PSoC Timer8 User Module generates an interrupt with a frequency of 20 Hz and clocks from VC3 (5,859 kHz). The firmware is constructed as a state machine. Figure 5 shows the state diagram, in which active charge states are highlighted in green and error states are highlighted in red. Charger Firmware Figure 5. Charger State Diagram Stop i Discharge g m Power On Initialization k h j a Wait After Discharge l Charge p b f o No Battery Wait After Charge m Voltage Error c e Timeout Error Charge Complete d n In Figure 5, state transitions are indicated by lines and squares labeled with letters. See State Transition Descriptions for explanations of the transitions. The states in circles in Figure 5 are defined as follows: www.cypress.com Initialization – Both LEDs are off. Test for battery presence and state based on battery voltage. Charge – Green LED is on. Charge for 5 seconds. Document No. 001-17400 Rev. *E 5 USB-Powered Battery Charger for NiCd/NiMH Batteries Wait After Charge – Green LED is on. No charge, for 0.5 seconds. Charge Complete – Both LEDs are off. No charge. Battery is fully charged. THEN Charge If the battery voltage has fallen below the recharge voltage level (possibly because the battery is self-discharging), the battery charge is resumed. Stop – Both LEDs are off. No charge. This state occurs when the device gets a stop command from the PC. Wait for the next command. f) Discharge – Green LED is on. Discharge is in progress for 5 seconds. If a battery is detected and is fully charged, transition to the Charge Complete state occurs. Wait After Discharge – Green LED is on. No charge, no discharge, wait 0.5 seconds. g) No Battery – Both LEDs are off. Charger is turned off. Wait for battery to be inserted. If a stop command has been received from the PC, then stop charging immediately, regardless of the current state. Voltage Error – Red LED is on. Stop charging. Battery voltage has reached the maximum permitted safe level. The battery or charger may be damaged. Wait for battery to be removed. h) Timeout Error – Red LED is on. Charging is stopped. Charger has attempted to charge the battery for a predefined period but detects that the battery has failed to take a full charge. The battery may be damaged. Wait for the battery to be removed. State Transition Descriptions The state transitions shown in Figure 5 are described as follows: a) IF VNO-BATT < VBATT ≤ VRE-CH THEN Charge Complete THEN Stop IF Charge command received THEN Charge If a charge command has been received from the PC, then charging starts immediately, regardless of the battery voltage. i) IF Discharge command received THEN Discharge If the discharge command is received from the PC, then discharging starts immediately. This is the only way to discharge the battery. j) IF TBATT ≤ TCOLD_STOP Permits discharge of the battery for 5 seconds. THEN Charge k) If a battery is detected and the battery is not already charged, then the green LED is turned on, and transition to the Charge state occurs. IF VBATT > VDISCH THEN Discharge IF 5 seconds have elapsed If batteries are not discharged, then discharge resumes after 0.5 second. THEN Wait After Charge l) IF VBATT ≤ VDISCH THEN Charge Charge the battery for 5 seconds. c) IF Stop command received THEN Wait After Discharge or BatteryChanged flag is set b) IF VRE-CH < VBATT If the battery is fully discharged, transition to the Charge state occurs. IF battery voltage increasing THEN Charge Complete The charge termination criteria are that the voltage is decreasing during a charge, or that the voltage remains constant (no longer increasing) during a charge. If either criterion is not met, then the battery charge continues. d) IF VBATT > VERR THEN Voltage Error IF battery voltage not increasing If battery voltage exceeds the VERR level, transition to the Voltage Error state occurs regardless of the present state. THEN Charge Complete n) If termination criteria are met, the green LED is turned off and the charge is stopped. Transition to the Charge Complete state occurs. e) m) IF VNO-BATT < VBATT ≤ VRE-CH www.cypress.com IF duration of charge exceeds predefined limit THEN Timeout Error If the battery time charge exceeds a predefined limit, then charging stops. The battery may be damaged. Document No. 001-17400 Rev. *E 6 USB-Powered Battery Charger for NiCd/NiMH Batteries o) IF VBATT ≤ VNO-BATT THEN No Battery Exit from the current state and transition to No Battery state if the battery has been removed. p) IF VBATT > VNO-BATT The supporting documents (see supporting files in the project .zip) contain tables of the USB descriptors and HID report descriptors. Both descriptors are represented in PSoC style, corresponding to the USB Setup Wizard tables. PC Utilities and Debugging THEN Charge If a newly inserted battery is detected, a charge starts. A charge always starts after a battery is inserted. Note that if a battery is removed, then the charger goes to the No Battery state from any other state except the Stop state. A time-based interrupt handler is used to implement sleep mode (Suspend state of the USB). The interrupt handler checks the bus activity bit. If the bus enters USB Suspend mode, the charger goes into CPU sleep mode. The CPU stays in sleep mode until it receives a wake-up event from the USB. Sleep mode support is required for full compliance with USB standards. USB Connection The charger uses USB for two purposes: To receive and manually control data that relates to the charge process. As a power source for the charger Logically, the charger is represented as a Human Interface Device (HID). The charger requires only a low data rate. An HID is very useful in this case. The advantage of an HID is that no special driver is needed and software support is simplified. Dedicated charger control software has been developed to monitor the charge process. The user interface (UI) is very simple, as shown in Figure 6. The UI consists of a chart that displays battery voltage, labels indicating the present charger state (Stopped, in Figure 6), battery voltage (2.79 V), and four buttons to manually control the charge process. The software is optional and not required for charger operation. Table 2 shows the data packets that are sent from the charger to the PC and from the PC to the charger. The data packet from the charger to the PC contains the charger state and battery voltage. This package has a length of 3 bytes, as specified in Table 2. Using this data, the software builds a chart and prints the actual battery voltage. The battery voltage is calculated in Equation (6) from the returned ADC code by the inverse function of Equation (4): VBATT nV BATT Vref nV BATT GV V nmax ; Equation (6) is the battery voltage in ADC code from the data packet. The data packet from the PC to the charger contains a single 1-byte command. www.cypress.com Document No. 001-17400 Rev. *E 7 USB-Powered Battery Charger for NiCd/NiMH Batteries Figure 6. Charger Monitoring Software Charger State Battery voltage Chart with Charge Control Buttons Battery Voltage Table 2. Data Packets Item No. Length in Bytes Reference Description a) Data Packet from Charger to PC 1 2 1 2 State nVBATT Charger State • INITIALIZATION = 0 • CHARGE = 1 • WAIT AFTER CHARGE = 2 • CHARGER COMPLETE = 3 • NO BATTERY = 4 • DISCHARGE = 5 • WAIT AFTER DISCHARGE = 6 • STOP = 7 • VOLTAGE ERROR = 8 • TIMEOUT ERROR = 9 Battery voltage in ADC code b) Data Packet from PC to Charger 1 1 Cmd Command to Charger • STOP = 1 • CHARGE = 2 • RECHARGE = 3 • DISCHARGE = 4 • SET TIMEOUT = 5 Design Modifications It is possible to decrease the cost of the charger by eliminating the coil and Schottky diode and substituting a pulse regulator with a linear current source. However, this alternative increases the charge time because if a linear regulator is used, the charge current is not greater than 0.5 A. The constant current source consists of an instrumentation amplifier to sense the current and a differential integrator. www.cypress.com Figure 7 shows the structure of a charger with a linear current source. The DSM is eliminated, and the differential integrator directly drives the MOSFET gate. The differential amplifier inputs are swapped to obtain an inverted signal on the output. The inverted signal is required to form negative feedback in order to drive a P-channel MOSFET. In contrast to a switching regulator, the MOSFET in a linear regulator operates in linear mode. As a result, the power dissipation on the MOSFET is higher, so a small heat sink may be necessary. A PCB plane is suitable for this role. Document No. 001-17400 Rev. *E 8 USB-Powered Battery Charger for NiCd/NiMH Batteries Figure 7. Charger Structure with Linear Regulator Current Sense Charge Current D3 Q1 R9 R11, R12, R13 R10 PC Discharge Current Q4 VCC Battery Pack P2[1] P2[3] R20 R19 + Power USB Data INA USB VINA Vb+ Sense + - INT Vref D1 Red Charge + VINT P0[1] RS-Trigger Charge GND - Reset P5[0] P4[4] R4 Set P2[0] P5[2] Power R5 Vb- Sense Q D5 CPU D2 P0[7] Green R3 P0[3] AMUX ADC R5 P0[5] R8 PSoC Internals Figure 8 shows the charge current versus battery voltage for the switching regulator. Figure 9. Switching and Linear Regulator Output Power Versus Battery Voltage Figure 8. Charge Current Versus Battery Voltage (mA) 2,2 1100 2,0 1000 1,8 900 1,6 Power, W Iout 1200 800 700 Switching reg Linear reg. 1,4 1,2 1,0 600 0,8 500 0,6 400 1,0 1,0 1,5 2,0 2,5 3,0 3,5 4,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 Uout,V 4,5 Uout (V) For the linear regulator, the current is constant and does not exceed 0.5 A. So when a switching regulator is used to charge two batteries (2.6 V in a charged state), the charge current is significantly greater than the charge current when a linear current source is used. For three batteries with 3.9 V in a charged state, the charge current is about the same for both kinds of regulators. For deeply discharged batteries (2.4 V), the charge current is greater. However, the overall benefit is not great when a switching regulator is used to charge three NiCd/NiMH batteries. So in this case, a linear regulator can be used with a very small loss of efficiency. Figure 9 shows switching and linear regulator efficiencies against battery voltage. www.cypress.com Table 3 lists the time required to charge different batteries when the two regulator types are used. Table 3. Charge Time Examples No. Case Time 1 Two cells by 1400 mAh using switching regulator 189 min 2 Two cells by 1400 mAh using linear regulator 323 min 3 Three cells by 1800 mAh using switching regulator 384 min 4 Three cells by 1800 mAh using linear regulator 426 min Document No. 001-17400 Rev. *E 9 USB-Powered Battery Charger for NiCd/NiMH Batteries The USB charger is designed to be part of a more complex system. Additional resources can be allocated to the unused digital blocks. For example, the SPIM User Module can be added for communication with the WUSB User Module. The size of the firmware code is small, about 4.5 KB (less than 30 percent of flash). A total of 104 bytes of SRAM is used for variables—13 percent using the large memory model (LMM), 40 percent without. Resources are thus available to combine this charger onto one PSoC device with the user’s own design. Summary Related Application Notes AN2041 – Understanding Capacitor Analog Blocks PSoC 1 Switched About the Author Name: Svyatoslav Paliy. Title: Sys Desgn/Arch Engrg Mgr Sr This application note demonstrated the USB-powered NiCd/NiMH battery charger using the PSoC CY8C24794 device. It described both switching and linear regulator methods, which you can select depending on cost and efficiency requirements. www.cypress.com Document No. 001-17400 Rev. *E 10 USB-Powered Battery Charger for NiCd/NiMH Batteries Appendix A. Charger Schematic DISCH VN VP VDD P2[3] P2[1] P4[7] P4[5] P4[3] P4[1] P3[7] P3[5] P3[3] P3[1] P5[7] P5[5] P5[3] P5[1] P0[6] P0[4] P0[2] P0[0] P2[6] P2[4] Vss D+ DVdd 19 20 21 22 15 16 17 18 1 2 3 4 5 42 41 40 39 38 37 36 35 34 33 32 31 30 29 R1 330 R2 330 D1 RED T_read T_Set D2 GREEN Vbat P7[7] P7[0] P1[0] P1[2] P1[4] P1[6] CY 8C24794 P1[7] P1[5] P1[3] P1[1] +5V J1 P2[2] P2[0] P4[6] P4[4] P4[2] P4[0] P3[6] P3[4] P3[2] P3[0] P5[6] P5[4] P5[2] P5[0] 23 24 25 26 27 28 1 2 3 4 5 6 7 8 9 10 11 12 13 14 IN IP 48 47 46 45 44 43 50 49 Vss Vdd P2[5] P2[7] P0[1] P0[3] P0[5] P0[7] U1 56 55 54 53 52 51 DRIVE R3 150K R4 VDD +5V VP 10R ISSP/DEBUG R6 24R +5V C1 1u R7 24R + R5 100K C2 100u VN J2 Vdd -D +D Gnd 1 2 3 4 R8 150K USB-B Switch-mode Regulator IP IN Q1 IRLML6402 +5V Vbat D3 L1 R9 0.2R 1% J3 47uH* 1 2 + C3 100u + C5 0.1u C4 100u MBR320 R10 1M D4 MBR320* C6 1u BATTERY DRIVE Linear Regulator IP IN Q1 MMSF3P03HD +5V Vbat D3 J3 R9 0.2R 1% 1 2 + C3 100u C5 0.1u MBR320 C6 0.1u R10 100K R20 1.5K BATTERY DRIVE Discharge Switch RS-trigger Vbat R11 30R Vbat R12 30R R14 47k R13 30R R15 330k T_read R16 1M Q2 IRML2502 DISCH R17 1M Q3 BC817 R19 1M R18 180k Q4 BC817 D5 T_Set LL4148 www.cypress.com Document No. 001-17400 Rev. *E 11 USB-Powered Battery Charger for NiCd/NiMH Batteries Appendix B. Board Photo www.cypress.com Document No. 001-17400 Rev. *E 12 USB-Powered Battery Charger for NiCd/NiMH Batteries Document History Document Title: USB-Powered Battery Charger for NiCd/NiMH Batteries - AN2361 Document Number: 001-17400 Revision ECN Orig. of Change Submission Date Description of Change ** 1352143 HMT See ECN New application note. *A 1629363 HMT See ECN Updated to new template. *B 2816409 SYVP 11/27/09 Updated PSoC Designer version and author email id. Ported accompanying projects from PD 4.2 to PD 5.0. *C 3113712 YARA 12/17/2010 Updated software version from PSoC Designer 5.0 to 5.1. Updated the associated project files. *D 4268216 RJVB 01/31/2014 Added Summary. Updated Related Application Notes (Removed obsolete specs). Updated to new template. Completing Sunset Review. *E 4568981 ASRI 11/14/2014 Updated Introduction: Updated description. Updated Rapid Battery Charging: Updated description. Updated Charger Hardware: Updated description. Updated Charger Firmware: Updated description. Updated State Transition Descriptions: Updated description. Updated USB Connection: Updated description. Updated PC Utilities and Debugging: Updated description. Updated Figure 6. Updated Design Modifications: Updated description. Updated Figure 8. Updated Summary: Updated description. Updated Related Application Notes: Removed references of AN2203 and AN2260. www.cypress.com Document No. 001-17400 Rev. *E 13 USB-Powered Battery Charger for NiCd/NiMH Batteries Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products Automotive cypress.com/go/automotive psoc.cypress.com/solutions Clocks & Buffers cypress.com/go/clocks PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Interface cypress.com/go/interface Lighting & Power Control cypress.com/go/powerpsoc cypress.com/go/plc Cypress Developer Community Community | Forums | Blogs | Video | Training Memory cypress.com/go/memory PSoC cypress.com/go/psoc Technical Support Touch Sensing cypress.com/go/touch cypress.com/go/support USB Controllers cypress.com/go/usb Wireless/RF cypress.com/go/wireless PSoC is a registered trademark and PSoC Designer is a trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation, 2007-2014. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. www.cypress.com Document No. 001-17400 Rev. *E 14