STw4102 Dual USB/wall adapter Li-ion battery charger with gas gauge Features Constant current constant voltage (CCCV) linear charger ■ Common or separate USB/wall adapter inputs ■ Fast charge current control up to 1 A for wall adapter and up to 500 mA for USB ■ Support for currents higher than 1 A using external components ■ Programmable charge voltage (4.1 V, 4.2 V, 4.3 V, 4.35 V) with 1% accuracy ■ Thermal regulation ■ Trickle charge mode at low battery voltage ■ Wall adapter voltage up to 16 V ■ Battery overvoltage protection at 4.7 V ■ Gas gauge with 13-bit AD converter Pin connections (top view) 24 23 22 21 20 19 MAIN VOUT USBPWR DRIVER LDODRV LDOFB Battery voltage monitor with 7-12 bit AD converter ■ I2C interface for device monitoring and control ■ Charge status output pin ■ Power detection output pin ■ Programmable watchdog security timer ■ 4.7 V LDO regulator (with external power MOSFET) Applications ■ Cellular phones (GSM, CDMA, WCDMA), PDA, MP3 players, cordless phones ■ Digital camera, USB appliances, bluetooth devices, portable navigation devices Description The STw4102 is a standalone constant current constant voltage (CCCV) linear charger specifically designed for Li-ion batteries. March 2008 1 2 18 17 3 16 4 15 5 14 6 13 7 VIO SCL SDA RESETN STDBY C32KHZ 8 9 10 11 12 ISET CVREF GND CVIS ICG+ ICG- ■ QFN 24 (Plastic micropackage) PWRDETECTN TEST EOCHG BATTSENSE BATT SENSE ■ The STw4102 offers dual charging capability using separate inputs for USB cable and wall adapter, or a single input that accepts both. The STw4102 also offers programmable fast charge current using an external resistor. A thermal regulation circuit limits the charge current against the die high power dissipation or high ambient temperature. An end of charge output pin indicates the charge termination when the fast charge current drops below 10% of the programmed current value. The STw4102 includes an accurate gas gauge based on a 13-bit AD converter. An external resistor is used between battery and ground to sense a charge/discharge current. With a typical 30 mΩ resistor, current can be up to 2.5 A. Rev 2 1/34 www.st.com 34 Contents STw4102 Contents 1 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Absolute maximum ratings and operating conditions . . . . . . . . . . . . . 6 4 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Typical performance curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5 6 Application schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.1 Charge from USB or wall adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.2 Charge currents higher than 1 Amp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 5.3 Using LDO regulator to supply telephone from wall adapter . . . . . . . . . . 16 Battery charger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 6.1 Charge cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 6.2 Trickle charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.3 Charging from a wall adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.4 Charging from a USB port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.5 Charging using external power devices . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.6 Charge mode summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.7 Watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.8 Thermal regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7 Low drop-out regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 8 Battery monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.1 Gas gauge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.2 Battery voltage monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 9 Factory OTP options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 10 I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 10.1 2/34 Read and write operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 STw4102 Contents 10.2 Register mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 11 Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 12 Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 13 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3/34 Block diagram 1 STw4102 Block diagram Figure 1. Internal block diagram DRIVER Main Power Device (max 1A) MAIN USBPWR VOUT USB Power Device (max 500mA) Thermal regulation Driver Main adapter Detect Sense ressitor SENSE Current Sense BATT Voltage Current Regulation USB Detect PWRDETECTN CC/CV Voltage Sense BATTSENSE Trickle threshold Trickle current Charge Voltage CC/CV configuration EOCHG Charge current Current defined by external resistor ISET Internal Supply CVIS Vref CVREF LDO LDODRV Main supply LDO driver 4.7V Battery Monitoring LDOFB STDBY Power On Reset Charge Control Registers 24 bit accumulator Control registers VIO SCL SDA RESETN AD converter 12 bits + sign bit I2C interface Control Registers AD converter 7-12 bits GND 4/34 C32KHZ Battery voltage TEST ICG+ ICG- STw4102 2 Pin assignment Pin assignment P Table 1. Pin descriptions Pin # Pin name Type Function 1 MAIN Supply 2 VOUT O_A 3 USBPWR Supply 4 DRIVER O_A Driver for external power switch (PMOS or PNP) 5 LDODRV O_A LDO power PMOS driver 6 LDOFB I_A LDO feedback regulation 7 ISET O_A Resistor to program the main charge current 8 CVREF I_A Bypass capacitor for internal voltage reference 9 GND Ground 10 CVIS I_A Bypass capacitor for internal supply 11 ICG+ I_A Gas gauge sense resistor 12 ICG- I_A Gas gauge sense resistor 13 C32KHZ I_D External 32kHz clock input 14 STDBY I_D Gas gauge standby input (active low) 15 RESETN I_D Digital register reset (active low) 16 SDA IO_D I2C serial data. 17 SCL I_D I2C serial clock. 18 VIO Supply 19 SENSE I_A 20 BATT Supply Battery power voltage 21 BATTSENSE I_A Battery sense voltage 22 EOCHG OD End of charge output status. Pulled low when the fast charge current is above 10% of its programmed maximum value. 23 TEST I_D Reserved pin for factory test. To be connected to ground. 24 PWRDETECTN OD Main or USB plug-in detection. Pulled low when power is detected, open when no power is detected. Main power input from wall adapter or USB charger Power path output Power supply from USB cable Analog and digital ground Supply for I/O Sense resistor input to regulate the charge current In this table, the following conventions are used: I: Input O: Output I/O: Bidirectional OD: Open Drain A: Analog D: Digital 5/34 Absolute maximum ratings and operating conditions 3 STw4102 Absolute maximum ratings and operating conditions Table 2. Absolute maximum ratings (AMR) Symbol VMAIN Parameter Maximum supply voltage on MAIN input Value Unit 20 V VCC Voltage on EOCHG, LDODRV, DRIVER pins -0.3 to VMAIN V VUSB Maximum supply voltage on USBPWR input 7 V Vbatt Maximum voltage on BATT, BATTSENSE, PWRDETECTN 7 V VIO Maximum supply voltage on VIO pin 7 V VDD Voltage on I/O pins (SCL, SDA, RESETN, C32KHZ, STDBY) -0.3 to VIO V Power dissipation self-limited Pd Isense Tstg Tj Rthja ESD Maximum current from SENSE to BATT Storage temperature Maximum junction temperature Thermal resistance junction-ambient(1) Electrostatic discharge (HBM human body model)(2) 1 A -55 to 150 °C 150 °C 45 ° C/W 2 kV 1. Package's exposed pad is soldered to a copper pad on the PCB with multiple vias to the ground plane. 2. Human body model: 100 pF discharged through a 1.5 kΩ resistor between two pins of the device, done for all couples of pin combinations with other pins floating. Table 3. Operating conditions Symbol 6/34 Parameter Value Unit 4.25 to 16 V 16 V Vmain Operating supply voltage on MAIN VCC Maximum voltage on EOCHG VUSB Operating supply voltage on USBPWR 4.25 to 5.5 V VIO Operating supply voltage on VIO 1.45 to 3.0 V Vbatt Max voltage on BATT, BATTSENSE, PWRDETECTN 5.0 V Vout Max voltage on VOUT BATT +0.7 V Toper Operating free air temperature range -30 to 85 °C STw4102 Electrical characteristics 4 Electrical characteristics Table 4. CC/CV charger - Voper= 5V, Vbatt= 3.6V, Tamb = -30°C to 85° C (unless otherwise specified) Symbol Parameter Conditions Min Typ Max Unit Supply (Voper from MAIN or USB) Icharger Main or USB input operating current 2 mA ISTBY USBPWR input standby current Charge off 40 µA Ibatt_sense BSENSE input current No charge 1 µA Ibatt BATT input current No charge 25 µA POR_IS+ Power ON reset threshold+ CVIS internal supply 2.2 2.3 2.4 V POR_IS- Power ON reset threshold- CVIS internal supply 2.1 2.2 2.3 V -1 +1 % Voltage regulation Vcharge_acc Output voltage accuracy Tamb= 0°C to 85° C Rpower Power path resistance MAIN to BATT Batteryovv Static battery overvoltage detection Batteryovv_hyst Static battery overvoltage hysteresis Ω 0.6 4.55 4.7 4.8 100 V mV Current regulation Itrickle Trickle charge current Vbatt< Vtrickle Standard configuration Factory OTP option 30 60 60 120 100 180 mA mA Vtrickle Trickle to fast charge threshold Standard configuration 2.8 2.9 3.0 V Vtrickle_hyst Trickle to fast charge threshold hysteresis Icharge Main charge current range Internal path 100 1000 mA Icharge_acc Main charge current accuracy Icharge> 500mA -15 +15 % 100 USB charge current REG_CHG0[7..6]: 00 01 10 11 mA mA mA mA IUSB 100 30 60 200 400 0 mV 500 EOCHGith End of charge threshold % of current setting 10 % EOCHGith_hys End of charge threshold hysteresis % of current setting 5 % Tregulation Regulated junction temperature 125 °C Tsoftstart Soft start from trickle to fast charge 100 µs 7/34 Electrical characteristics Table 4. STw4102 CC/CV charger - Voper= 5V, Vbatt= 3.6V, Tamb = -30°C to 85° C (unless otherwise specified) (continued) Symbol Parameter Conditions Min Typ Max Unit 0.5 7.5 15 30 1 15 30 60 1.5 22.5 45 90 min min min min 2.4 2.5 2.6 V Watchdog twatchdog Watchdog duration REG_WDOG[2,1]: 00 01 10 11 Input/output pins Vcharger_det Main charger supply voltage detection Vcharger_det_hys Main charger supply voltage detection hysterisis VUSB_det USB supply voltage detection VUSB_det_hys USB supply voltage detection hysteresis Volpowerdetect POWERDETECTN output capability Isink= 10mA 0.45 V VolEOCHG EOCHG output capability Isink= 10mA Isink= 20mA 0.5 1.1 V V Idrv_sink Driver sink current (If option enabled) Table 5. Symbol 100 2.4 Parameter LDO regulated output voltage LDOpower_th LDO power turn off threshold 100 Conditions Including line and load regulation (up to 1A), Vmain > 6V LDOpower_th_hys LDO power turn off threshold hysterisis 8/34 2.6 V mV 60 mA LDO - Vmain= 6V, Tamb = -30°C to 85° C (unless otherwise specified) LDOV LDOPSRR 2.5 mV LDO power supply rejection ratio Up to 20kHz Min Typ Max Unit 4.47 4.7 4.93 V 6.8 7.2 7.5 V 0.7 V 50 dB STw4102 Table 6. Electrical characteristics Battery monitor - Vbatt= 3.6V, Tamb = -30°C to 85° C (unless otherwise specified) Symbol Parameter Conditions Min Typ Max Unit POR_IS2+ Power ON reset threshold+ CVIS internal supply 2.6 2.7 2.8 V POR_IS2- Power ON reset threshold- CVIS internal supply 2.5 2.6 2.7 V Gas gauge A/D converter Vos_gg Input offset voltage 40 Vin_gg Input voltage range Idd_gg Current consumption Ipdn_gg Current consumption in off mode Iin Input current for ICG+ and ICG- LSBgg AD converter granularity (LSB value) 12 bits + 1 sign bit AccTamb_gg Accuracy at ambient temperature External resistor at 1% No calibration -80 µV +80 mV CG_ENA=1 90 µA CG_ENA=0 1 µA 500 nA 23.5 µV 3 % Battery voltage A/D converter Vin_mon Input voltage range BATT voltage Idd_mon Current consumption ADPOWERON=1 Ipdn_mon Current consumption in off mode ADPOWERON=0 LSBmon AD converter granularity (LSB value) 7 bits 12 bits AccTamb_mon Accuracy at ambient temperature 1 5 190 µA 1 No calibration V µA 45.4 1.42 mV mV 3 % Digital I/O pins (SCL, SDA, STDBY, C32KHZ, RESETN) Vil Input pin low voltage 0 0.3 x VIO V Vih Input pin high voltage 0.7 x VIO VIO V Vol SDA output pin low voltage 0.2 x VIO V Isink= 3mA 9/34 Electrical characteristics Table 7. STw4102 I2C timing - VIO= 2.8V, Tamb = -30°C to 85° C (unless otherwise specified) Symbol Parameter Conditions Min Typ Max Unit 400 kHz Fscl SCL clock frequency thd,sta Hold time (repeated) START condition 0.6 µs tlow LOW period of the SCL clock 1.3 µs thigh HIGH period of the SCL clock 0.6 µs tsu,dat Setup time for repeated START condition 0.6 µs thd,dat Data hold time tr 0 0.9 us Rise time of both SDA and SCL signals 20+ 0.1Cb 300 ns tf Fall time of both SDA and SCL signals 20+ 0.1Cb 300 ns tsu,sto Setup time for STOP condition Cb Capacitive load for each bus line Figure 2. 0.6 400 I2C timing diagram Vih SDA tf Vil thd,sta tr tsu,dat thigh SCL tlow 10/34 µs thd,dat tsu,sta pF STw4102 Electrical characteristics Typical performance curves Charger voltage vs. charge current Figure 4. (Main charge, 4.2V and 1A settings) 4.5 4.5 4.0 4.0 3.5 3.5 3.0 3.0 Vbatt (V) Vbatt (V) Figure 3. 2.5 2.0 Charger voltage vs. charge current (USB charge, 4.2V setting) Ich=200mA Ich=400mA 2.5 2.0 1.5 1.5 1.0 1.0 0.5 0.5 0.0 0.0 0 200 400 600 800 1000 0 1200 100 200 Figure 5. 300 400 500 Iusb (mA) Icharge (mA) Charge current vs. temperature (charge from MAIN, 1A setting) Figure 6. Charge current vs. temperature (charge from USBPWR) 1.2 500 1.0 Ich=400mA 400 Iusb (mA) Icharge (A) 0.8 0.6 0.4 0.2 0.0 -50 Ich=200mA 200 100 -25 0 25 50 75 100 125 Temp (°C) Figure 7. 300 0 -50 -25 0 25 50 Temp (°C) 75 100 125 Charge voltage vs. temperature (4.2V nominal setting) 4.24 4.23 Vcharge (V) 4.22 4.21 4.20 4.19 4.18 4.17 4.16 -50 -25 0 25 50 75 100 125 Temp (°C) 11/34 Electrical characteristics USB standby input current vs. temperature (charge disabled) Figure 9. 60 60 50 50 40 40 Ibat (µA) Iusb (µA) Figure 8. STw4102 30 30 20 20 10 10 0 -50 -25 0 25 50 75 100 0 -50 125 Battery standby current vs temperature (no MAIN, no USBPWR, gas gauge disabled) -25 0 Temp (°C) 4.9 1.2 4.8 LDOv (V) Twatchdog 75 100 125 Figure 11. LDO output voltage vs. temperature (10 mA output current) 1.4 1.0 4.7 4.6 0.8 0.6 -50 -25 0 25 50 75 100 125 Figure 12. LDO output voltage vs. output current 5.0 4.9 4.8 4.7 Vmain=6V 4.6 Vmain=5V 4.5 4.4 0 500 1000 LDOi (mA) 4.5 -50 -25 0 25 50 Temp (°C) Temp (°C) LDOv (V) 50 Temp (°C) Figure 10. Watchdog period vs. temperature (normalized to value at 25°C) 12/34 25 1500 75 100 125 STw4102 Electrical characteristics Figure 13. Waveforms at USB plug-in Vusb Vbatt Ibatt 50µs/div Figure 14. Switching from USB charge to main Figure 15. Switching from main charge to USB charge charge Vmain Vmain Vbatt Vbatt Ibatt Ibatt 100µs/div 10ms/div 13/34 Application schematics STw4102 5 Application schematics 5.1 Charge from USB or wall adapter The MAIN input is used with either a wall adapter or a USB charger. The charge current can be programmed to 100 mA or 500 mA max for use with a USB 2.0 port, or programmed to the value set by the Rset resistor for use with a wall adapter or a dedicated USB charger. The USBPWR input is used only for charging from a USB port (100 mA or 500 mA max). Figure 16. Charge using internal power devices from wall adapter or USB port/charger DRIVER MAIN VOUT C4 from USB port only USBPWR STw4102 C5 SENSE battery voltage BATT C3 to power management PWRDETECTN BATTSENSE Indicator LED ISET Rset EOCHG CVIS C1 CVREF C2 LDODRV LDOFB C32KHZ IO voltage Reset Table 8. 14/34 STDBY VIO ICG+ SCL SDA RESETN ICG- 32kHz StandBy Rcg GND TEST External component list Name Typ. value Tolerance Comments Rset 12k to 120k 1% Main charge current setting Rcg 30mΩ 1% Gas gauge sense resistor C1 1µF Internal supply decoupling capacitor C2 1µF Internal voltage reference decoupling capacitor C3 0.1 to 22µF When the battery is removed, a capacitor of at least 15µF is required for low ripple on the battery line. C4 0.1 to 1µF MAIN input decoupling capacitor C5 0.1 to 1µF USBPWR input decoupling capacitor STw4102 5.2 Application schematics Charge currents higher than 1 Amp One-time programming (OTP) options offer the ability to use an external power device or an external sense resistor to handle charge currents higher than 1 A from the wall adapter. These OTP options are set by STMicroelectronics at factory level. Figure 17. Charge using external power devices D1 M1 T1 DRIVER MAIN VOUT Rs USBPWR STw4102 SENSE C3 battery voltage BATT to power management PWRDETECTN BATTSENSE Indicator LED ISET Rset EOCHG CVIS C1 CVREF C2 LDODRV LDOFB C32KHZ IO voltage Reset Table 9. STDBY VIO ICG+ SCL SDA RESETN ICG- 32kHz StandBy Rcg GND TEST Component list for external power devices Name Typ. value Tolerance Comments Rset 8k to 12k 1% Main charge current setting Rs 200mΩ 1% External current sense resistor T1 or M1 + D1 STT818B STS2DPFS20V PNP transistor PMOS transistor with Schottky diode 15/34 Application schematics 5.3 STw4102 Using LDO regulator to supply telephone from wall adapter The regulator with external power PMOS (M1) supplies the telephone while the battery is discharged or unplugged. When the charger is unplugged, the phone is supplied by the battery through Power MOS M2. A Schottky diode (D1) avoids reverse current. Figure 18. Charge power path and regulator MAIN DRIVER VOUT C4 USBPWR STw4102 SENSE Battery voltage BATT C3 to power management PWRDETECTN BATTSENSE Indicator LED ISET Rset EOCHG CVIS C2 CVREF LDODRV LDOFB C32KHZ IO voltage Reset STDBY VIO ICG+ SCL SDA RESETN ICG- C1 32kHz StandBy Rcg GND TEST M1 D1 M2 Co >= 15uF To phone Table 10. 16/34 Component list for LDO regulator Name Typ. value Tolerance Comments M1 + D1 STS2DPFS20V M2 STT5PF20V PMOS transistor Co 10µF to 22µF An output capacitor Co of at least 10µF is required. C4 Co An input capacitor C4 equal to or larger than Co is required on MAIN input. PMOS transistor with Schottky diode STw4102 Battery charger 6 Battery charger 6.1 Charge cycle The charge cycle is initiated when the presence of a power source on either the MAIN or USBPWR inputs is detected (the PWRDETECTN pin goes low), while the charger is enabled by the CHG_ENA bit of the REG_CHG1 control register. If both supplies are connected, the MAIN input path is selected. The EOCHG output pin is driven low as the charge begins. If the battery voltage is lower than the trickle threshold, the charge cycle begins in trickle mode with a low current (default value: 60 mA) until the battery voltage reaches the trickle voltage threshold (default value: 2.9 V). Once the battery voltage rises above this threshold, the charger enters into fast charge mode where the programmed charge current Icharge or IUSB is supplied to the battery. When the battery voltage approaches the programmable charge voltage (4.10V, 4.20V, 4.30V or 4.35V), the charger enters into a constant voltage charging mode and the charging current decreases. When the current level reaches the end-of charge level (10% of Icharge), the EOCHG status pin is switched off (open) to indicate that the battery is almost fully charged, and the charger enters maintenance mode. In maintenance mode, the charger continues to monitor the battery voltage to maintain the battery voltage level. The maintenance mode lasts until the charge is stopped by clearing the CHG_ENA bit in the REG_CHG1 control register, or by removing the power source (PWRDETECTN is opened). Figure 19. Charge flow (simplified) Charge Off EOCH OPEN (LED OFF) Power detected (PWRDETECTN LOW) Power removed (PWRDETECTN OPEN) Charge Stopped EOCH OPEN (LED OFF) Trickle charge 60mA EOCH LOW (LED ON) Vbatt < 2.8v Vbatt > 2.9v CCCV charge EOCH LOW (LED ON) Icharge > 15% Battery overvoltage or Watchdog event Icharge < 10% Maintenance charge EOCH OPEN (LED OFF) CCCV is still ON Battery overvoltage or Watchdog event 17/34 Battery charger 6.2 STw4102 Trickle charge The trickle charge mode is enabled when the battery voltage Vbatt is lower than the trickle voltage threshold Vtrickle. An internal current source charges the battery. When Vbatt is above Vtrickle, the trickle current generator is off and the battery is charged using the constant current method. The trickle voltage threshold and trickle current are defined by OTP configuration bits and are factory set to 2.9 V and 60 mA by default. Other values are possible, see Section 9: Factory OTP options on page 24. 6.3 Charging from a wall adapter The MAIN input is used for charging from a wall adapter or a dedicated USB charger. The SEL_DC_USB bit (bit 5 of register REG_CHG0) must be set to 0. The fast charge current is defined by the external resistor Rset connected to the ISET pin, and can be set up to 1 A. The value of the fast charge current is given by the following formula: Icharge = 12000 / Rset In the constant voltage mode, the charger output voltage is regulated with 1% accuracy. The charger output voltage is programmable using the REG_CHG0 register, bits 3 and 4 (see Table 11). Table 11. Charger output voltage REG_CHG0[4] REG_CHG0[3] Vcharge 0 0 4.10V +/-1% 0 1 4.20V +/-1% 1 0 4.30V +/-1% 1 1 4.35V +/-1% Figure 20. Main charge mode Ibatt Vbatt Battery Voltage Vcharge Charge current Icharge (defined by Rset) Flag end of charge (10% Icharge) Vtrickle (2.9v) Itrickle (60mA) Trickle charge Fast charge Constant current 18/34 Maintenance charge Constant voltage STw4102 6.4 Battery charger Charging from a USB port The MAIN or USBPWR input can be used to charge from a USB 2.0 port. When using the MAIN input, bit SEL_DC_USB (bit 5 of register REG_CHG0) must be set to 1. Charging from a USB port is similar to charging from a wall adapter, except the fast charge current IUSB is set internally and depends on bits 6 and 7 of the control register REG_CHG0. Table 12. 6.5 USB charge current REG_CHG0[7] REG_CHG0[6] IUSB (typ) 0 0 60mA (100 mA max) 0 1 200mA 1 0 400mA (500 mA max) 1 1 off Charging using external power devices To support charge currents higher than 1 A from the main supply adapter, the STw4102 provides the option to use an external power device and sense resistor. This OTP option is factory set. The STw4102 driver is able to drive an external PNP (STT818B or equivalent) or a PMOS plus Schottky diode (STS2DPFS20V or equivalent). The driver maximum sink current is 60 mA. The external current sensing device is usually a 200 mΩ shunt resistor. With this resistor value, the trickle and USB charge currents are close to the nominal values. 6.6 Charge mode summary Table 13 summarizes the different charge modes. Table 13. Vbatt Charge modes MAIN detected USBPWR CHG_ENA SEL_DC_USB detected bit bit Charge x x 0 x Charge disabled 0 0 1 x No charge under 1 x Vtrickle 1 x 0 - 1 1 Trickle charge from USBPWR 1 0 Fast charge from MAIN input, current set by Rset 1 1 Fast charge from MAIN input, current set by USB_ICHG bits 1 x Fast charge from USBPWR input, current set by USB_ICHG bits x above Vtrickle 0 Trickle charge from MAIN 1 19/34 Battery charger 6.7 STw4102 Watchdog timer When the fast charge is active, a watchdog timer starts to prevent damage on the battery. The system controller refreshes the watchdog periodically in order let the charge continue. When the watchdog time elapses, the charge is stopped. When the charge starts in trickle mode, to allow the battery to be charged although the system controller is not running, the watchdog is disabled. However, if for any reason the charger goes from fast charge mode to trickle mode, then the watchdog is not disabled to protect against battery failure. Watchdog timing can be 1 minute, 15 minutes, 30 minutes or 60 minutes. It is programmable through the I2C interface. The watchdog can be reset by the I2C interface (bit WDOG_RST) or by unplugging the charger (PWRDETECTN goes to low). The watchdog can also be enabled and disabled through the I2C interface. In the standard configuration, the default state at powerup is watchdog enabled and the timing is one minute. 6.8 Thermal regulation A thermal regulation circuit limits the charge current in case of high power dissipation due to high input voltage or high ambient temperature. The charge current is progressively reduced to maintain the die temperature in a safe area. This allows to charge the battery with the highest possible current depending on the operating conditions, and protects the device against any damage. 20/34 STw4102 7 Low drop-out regulator Low drop-out regulator The purpose of the low drop-out regulator (LDO) is to supply the phone directly from the wall adapter when the battery is low or not present. When the wall adapter is present, MOSFET is off and the phone supply is regulated at 4.7 V minus the drop voltage across D1. When the MAIN pin is not connected, MOSFET M2 is on (the gate is pulled down) and the D1 diode avoids any reverse current. The LDO output current is limited by The M1 MOSFET and D1 diode current capabilities. An output capacitor Co of at least 15 µF is required. The schematics are illustrated in Figure 21. When the battery is fully discharged, the regulator can charge the battery from the main supply and at the same time supply the phone, which avoids waiting for the battery to be charged up to the minimum operating voltage before using the phone. Figure 21. Regulator Wall adapter power supply LDODRV M1 LDOFB Main supply LDO 4.7V D1 M2 Battery power supply Co >= 15uF To phone When the main supply is above the low dropout threshold LDOpower_th (about 7.2 V), then the LDO is turned off to protect the external PMOS against high power dissipation as shown in Figure 22. LDOpower_th hysteresis is around 0.7 V. By default, this protection feature is enabled, but can be disabled at factory level by OTP. Figure 22. Supply voltage Main supply voltage 7.2V 6.5V 4.7V Main detect ON ON 21/34 Battery monitoring STw4102 8 Battery monitoring 8.1 Gas gauge The gas gauge is designed to monitor the battery capacity. A current sensing resistor (typically of 30 mΩ) is needed between the negative terminal of the battery and the ground. The sensing resistor voltage drop is input to a 13-bit integrating AD converter. When a conversion cycle is completed, depending on the output sign, the result is forwarded to the charge or discharge 24-bit accumulator, and the number of conversions is incremented in a 12-bit counter. One accumulator accumulates current flowing into the battery during charging and the other accumulates discharge current during system operation. The remaining battery charge is given by the difference between the charge and discharge accumulators. Figure 23. Gas gauge block diagram Conv_number registers 12 bits Counter 13 Conv_data registers 24 Charge registers 24 Discharge registers 24 bit max Charge accumulator From 2’s ICG+ ICG- AD converter 12 bits + sign bit to binary Discharge accumulator sign Σ EOC cg_clock cg_enable Control logic cg_calibration 32kHz Control registers The Digital Base Band (DBB) can control, enable and read gas gauge data through I2C control registers. The DBB can read the value of the most recent conversion in two’s complement format by reading the CONVDATA registers. The RD_REQ bit enables the transfer of the charge/discharge accumulators and conversion counter register. The transfer can take up to eight 32 kHz cycles, therefore a delay of 22/34 STw4102 Battery monitoring approximately 250 microseconds must be respected between the time the RD_REQ bit is set and the actual register reading. The RD_REQ bit is automatically cleared after the transfer. A high value written to the RST_CHRG, RST_DCHRG or RST_COUNTER bits of the control register resets respectively the charge accumulator, discharge accumulator or conversion counter. If these bits are set together with the RD_REQ bit, then the reset occurs after the transfer to the charge, discharge or conversion counter register respectively. The RST_CHRG, RST_DCHRG or RST_COUNTER bits are automatically cleared after the reset. The differential inputs are scaled to the full range of the AD converter, introducing a small offset error. A high value written to the CG_CAL bit of the control register connects the inputs of the AD converter together, allowing the DBB to measure the digital offset error. Using this measurement, the gas gauge can be calibrated to reduce the offset error. The conversion cycle of a 12-bit plus 1 sign-bit AD converter is 213 (8192) clock cycles. Using the 32.768kHz RTC clock, the conversion cycle time is 250 ms. The LSB value is 23.54 µV, which corresponds to a current of 784.7 µA with a typical 30 mΩ sense resistor. Given a 250 ms conversion cycle time, this LSB value corresponds to a charge of 54.5 nAh. Under these conditions, the 24-bit accumulator has a capacity of 914 mAh. The gas gauge system is disabled when the battery voltage is below the Power On Reset threshold (2.7 V), or when the RESETN pin is driven low (CG_ENA bit default value is 0). During normal operation, either the STDBY pin or the CG_ENA bit can be used to disable the gas gauge function. When the STDBY pin is low, the gas gauge is disabled without waiting for the end of the current conversion. When the CG_ENA bit is low, the current gauge is disabled at the end of the current conversion. 8.2 Battery voltage monitoring The battery voltage can be measured by means of a 7- or 12-bit A/D converter. This function is enabled and configured using the following bits of the ADCTRL register: ● The ADPOWERON bit enables battery voltage monitoring. ● The ADRESOLUTION bit allows to select 7- or 12-bit conversion. ● The ONSTATE bit is set when the ADC converter is ready. ● The ADSTART bit starts a conversion; it is automatically cleared after writing. ● The ADRUN bit indicates that a conversion is in progress. The result is available when the ADRUN bit goes low, and it can be read in the ADDATA registers. A high value written to the ADCAL bit of the control register connects the input of the A/D converter to ground, allowing the DBB to measure the digital offset error. Using this measurement, the AD converter can be calibrated to reduce the offset error. The conversion cycle of a 7 (12) bit conversion is 28=256 (213=8192) clock cycles. Using the 32.768kHz RTC clock, the conversion cycle time is 7.8 (250) ms. LSB value is 45 (1.4) mV. When the battery voltage falls below the Power On Reset threshold, or when the RESETN input is driven low, the battery voltage monitoring function is disabled. 23/34 Factory OTP options 9 STw4102 Factory OTP options Table 14 summarizes the one-time programming (OTP) options offered by STMicroelectronics to customize the STw4102 at factory level. Table 14. Factory OTP options Option Configuration bits TRICKLE current (wall adapter OTP_TC=0 (default) charge only) OTP_TC=1 Value 60 mA 120 mA TRICKLE threshold voltage OTP_TV1, OTP_TV0 : 00 01 10 11 (default) MAIN input mode at powerup OTP_SEL_DC_USB=0 (default) OTP_SEL_DC_USB=1 Watchdog state at powerup OTP_WD_ENA=0 OTP_WD_ENA=1 (default) Watchdog period at powerup OTP_WD_TIME1, OTP_WD_TIME0 : 00 (default) 01 10 11 Power switch OPT_IEPD=0 (default) OPT_IEPD=1 Internal External Sense resistor OPT_IERSENSE=0 (default) OPT_IERSENSE=1 Internal External LDO overvoltage protection OPT_LDOEXT_PRO=0 OPT_LDOEXT_PRO=1 (default) Disabled Enabled I2C ID address OTP_ID2, OTP_ID1, OTP_ID0 : 000 (default) 001 010 011 100 101 110 111 70h 71h 72h 73h 74h 75h 76h 77h 2.3 V 2.5 V 2.7 V 2.9 V Wall adapter mode USB mode Disabled Enabled 1 min 15 min 30 min 60 min For any option request other than the standard configuration (default values), contact STMicroelectronics to get a specific order code. 24/34 I2C interface STw4102 10 I2C interface 10.1 Read and write operations The I2C interface is used to control the charging and the gas gauge system. It is compatible with the I2C specification of Philips (version 2.1). It is a slave serial interface with a serial data line (SDA) and a serial clock line (SCL): SCL: input clock used to shift data SDA: input/output bi-directional data transfers A filter rejects the potential spikes on the bus data line to preserve data integrity. The bidirectional data line supports transfers up to 400 kbit/s (fast-mode). The data is shifted into and from the chip on the SDA line, MSB first. The first bit must be high (START), followed by the Device ID and Read/Write control bit (see Table 15). The AddrID0 to AddrID2 bits are factory programmable, their default ID value is 70h (AddrID0 = AddrID1 = AddrID2 = 0). Then, the STw4102 sends an acknowledge at the end of the 8-bit transmission. The next 8 bits correspond to the address register, followed by another acknowledge. Table 16 shows the address register format. The data field is sent last. It can be composed of several 8-bit data registers, each followed by an acknowledge. Table 17 shows the data register format. The STw4102 supports byte read, word read, block read, and byte write operations. The transmission protocol is summarized in Figure 24 and Figure 25. Table 15. Device ID and R/W bit format b7 b6 b5 b4 b3 b2 b1 b0 1 1 1 0 AddrID2 AddrID1 AddrID0 R/W Table 16. Address register format b7 b6 b5 b4 b3 b2 b1 b0 RegAddr7 RegAddr6 RegAddr5 RegAddr4 RegAddr3 RegAddr2 RegAddr1 RegAddr0 Table 17. r Data register format b7 b6 b5 b4 b3 b2 b1 b0 DATA7 DATA6 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 Figure 24. Byte, word and block read operation Master Start Device id W 7 bits Slave A Reg address A 8bits Restart Device id Start bit = SDAfalling when SCL=1 Stop bit = SDArising when SCL=1 Restart bit = start after a start Acknowledge = SDA force low during a SCL clock 7 bits R A Reg data 8bits A Reg data A Reg data 8bits 8bits address n+1 address n+2 A/A Stop <-- byte read --> <-- word read (2 bytes) ----------> <-- block read (up to 10 bytes) ----------------------> 25/34 I2C interface STw4102 Figure 25. Byte write operation Start Device id W 7 bits A Reg address A 8bits Reg data A Stop 8bits Start bit = SDAfalling when SCL=1 Stop bit = SDArising when SCL=1 Restart bit = start after a start 10.2 Register mapping The mapping of all registers is shown in Table 18. Individual register descriptions are shown in Table 19 to Table 35. Power-up values are set at power startup, or at reset (RESETN pin falling edge). Charge and discharge internal accumulators are not affected by RESETN. Table 18. Register mapping Name 26/34 Address (dec.) Description REG_CHG0 0 Charge control and status REG_CHG1 1 Charge enable REG_WDOG 2 Watchdog control REG_CG 3 Gas gauge control REG_CHARGE_LOW 4 Gas gauge charge data, bits 0-7 REG_CHARGE_MID 5 Gas gauge charge data, bits 8-15 REG_CHARGE_HIGH 6 Gas gauge charge data, bits 16-23 REG_DISCHARGE_LOW 7 Gas gauge discharge data, bits 0-7 REG_DISCHARGE_MID 8 Gas gauge discharge data, bits 8-15 REG_DISCHARGE_HIGH 9 Gas gauge discharge data, bits 16-23 REG_CONVDATA_LOW 16 Gas gauge AD converter data, bits 0-7 REG_CONVDATA_HIGH 17 Gas gauge AD converter data, bits 8-12 REG_CONVNUMBER_LOW 18 Number of conversions, bits 0-7 REG_CONVNUMBER_HIGH 19 Number of conversions, bits 8-11 REG_ADCTRL 20 Battery voltage monitor control REG_ADDATA_LOW 21 Battery voltage monitor AD converter data, bits 0-7 REG_ADDATA_HIGH 22 Battery voltage monitor AD converter data, bits 8-10 I2C interface STw4102 Table 19. REG_CHG0. address 0 (00h) Pos. Type Powerup CHARGERUN 0 R 0 0: Charge is below 10% of fast charge current. 1: Charge is above 10% of fast charge current. MAINDETECT 1 R 0 Main input voltage detection. USBDETECT 2 R 0 USB input voltage detection. [4,3] R/W 00 Charge voltage 00=4.1V, 01=4.2V, 10=4.3V, 11=4.35V. 5 R/W 0 Wall adapter/USB selection for MAIN input 0: charge current set by Rset resistor 1: charge current set by USB_ICHG bits [7,6] R/W 00 USB charge current 00=60mA, 01=200mA, 10=400mA, 11=off. Name VCHG SEL_DC_USB USB_ICHG Table 20. Description REG_CHG1. address 1 (01h) Pos. Type Powerup CHG_ENA 0 R/W 1 0: Charger disabled. 1: Charger enabled. Reserved [3,1] R/W 0 Reserved bits, to be set to zero. FORCECHARGER UN 4 R/W 0 0: no effect. 1: force EOCHG low independently of charge state. SEL_IS 5 R/W 0 0: Internal supply from Main or USB input when available and charge enabled. 1: Internal supply always from Battery. Unused [7,6] R/W Name Table 21. Description REG_WDOG. address 2 (02h) Pos. Type Powerup 0 R/W 1 0: Watchdog disabled. 1: Watchdog enabled. WDOG_TIME [2,1] R/W 00 00=1 minute, 01=15 minutes, 10=30 minutes, 11=60 minutes. WDOG_RST 3 R/W 0 0: No effect. 1: Reset watchdog. Bit clear after watchdog reset. [5,4] R/W 0 Reserved bits, to be set to zero WDOG_INT 6 R x 1: Watchdog is elapsed. Unused 7 R/W Name WDOG_EN Reserved Description 27/34 I2C interface STw4102 Table 22. REG_CG. address 3 (03h) Pos. Type Powerup CG_ENA 0 R/W 0 0: Gas gauge disabled. Charge/discharge accumulators are reset. 1: Gas gauge enabled. RST_CHRG 1 R/W 0 0: No effect. 1: Resets the charge accumulator. This bit auto clears after the charge register is reset. RST_DCHRG 2 R/W 0 0: No effect. 1: Resets the discharge accumulator. This bit auto clears after the discharge register is reset. RST_COUNTER 3 R/W 0 0: No effect. 1: Resets the counter conversion. This bit auto clears after the counter register is reset. Name RD_REQ 4 R/W 0 0: No effect. 1: Transfers the 24 bit charge/discharge accumulators and the conversion counter to the charge/discharge and conversion number registers. This bit auto clears after the transfer. CG_CAL 5 R/W 0 0: No effect. 1: Allows to calibrate AD converter. CG_EOC 6 R 0 Set high at the end of a conversion. Cleared after read. Unused 7 R/W Table 23. Name DATA[7..0] Table 24. Name DATA[15..8] Table 25. REG_CHARGE_LOW. address 4 (04h) Pos. Type Powerup [7..0] R 00 Pos. Type Powerup [7..0] R 00 Type Powerup DATA[23..16] [7..0] R 00 DATA[7..0] Current charge data. Description Current charge data. REG_CHARGE_HIGH. address 6 (06h) Pos. Name Description REG_CHARGE_MID. address 5 (05h) Name Table 26. 28/34 Description Description Current charge data. REG_DISCHARGE_LOW. address 7 (07h) Pos. Type Powerup [7..0] R 00 Description Current discharge data. I2C interface STw4102 Table 27. Name DATA[15..8] Table 28. REG_DISCHARGE_MID. address 8 (08h) Pos. Type Powerup [7..0] R 00 Pos. Type Powerup DATA[23..16] [7..0] R 00 Name DATA[7..0] Table 30. Pos. Type Powerup [7..0] R 00 Powerup DATA[12..8] [4..0] R 0 Not used [7..5] R 0 Name DATA[7..0] Table 32. Current discharge data. Description AD converter data. REG_CONVDATA_HIGH. address 17 (11h) Type Table 31. Description REG_CONVDATA_LOW. address 16 (10h) Pos. Name Current discharge data. REG_DISCHARGE_HIGH. address 9 (09h) Name Table 29. Description Description AD converter data. REG_CONVNUMBER_LOW. address 18 (12h) Pos. Type Powerup [7..0] R 0 Description Number of conversions. REG_CONVNUMBER_HIGH. address 19 (13h) Pos. Type Powerup DATA[11..8] [3..0] R 0 Number of conversions. Reserved [7..4] R x Reserved bits. Name Description 29/34 I2C interface STw4102 Table 33. REG_ADCTRL. address 20 (14h) Pos. Type Powerup ADPOWERON 0 R/W 0 0: Allows ADC shutdown. 1: Enables ADC operation. ONSTATE 1 R 0 0: ADC is not ready for operation. 1: ADC is ready for operation. ADSTART 2 R/W 0 0: No effect. 1: Allows to start a conversion. Cleared upon writing. ADRUN 3 R 0 0: An AD conversion is not running. 1: An AD conversion is running. ADRESOLUTION 4 R/W 0 0: 7 bits. 1: 12 bits. ADCAL 5 R/W 0 0: No effect. 1: Allows to calibrate AD converter. [7,6] R 0 Name Not used Table 34. Name DATA[7..0] DATA[6..0] Table 35. 30/34 REG_ADDATA_LOW. address 21 (15h) Pos. Type Powerup [7..0] [6..0] R 00 Description AD converter data in 12 bit mode. AD converter data in 7 bit mode (bit7=0). REG_ADDATA_HIGH. address 22 (16h) Pos. Type Powerup DATA[11..8] [3..0] R 0 Not used [7..4] R 0 Name Description Description AD converter data in 12-bit mode (0 in 7-bit mode). STw4102 11 Package information Package information In order to meet environmental requirements, STMicroelectronics offers these devices in ECOPACK® packages. These packages have a lead-free second level interconnect. The category of second level interconnect is marked on the package and on the inner box label, in compliance with JEDEC Standard JESD97. The maximum ratings related to soldering conditions are also marked on the inner box label. ECOPACK is an STMicroelectronics trademark. ECOPACK specifications are available at: www.st.com. Table 36. QFN24 package mechanical data Dimensions Ref. Millimeters Typ. Inches Min. Max. A 0.80 1.00 A1 0.00 0.05 A2 0.65 D 4.00 D1 3.75 E 4.00 E1 3.75 Typ. Min. Max. 0.80 Θ 12° P 0.42 0.24 0.60 R 0.17 0.13 0.23 e 0.50 N 24.00 Nd 6.00 Ne 6.00 L 0.40 0.30 0.50 0.18 0.30 b Q 0.20 0.45 D2 2.10 1.95 2.25 E2 2.10 1.95 2.25 31/34 Package information Figure 26. QFN24 package mechanical drawing Figure 27. QFN24 footprint 32/34 STw4102 STw4102 12 Ordering information Ordering information Table 37. Order code Order code(1) Temperature range Package Packaging Marking STw4102IQT -30° C, +85° C QFN24 Tape & reel W4102I 1. Order code for parts with standard configuration. Contact STMicroelectronics to get order codes for parts with specific configurations. 13 Revision history Table 38. Document revision history Date Revision Changes 17-Mar-2008 1 Initial release (preliminary data). 20-Mar-2008 2 Document status promoted from preliminary data to datasheet. 33/34 STw4102 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST’s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. © 2008 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 34/34