English
Language : 

AN4324 Datasheet, PDF (22/31 Pages) STMicroelectronics – STC3115 system integration
Software
AN4324
6.2
Chip initialization
The STC3115 has to be initialized from a specific value. The initialization process is
different depending on the history of the application before startup. We can identify two
main situations:
1. New battery plug-in. Full battery initialization has to be performed starting from the
default software point and using the initial battery model. The initial open circuit
voltage (OCV) measurement and state of charge (SOC) have to be used as the initial
battery state. This information can be retrieved from the STC3115 registers.
2. The battery has not been removed. When the battery has not been removed since the
last application switch off, the last recorded data can be recovered and stored in the
STC3115 using the data saved in the RAM memory.
At every application startup, the following steps are recommended to correctly configure
the STC3115 registers:
1. Read the chip ID in the REG_ID at address 0x18
2. Check the RAM memory status (test and CRC words)
3. If the RAM content is incorrect, initialize the RAM and the chip with default parameters
4. If the RAM content is correct, check the PORDET and BATFAIL bits
5. If BATFAIL = 1, the battery voltage was previously decreased below 2.6 V (UVLO
threshold), the Batd pin detected a battery removal/switch event, and the chip has to
be fully initialized. If PORDET = 1, the battery voltage was previously decreased
below 2 V (POR threshold), the battery was removed/switched, and the chip has to be
fully initialized. The STC3115 cannot be restored and full STC3115 initialization is
required (i.e. STC3115 initialization steps).
6. If the BATFAIL/PORDET = 0, the battery has not been removed and chipset
configuration can be recovered from the RAM data information (e.g. from the RAM
memory content description). STC3115 restoration is possible; the saved RAM data
can be used to restart the STC3115 from a previous application status (i.e. STC3115
restoration steps).
Once the validity of the STC3115 RAM memory and the status of the REG_CTRL register
has been checked, the STC3115 can then be initialized with default parameters or with
restored parameters (see Section 6.1 for RAM content clarification).
STC3115 initialization steps
This is the standard STC3115 initialization flow: all registers have to be initialized using
default values and the first open circuit voltage (OCV) measurement. Carry out the
following three steps when no data can be retreived from the last STC3115 running mode.
1. Read the OCV register. The first OCV measurement reflects the initial battery state of
charge (SOC). Read it and save it into a temporary variable.
2. Set the STC3115 parameters (ensuring first that the GG_RUN bit is set to 0). The
REG_OCVTAB registers have to be filled with their previously calculated values as
well as the values of the REG_CC_CNF and REG_VM_CNF registers. Then configure
the application parameters by setting the REG_ALARM_SOC,
REG_ALARM_VOLTAGE,
REG_CURRENT_THRES,
REG_RELAX_MAX,
REG_ALARM_SOC, and REG_ALARM_VOLTAGE registers as required by the
application to provide an HW interruption signal on the ALM pin when one of the
measurements is detected as being below the defined threshold. The
REG_CURRENT_THRES and REG_RELAX_MAX registers are used to configure the
internal behavior of the STC3115. Default values are enough to provide good
accuracy.
22/31
DocID024963 Rev 2.0