SLUUCD5 January 2023 BQ27427
If the application requires different configuration data for the fuel gauge, the system processor can update RAM-based data memory parameters using the Control()SET_CFGUPDATE subcommand to enter the CONFIG UPDATE mode.
To ensure that the gas gauge has entered CONFIG UPDATE mode correctly, there needs to be at least an 1100-ms delay after sending the SET_CFGUPDATE. Operation in this mode is indicated by the Flags()[CFGUPMODE] status bit.
In this mode, fuel gauging is suspended while the host uses the extended data commands to modify the configuration data blocks. To resume fuel gauging, the host must send a Control()SOFT_RESET subcommand to exit the CONFIG UPDATE mode, which clears both Flags()[ITPOR] and [CFGUPMODE] bits. After a timeout of approximately 240 seconds (4 minutes), the gauge automatically exits the CONFIG UPDATE mode if it has not received a SOFT_RESET subcommand from the host.
The memory of the BQ27427 device is separated into memory subclasses defined in this document. The memory cannot be directly addressed, but is updated through a sequence of extended commands that can access each block of memory indirectly. The gm.fs file updates these blocks to write the proper configuration so the BQ27427 device can have proper gauging performance and match the system characteristics. These updates are stored in RAM and need to be re-programmed any time the device loses power. (The [ITPOR] bit in the Flags() register indicates that the RAM configuration has been reset to the defaults, and is in need of updating using the gm.fs file.)
#GUID-C5036616-CA2A-4AC9-AB56-E29A29916FBE/SLUUBB04020 shows the “Ra Tables” subclass in the BQ27427 gauge (see also Table 7-2).
Class | Subclass | Subclass ID | Offset | Type | Name | Min | Max | Default | Units |
---|---|---|---|---|---|---|---|---|---|
Ra Tables | Ra0 RAM | 89 | 0 | I2 | Ra 0 | 0 | 32767 | 78 | Num |
Ra Tables | Ra0 RAM | 89 | 2 | I2 | Ra 1 | 0 | 32767 | 35 | Num |
Ra Tables | Ra0 RAM | 89 | 4 | I2 | Ra 2 | 0 | 32767 | 39 | Num |
Ra Tables | Ra0 RAM | 89 | 6 | I2 | Ra 3 | 0 | 32767 | 45 | Num |
Ra Tables | Ra0 RAM | 89 | 8 | I2 | Ra 4 | 0 | 32767 | 42 | Num |
Ra Tables | Ra0 RAM | 89 | 10 | I2 | Ra 5 | 0 | 32767 | 36 | Num |
Ra Tables | Ra0 RAM | 89 | 12 | I2 | Ra 6 | 0 | 32767 | 39 | Num |
Ra Tables | Ra0 RAM | 89 | 14 | I2 | Ra 7 | 0 | 32767 | 36 | Num |
Ra Tables | Ra0 RAM | 89 | 16 | I2 | Ra 8 | 0 | 32767 | 35 | Num |
Ra Tables | Ra0 RAM | 89 | 18 | I2 | Ra 9 | 0 | 32767 | 37 | Num |
Ra Tables | Ra0 RAM | 89 | 20 | I2 | Ra 10 | 0 | 32767 | 38 | Num |
Ra Tables | Ra0 RAM | 89 | 22 | I2 | Ra 11 | 0 | 32767 | 40 | Num |
Ra Tables | Ra0 RAM | 89 | 24 | I2 | Ra 12 | 0 | 32767 | 46 | Num |
Ra Tables | Ra0 RAM | 89 | 26 | I2 | Ra 13 | 0 | 32767 | 54 | Num |
Ra Tables | Ra0 RAM | 89 | 28 | I2 | Ra 14 | 0 | 32767 | 46 | Num |
The subclass ID is defined by the decimal number 89, which is hexadecimal 0x59. To program this subclass ID, send the following sequence to the BQ27427 after entering CONFIG UPDATE mode.
Commands | Description | |
---|---|---|
1 | W: AA 3E 59 00 | Write to I2C address AA, register 3E, the bytes 0x59 and 0x00. That is, 0x59 is written to 0x3E and 0x00 is written to address 0x3F. This is to setup the subclass ID for writes. |
2 | X: Delay (5 ms) | After setting up the subclass ID, delay for the BQ27427 to set up the block data to write all the 32 bytes. Wait a minimum of 5 ms after sending the command in (1). |
3 | W: AA 40 00 0B 00 0B 00 0D 00 11 00 0E 00 0C 00 0E 00 0C 00 0C 00 0D 00 0F 00 0F 00 17 00 2B 00 4B 00 00 | Send 32 bytes (1 block) of data to address 0x40. This is the actual data for the gas gauge data memory area. |
4 | W: AA 60 “checksum” | Write the checksum into register 0x60 |
5 | X: Delay (5 ms) | Need a delay after checksum operation of 5 ms |
6 | W: AA 3E 59 00 | Write the block address for checksum computation |
7 | X: Delay (5 ms) | Need a delay for checksum operation of 5 ms |
8 | C: AA 60 D3 | The checksum is computed and read from location 0x60 to compare the checksum to the checksum the gas gauge computed. |