SLUUBD4A April 2016 – November 2022 BQ27220
The Data Memory contains initialization, default, cell status, calibration, configuration, and user information. Most Data Memory parameters reside in volatile RAM initialized by associated parameters from ROM. However, some Data Memory parameters are directly accessed from ROM and do not have an associated RAM copy. The Data Memory can be accessed in several different ways, depending in which mode the fuel gauge is operating and what data is being accessed.
Commonly accessed Data Memory locations frequently read by a system are conveniently accessed through specific instructions already described in Chapter 5, Extended Data Commands. These commands are available when the fuel gauge is either in UNSEALED or SEALED mode. Most Data Memory locations, however, are only accessible in the UNSEALED mode by use of the evaluation software or by Data Memory block transfers. These locations should be optimized and/or fixed during the development and manufacturing processes. They become part of a golden image file and then can be written to multiple battery packs. Once established, the values generally remain unchanged during end-equipment operation.
To access Data Memory locations individually, the block containing the desired Data Memory location(s) must be transferred to the command register locations, where they can be read to the system or changed directly. This is accomplished by sending the set-up command BlockDataControl() (0x61) with data 0x00. Up to 32 bytes of data can be read directly from the BlockData() (0x40 through 0x5F), externally altered, then rewritten to the BlockData()command space. Alternatively, specific locations can be read, altered, and rewritten if their corresponding offsets index into the BlockData() command space. Finally, the data residing in the command space is transferred to Data Memory, once the correct checksum for the whole block is written to BlockDataChecksum() (0x60). Occasionally, a Data Memory class is larger than the 32-byte block size. In this case, the BlockData() command designates in which 32-byte block the desired locations reside. The correct command address is then given by 0x40 + offset modulo 32. For an example of this type of Data Memory access, see Section 4.3.
Reading and writing subclass data are block operations up to 32 bytes in length. During a write, if the data length exceeds the maximum block size, then the data is ignored. None of the data written to memory is bounded by the fuel gauge—the values are not rejected by the fuel gauge. Writing an incorrect value may result in incorrect operation due to firmware program interpretation of the invalid data. The written data is not persistent, so a POR does resolve the fault.