SLUUAQ3A April 2016 – October 2022 BQ4050
Accessing data flash (DF) is only supported by the ManufacturerBlockAccess() by addressing the physical address.
To write to the DF, send the starting address, followed by the DF data block. The DF data block is the intended revised DF data to be updated to DF. The size of the DF data block ranges from 1 byte to 32 bytes. All individual data must be sent in Little Endian.
Write to DF example:
Assuming: data1 locates at address 0x4000 and data2 locates at address 0x4002. | ||||
Both data1 and data2 are U2 type. | ||||
To update data1 and data2, send an SMBus block write with command = 0x44 | ||||
block = | starting address + DF data block | |||
= | 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte |
To read the DF, send an SMBus block write to the ManufacturerBlockAccess(), followed by the starting address, then send an SMBus block read to the ManufacturerBlockAccess(). The return data contains the starting address followed by 32 bytes of DF data in Little Endian.
Read from DF example: | ||||
Taking the same assuming from the read DF example, to read DF, | ||||
a. Send SMBus write block with command 0x44, block = 0x00 + 0x40 | ||||
b. Send SMBus read block with command 0x44 | ||||
The returned block | = a starting address + 32 bytes of DF data | |||
= 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte.... data32_LowByte + data32_HighByte |
The gauge supports an auto-increment on the address during a DF read. This greatly reduces the time required to read out the entire DF. Continue with the read from the DF example. If another SMBus read block is sent with command 0x44, the gauge returns another 32 bytes of DF data, starting with address 0x4020.