STC3117
Gas gauge IC with battery charger control for handheld applications
Datasheet - production data
Description
The STC3117 includes the STMicroelectronics
OptimGauge™ algorithm. It provides accurate
battery state-of-charge (SOC) monitoring, tracks
battery parameter changes with operation
conditions, temperature, and aging, and allows
the application to get a battery state-of-health
(SOH) indication.
An alarm output signals low SOC or low voltage
conditions and also indicates fault conditions like
a missing or swapped battery.
CSP (1.49 x 1.594 mm)
Features
Patented OptimGauge™ algorithm for accurate
battery capacity calculation
Robust initial open-circuit-voltage (OCV)
measurement at power up
Programmable low battery alarm
Missing/swapped battery detection
Average current internal calculation
End-of-charge detection
Internal temperature sensor
Battery swap detection with protection against
false battery insertion
Low power: 40 µA in voltage-only mode, 2 µA
max in standby mode
1.49 x 1.594 mm 9-bump CSP package
Applications
Mobile phones, multimedia players, digital
cameras
Portable medical equipment
November 2017
This is information on a product in full production.
DocID025792 Rev 3
1/35
www.st.com
Contents
STC3117
Contents
1
Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2
Pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3
Absolute maximum ratings and operating conditions . . . . . . . . . . . . . 6
4
Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5
Application information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.1
6.2
7
8
2/35
Battery monitoring functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
6.1.1
Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.1.2
Battery voltage monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.1.3
Internal temperature monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.4
Current sensing in mixed mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.5
SOC change rate in voltage mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
STC3117 gas gauge architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.2.1
Coulomb counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.2.2
Voltage gas gauge algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.3
Mixed mode gas gauge system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.3
Alarm output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4
Current monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.5
Power-up and battery swap detection . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.1
Read and write operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2
Register map and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.2.1
Register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.2.2
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.2.3
REG_MODE and REG_CTRL register description . . . . . . . . . . . . . . . . 25
7.2.4
OCV table register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
DocID025792 Rev 3
STC3117
Contents
8.1
Flip Chip CSP 1.49 x 1.594 x 0.4 mm (N5) with coating ball
printing package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9
Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
DocID025792 Rev 3
3/35
35
Block diagram
1
STC3117
Block diagram
Figure 1. STC3117 internal block diagram
VCC
BATD
CD
Battery detection
and charge control
1.2 V
reference
32768 Hz
time base
Temperature
sensor
control logic &
ALM
state machine
Oscillator
AD converter
VIN
MUX
CS+
control registers
CS-
SCL
SDA
I2C interface
RAM and ID registers
GND
4/35
DocID025792 Rev 3
CS
STC3117
2
Pin assignment
Pin assignment
Table 1. STC3117 pin description
CSP bump
pin no.
Pin name
Type(1)
C3
ALM
O/OD
Alarm signal output, open drain,
external pull-up with resistor
A2
SDA
I/OD
I2C serial data
B2
SCL
I_D
I2C serial clock
A3
GND
Ground
B3
CS
I_A
Current sensing input
B1
BATD
I/OA
Battery detection input
A1
CD
O/OD
Battery charge inhibit (active high output)
C2
VCC
Supply
Power supply
C1
VIN
I_A
Function
Analog and digital ground
Battery voltage sensing input
1. I = input, 0 = output, OD = open drain, A = analog, D = digital, NC = not connected
Figure 2. STC3117 pin connections (top view)
CD
SDA
GND
BATD
SCL
CS
VIN
VCC
ALM
CSP (1.49 x 1.594 mm)
Top view (balls are underneath)
DocID025792 Rev 3
5/35
35
Absolute maximum ratings and operating conditions
3
STC3117
Absolute maximum ratings and operating conditions
Table 2. Absolute maximum ratings
Symbol
VCCMAX
VIO
TSTG
TJ
Parameter
Value
Maximum voltage on VCC pin
Unit
6
V
Voltage on I/O pins
-0.3 to 6
Storage temperature
-55 to 150
Maximum junction temperature
Electrostatic discharge (HBM: human body model)(1)
ESD
Electrostatic discharge (MM: machine
C
150
model)(2)
2
kV
150
V
1. Tested in compliance with MIL-883-H, AEC-Q100-002D and JEDEC JESD22-A114F
2. Tested in compliance with MIL-883-H, AEC-Q100-003E and JEDEC JESD22-A115A
Table 3. Operating conditions
Symbol
Parameter
VCC
Operating supply voltage on VCC
VMIN
Minimum voltage on VCC for RAM content retention
TOPER
V
2.0
-40 to 85
-20 to 70
DocID025792 Rev 3
Unit
2.7 to 4.5
Operating free air temperature range
TPERF
6/35
Value
C
STC3117
4
Electrical characteristics
Electrical characteristics
Table 4. Electrical characteristics (2.7 V < VCC < 4.5 V, -20C to 70C)
Symbol
Parameter
Conditions
Min
Typ
Max
Units
Supply
ICC
Average value over 4 s in
voltage mode
40
Average value over 4 s in
mixed mode
80
Operating current consumption
ISTBY
Current consumption in standby
Standby mode,
inputs = 0 V
BATD_PU bit = 0
IPDN
Current consumption in power-down
VCC < UVLOTH,
inputs = 0 V
UVLOTH
Undervoltage threshold
(VCC decreasing)
UVLOHYST
Undervoltage threshold hysteresis
POR
Power-on reset threshold
µA
2.5
(VCC decreasing)
2.6
2
1
2.7
V
100
mV
2.0
V
Current sensing
Vin_gg
Input voltage range
IIN
Input current
ADC_res
AD converter granularity
ADC_offset
AD converter offset
ADC_time
AD conversion time
ADC_acc
AD converter gain accuracy at full
scale (using external sense resistor)
FOSC
Internal time base frequency
Osc_acc
Internal time base accuracy
-40
mV
500
nA
5.88
CS = 0 V
-3
µV
3
500
25 C
LSB
ms
0.5
%
Over temperature range
1
32768
25 C, VCC = 3.6 V
Cur_res
+40
Hz
2
%
Over temperature and
voltage ranges
2.5
Current register LSB value
5.88
µV
Battery voltage and temperature measurement
Vin_adc
Input voltage range
LSB
LSB value
VCC = 4.5 V
0
Voltage measurement
Temperature measurement
ADC_time
AD conversion time
Volt_acc
2.7 V < Vin < 4.5 V,
Battery voltage measurement accuracy VCC = Vin, 25 C
Over temperature range
Temp_acc
Internal temperature sensor accuracy
DocID025792 Rev 3
4.5
V
2.20
mV
1
°C
250
ms
-0.25
+0.25
-0.5
+0.5
-3
3
%
°C
7/35
35
Electrical characteristics
STC3117
Table 4. Electrical characteristics (2.7 V < VCC < 4.5 V, -20C to 70C) (continued)
Symbol
Parameter
Conditions
Min
Typ
Max
Units
0.35
V
Digital I/O pins (SCL, SDA, ALM)
Vih
Input logic high
Vil
Input logic low
Vol
Output logic low (SDA, ALM)
1.2
Iol = 4 mA
0.4
Analog I/O pins (BATD, CD)
Vith
BATD input threshold voltage
1.46
1.61
Vihyst
BATD input voltage hysteresis
0.1
Ru
BATD internal pull-up resistor
1
Vcdoh
CD output logic high
Ioh = 3 mA
Vinmin_cd
Minimum Vin voltage for CD operation
0°C to 50°C
1.76
V
8/35
DocID025792 Rev 3
M
VCC
- 0.4
3.6
3.75
3.9
V
STC3117
Electrical characteristics
Table 5. I2C timing - VIO = 2.8 V, Tamb = -20 °C to 70 C (unless otherwise specified)
Symbol
Parameter
Min
Fscl
SCL clock frequency
thd,sta
Hold time (repeated) START condition
0.6
tlow
LOW period of the SCL clock
1.3
thigh
HIGH period of the SCL clock
0.6
tsu,sta
Setup time for repeated START condition
0.6
thd,dat
Data hold time
0
tsu,dat
Data setup time
100
Typ
0
Max
Unit
400
kHz
µs
0.9
tr
Rise time of both SDA and SCL signals
20+
0.1Cb
tf
Fall time of both SDA and SCL signals
20+
0.1Cb
tsu,sto
Setup time for STOP condition
0.6
tbuf
Bus free time between a STOP and
START condition
1.3
Cb
Capacitive load for each bus line
—
300
300
ns
µs
400
pF
Figure 3. I2C timing diagram
9LK
6'$
WI
9LO
WKGVWD
WU
WVXGDW WKLJK
6&/
WORZ
WKGGDW
WVXVWD
*$3060'
DocID025792 Rev 3
9/35
35
Application information
5
STC3117
Application information
Figure 4. Example of an application schematic
Optional filter
IO voltage
VCC
SCL
SDA
STC3117
C1
R1
VIN
C2
Other
detection
circuit
Battery pack
BATD
ALM
R2
Rid
CS
CD
GND
Rs
Table 6. External component list
Name
Value
Rs
5 to 50 m
C1
1 µF
C2
220 nF
Tolerance
Comments
1 % to 5 % Current sense resistor (2% or better recommended)
Supply decoupling capacitor
Battery voltage input filter (optional)
R1
1 k
R2
10/35
Battery detection function
DocID025792 Rev 3
STC3117
Functional description
6
Functional description
6.1
Battery monitoring functions
6.1.1
Operating modes
The monitoring functions include the measurement of battery voltage, current, and
temperature. A Coulomb counter is available to track the SOC when the battery is charging
or discharging at a high rate. A sigma-delta A/D converter is used to measure the voltage,
current, and temperature.
The STC3117 can operate in two different modes with different power consumption (see
Table 7. Mode selection is made by the VMODE bit in register 0 (refer to Table 12 for
register 0 definition).
Table 7. STC3117 operating modes
VMODE
Description
0
Mixed mode, Coulomb counter is active, voltage gas gauge runs in parallel
1
Voltage gas gauge with power saving
Coulomb counter is not used. No current sensing.
In mixed mode, current is measured continuously (except for a conversion cycle every 4 s
and every 16 s for measuring voltage and temperature respectively). This provides the
highest accuracy from the gas gauge.
In voltage mode with no current sensing, a voltage conversion is made every 4 s and a
temperature conversion every 16 s. This mode provides the lowest power consumption.
It is possible to switch between the two operating modes to get the best accuracy during
active periods, and to save power during standby periods while still keeping track of the
SOC information.
6.1.2
Battery voltage monitoring
Battery voltage is measured by using one conversion cycle of the A/D converter every 4 s.
The conversion cycle takes 213 = 8192 clock cycles. Using the 32768 Hz internal clock, the
conversion cycle time is 250 ms.
The voltage range is 0 to 4.5 V and resolution is 2.20 mV. Accuracy of the voltage
measurement is ±0.5 % over the temperature range. This allows accurate SOC information
from the battery open-circuit voltage.
The result is stored in the REG_VOLTAGE register (see Table 11).
DocID025792 Rev 3
11/35
35
Functional description
6.1.3
STC3117
Internal temperature monitoring
The chip temperature (close to the battery temperature) is measured using one conversion
cycle of the A/D converter every 16 s.
The conversion cycle takes 213 = 8192 clock cycles. Using the 32768 Hz internal clock, the
conversion cycle time is 250 ms. Resolution is 1° C and range is -40 to +125 °C.
The result is stored in the REG_TEMPERATURE register (see Table 11).
6.1.4
Current sensing in mixed mode
Current sensing is available only in mixed mode (VMODE=0).
The voltage drop across the sense resistor is integrated during a conversion period and is
input to the 14-bit sigma-delta A/D converter.
Using the 32768 Hz internal clock, the conversion cycle time is 500 ms for a 14-bit
resolution. The LSB value is 5.88 µV. The A/D converter output is in two’s complement
format.
When a conversion cycle is completed, the result is added to the Coulomb counter
accumulator and the number of conversions is incremented in a 16-bit counter.
The current register is updated after each conversion (that is: once per 500-ms
measurement cycle). The result is stored in the REG_CURRENT register (see Table 11).
Average current register
In mixed mode, an average value of the current measurement is calculated after each
current measurement with a time constant of 2 s.
The register REG_AVG_CURRENT (2 bytes) holds the average current when VMODE=0.
The LSB of REG_AVG_CURRENT is 1/4 the LSB of REG_CURRENT, that is 1.47 µV.
6.1.5
SOC change rate in voltage mode
Current sensing is not available in voltage mode (VMODE=1). Instead, an estimation of the
SOC change rate is provided in the REG_AVG_CURRENT register.
The SOC change rate is updated after each SOC calculation (that is: once per 4-s
measurement cycle) and is averaged with a time constant of 64 seconds. It is possible to
write an initial estimation into the REG_AVG_CURRENT register to speed-up the SOC
change rate settling time.
The REG_AVG_CURRENT register (2 bytes) holds the SOC change rate when VMODE=1.
The LSB of REG_AVG_CURRENT is 0.008789 C (by definition, 1 C means 100% SOC
change in 1 h).
12/35
DocID025792 Rev 3
STC3117
Functional description
6.2
STC3117 gas gauge architecture
6.2.1
Coulomb counter
The Coulomb counter is used to track the SOC of the battery when the battery is charging or
discharging at a high rate. Each current conversion result is accumulated (Coulomb
counting) for the calculation of the relative SOC value based on the configuration register.
The system controller can control the Coulomb counter and set and read the SOC register
through the I2C control registers.
Figure 5. Coulomb counter block diagram
16-bit counter
REG_COUNTER
register
REG_CURRENT
register
current filter
REG_AVG_CURRENT
register
EOC
Coulomb counter
calculator
CS
GND
AD converter
To SOC
management
REG_CC_CNF
register
The REG_CC_CNF value depends on battery capacity and the current sense resistor. It
scales the charge integrated by the sigma delta converter into a percentage value of the
battery capacity. The default value is 395 (corresponding to a 10-m sense resistor and
1957-mAh battery capacity).
The Coulomb counter is inactive if the VMODE bit is set, this is the default state at poweron-reset (POR) or reset (VMODE bit = 1).
Writing a value to the register REG_SOC (mixed mode SOC) forces the Coulomb counter
gas gauge algorithm to restart from this new SOC value.
REG_CC_CNF register is a 16-bit integer value CC_CNF that is calculated as shown in
Equation 1:
Equation 1
CC_CNF = Rsense Cnom 49.556
Rsense is in mand Cnom is in mAh.
Example: Rsense =10 m, Cnom = 1500 mAh, CC_CNF = 303
DocID025792 Rev 3
13/35
35
Functional description
6.2.2
STC3117
Voltage gas gauge algorithm
No current sensing is needed for the voltage gas gauge. An internal algorithm precisely
simulates the dynamic behavior of the battery and provides an estimation of the OCV. The
battery SOC is related to the OCV by means of a high-precision reference OCV curve built
into the STC3117.
Any change in battery voltage causes the algorithm to track both the OCV and SOC values,
taking into account the non-linear characteristics and time constants related to the chemical
nature of the Li-Ion and Li-Po batteries.
A single parameter fits the algorithm to a specific battery. The default value provides good
results for most battery chemistries used in hand-held applications.
Figure 6. Voltage gas gauge block diagram
REG_VOLTAGE
register
REG_VM_CNF
register
REG_OCV
VIN
register
AD
converter
Voltage mode
(VM)
algorithm
To SOC
management
REG_OCVTAB
Reference
OCV
curve
register
REG_SOCTAB
register
Voltage gas gauge algorithm registers
The REG_VM_CNF configuration register is used to configure the parameter used by the
algorithm based on battery characteristic. The default value is 321 (corresponding to
160 m internal battery impedance and 1957 mAh Cnom battery capacity).
The REG_OCV register holds the estimated OCV value corresponding to the present
battery state.
The REG_OCVTAB and REG_SOCTAB registers define the OCV curve for a given battery
type; the default power-up values can be updated at software initialization.
The REG_VM_CNF register is a 12-bit integer value and is calculated from the averaged
internal resistance and nominal capacity of the battery as shown in Equation 2:
Equation 2
VM_CNF = Ri Cnom 977.78
Ri is in mand Cnom is in mAh.
Example: Ri = 250 m, Cnom =1500 mAh, VM_CNF= 384
14/35
DocID025792 Rev 3
STC3117
6.2.3
Functional description
Mixed mode gas gauge system
The STC3117 implements a mixed mode gas gauge (OptimGaugeTM 1) that uses both the
Coulomb counter (CC) and the voltage mode (VM) algorithm to track the battery SOC in all
application conditions and automatically provide the optimum SOC information. The VM
algorithm cancels any long-term errors and prevents the SOC drift problem that is
commonly found in CC-only solutions.
The STC3117 automatically selects the best method based on the relaxation timer (see
Section 6.4: Current monitoring) as follows: when a low-power application state is detected
by the relaxation timer, the SOC reported by the STC3117 is the VM SOC, otherwise the CC
SOC is reported. The STC3117 manages the transitions between the VM and CC modes
without discontinuity by adjusting the VM and the CC SOC to ensure smooth SOC variations
without jumps in any application conditions.
The current mixed mode state is indicated by the GG_VM bit in the REG_CTRL register:
GG_VM=1 means the reported SOC is the VM SOC, otherwise the SOC is the CC SOC.
Note:
When the application enters standby mode, the STC3117 can be put into power-saving
mode by setting the VMODE bit to 1 in the REG_MODE register. Only the VM gas gauge
stays active, the CC is stopped, and the power consumption is reduced.
Figure 7. Mixed mode gas gauge block diagram
Voltage mode
(VM)
gas gauge
SOC
management
Coulomb
counter
(CC)
REG_SOC
register
Alarm
management
REG_VM_ADJ
register
Parameter
tracking
REG_CC_ADJ
register
Adjustment registers
The registers REG_CC_ADJ and REG_VM_ADJ are signed 16-bit registers. They
accumulate the adjustment quantities made to the SOC values by the embedded mixed
mode algorithm:
REG_CC_ADJ = REG_SOC – (unadjusted CC SOC)
REG_VM_ADJ = REG_SOC – (unadjusted VM SOC)
These registers can be used by the system application to implement more sophisticated
algorithms for improved performance and accuracy.
Writing to the REG_SOC or REG_OCV initializes the two VM and CC algorithms to the
corresponding SOC value and clears REG_VM_ADJ and REG_CC_ADJ. It is possible to
write to the REG_SOC, REG_OCV, REG_VM_CNF and REG_CC_CNF registers when the
STC3117 is running without disturbing SOC management.
Note:
When writing to the REG_SOC or REG_OCV registers, the resulting SOC value is rounded
to the nearest 1/64 % value (the least three bits of REG_SOC are zero).
DocID025792 Rev 3
15/35
35
Functional description
6.3
STC3117
Alarm output
The ALM pin provides an alarm signal in case of low battery or fault condition. The output is
an open drain, and an external pull-up resistor is needed in the application. Writing the
IO0DATA bit to 0 forces the ALM output low; writing the IO0DATA bit to 1 lets the ALM
output reflect the battery condition. Reading the IO0DATA bit gives the state of the ALM pin.
When the IO0DATA bit is 1, the ALM pin is driven low if any of the following conditions are
met:
the battery SOC estimation from the mixed algorithm is less than the programmed
threshold (if the alarm function is enabled by the ALM_ENA bit)
the battery voltage is less than the programmed low voltage level (if the ALM_ENA bit
is set)
the BATFAIL bit is set (if the ALM_ENA bit is set)
Low-voltage or low-SOC alarms
When a low-voltage or low-SOC condition is triggered, the STC3117 drives the ALM pin low
and sets the ALM_VOLT or ALM_SOC bit in REG_CTRL.
The ALM pin remains low (even if the conditions disappear) until the software writes the
ALM_VOLT and ALM_SOC bits to 0 to clear the interrupt.
Clearing the ALM_VOLT or ALM_SOC while the corresponding low-voltage or low-SOC
condition is still true does not generate another interrupt; this condition must disappear first
and must be detected again before another interrupt (ALM pin driven low) is generated for
this alarm. The other alarm condition, if not yet triggered, can still generate an interrupt.
Usually, the low-SOC alarm occurs first to warn the application of a low battery condition,
then if no action is taken and the battery discharges further, the low-voltage alarm signals a
nearly-empty battery condition.
At power-up, or when the STC3117 is reset, the SOC and voltage alarms are enabled
(ALM_ENA bit = 1). The ALM pin is in high-impedance directly after a POR and is driven low
if the SOC and/or the voltage is below the default thresholds (1% SOC, 3.00 V), after the
first OCV measurement and SOC estimation.
The REG_SOC_ALM register holds the relative SOC alarm level in 0.5 % units (0 to 100 %).
Default value is 2 (i.e. 1 % SOC).
The REG_ALARM_VOLTAGE holds the low voltage threshold and can be programmed over
the full scale voltage range with 17.60 (2.20*8) mV steps. Default value is 170 (i.e. 3.00 V).
BATFAIL alarm
The BATFAIL bit in REG_CTRL reflects the battery swap event: BATFAIL bit is set when the
BATD signal rises above the BATD threshold (1.61 V typ) for more than 0.5 s. and is reset
by writing 0 to the BATFAIL bit if the BATD signal is below the BATD threshold (if BATD is
still above 1.61 V, then BATFAIL bit can not be cleared).
The STC3117 drives the ALM pin low when the BATFAIL bit is set and releases the ALM pin
when the BATFAIL bit is cleared.
16/35
DocID025792 Rev 3
STC3117
6.4
Functional description
Current monitoring
The battery average current is monitored and is used in conjunction with a timer to
implement a battery relaxation timer.
Battery relaxation timer
The battery relaxation timer is used to detect a light-load, low-power condition.
The REG_CMONIT_COUNT register is an 8-bit, read-only counter that is incremented
every 4 s when the average current is inside a window defined by positive and negative
thresholds set by the REG_CURRENT_THRES register, and decremented every 500 ms
when the current is outside the thresholds.
When the counter reaches its maximum value set by the REG_CMONIT_MAX register, a
low-power condition is reported to the mixed mode algorithm causing VM mode to be used.
When the counter reaches its minimum value (0), a high-power condition is reported and CC
mode is used.
The REG_CMONIT_MAX register sets the maximum value of the counter. With the default
value (120 dec), the counter provides an 8-minute delay when switching from CC to VM
mode and a 1-minute delay when switching from VM to CC mode.
The REG_CURRENT_THRES register is an 8-bit R/W register set by the gas gauge
firmware from the I2C. It holds the threshold amplitude in bits 0 to 6 (unsigned value
applicable for both positive and negative thresholds). Bit 7 of REG_CURRENT_THRES is
reserved and must be set to zero for operation of the current monitoring counter as a
relaxation timer. The LSB value of the REG_CURRENT_THRES is 47.04 µV and provides a
range of 0 to 6 mV.
It is possible to set the counter to zero or the maximum value using the FORCE_CC and
FORCE_VM bits in the REG_MODE register. These bits are self-clearing.
DocID025792 Rev 3
17/35
35
Functional description
6.5
STC3117
Power-up and battery swap detection
When the STC3117 is powered up at first battery insertion (power-on reset) or after a soft
reset condition (PORDET bit set by host), an automatic battery voltage, current and
temperature measurement cycle is made immediately after startup and debounce delay.
This feature enables the system controller to get the SOC of a newly inserted battery based
on the OCV.
The CD pin controls the battery charger to inhibit the charge during the initial OCV
measurement. The CD output is validated during the power-up/restart sequence but is
actually driven high only if the battery is present (BATD < 1.61V) and the battery voltage is
higher than a threshold (Vin > Vinmin_cd) at the beginning of the restart sequence.
The CD pin can be driven high under software control by using the bit FORCE_CD in the
REG_MODE register.
The BATD pin senses the presence of the battery independently of the battery voltage.
Figure 8. BATD and CD internal architecture overview
VCC
CD_drive
&
CD
BATD
1.61 V
+
-
Vin
Vinmin_cd level
+
-
The BATD pin is an analog I/O. The input detection threshold is typically 1.61 V.
The CD pin is an output connected to the VCC level when active. Otherwise, it is high
impedance.
The BATD pin can be connected to the NTC sensor or to the identification resistor of the
battery pack. By default, the STC3117 provides an internal pull-up resistor for the detection
of battery removal. The internal resistor can be disabled by clearing the bit BATD_PU in the
REG_MODE register. When disabled, an external pull-up resistor or another device has to
pull the BATD pin high.
18/35
DocID025792 Rev 3
STC3117
Functional description
Figure 9. Timing diagram details of the power-up and restart sequence
OCV
meas. Ibat
meas.
delay
VCC
Application can start,
charge is enabled
“Good”
battery
Vinmin_cd
UVLO
(arbitrary Vcc
waveforms only to
illustrate the function)
“Dead”
battery
Internal 1mA
sink current
“Good” battery
“Dead” battery
CD pin
(low means HiZ)
375 ms
Voltage
measurement
Current
measurement
Temperature
measurement
Conversion
counter
X
100
ms
0
125
ms
125
ms
1
2
125
ms
250
ms
3
GAMS1601141520CB
Battery swap detection
A battery swap can be detected in two ways:
the battery voltage drops below the undervoltage lockout (UVLO) for more than tdel
the BATD signal rises above the BATD threshold (1.61 V typ) for more than tdel
The tdel delay is 0.5 s.
Using the 0.5 s filter provides robust battery swap detection and prevents false battery swap
detection if short contact bouncing occurs at the battery terminals due to mechanical
vibrations or shocks. This also prevents false detections in case of short battery voltage
drops and protects the application against high surge currents at low temperatures.
Following a battery swap detection and after the battery voltage goes back above UVLO
and the BATD level returns to low level, the STC3117 is on hold with new voltage and
current measurements in the corresponding registers. The system has to restart the
STC3117 by doing a device soft reset i.e. by setting the PORDET bit to 1 in the REG_CTRL
register and restoring the parameters (if needed). To recover the event, either use the
measured voltage and current to define a new OCV voltage, or restore a previous SOC
state.
The occurrence of the battery swap event is indicated by the BATFAIL and UVLOD bits in
the REG_CTRL register.
DocID025792 Rev 3
19/35
35
Functional description
STC3117
Figure 10. Restart in case of battery swap