SLUA790 November 2016 BQ34110 , BQ34Z100-G1 , BQ35100
Example 1:
Find the SubClass and Offset for the data that you want to read. We will use Serial Number for this example. SubClass 48, Offset 04 and it occupies 2 bytes.
Convert the SubClass HEX. 48 = 30H
Use the I2C Master Control Panel section to read the flash.
Start Register 61, Bytes to Write 00 (Enable Flash x’fer command)
Start Register 3E, Bytes to Write 30 (SubClass address)
Start Register 3F, Bytes to Write 00 (Enable General Purpose Block)
Start Register 40, Number of Bytes to Read 20
The Serial number starts in the 5th byte. (0 is the first byte) The Serial Number is 0001 in this example.
To read offset greater than 31, go to the next page; for example, I2C Command 3F, Byte 01
Example 2:
Find the SubClass and Offset for the data you want to read. Using Device Chemistry for this example; SubClass 30, Offset 55, and it occupies 5 bytes. The Offset exceeds 32 bytes, so read the data from the 2nd page of the SubClass. The Device Chemistry will be located in bytes 24-29 of the 2nd page. The first byte is the number of bytes in the string.
Convert the SubClass HEX. 48 = 30H
Use the I2C Master Control Panel section to read the flash.
Start Register 61, Bytes to Write 00 (Enable Flash x’fer command)
Start Register 3E, Bytes to Write 30 (SubClass address)
Start Register 3F, Bytes to Write 01 (Enable General Purpose Block, 2nd page)
Start Register 40, Number of Bytes to Read 32
This is the data that was returned. The Device Chemistry starts in the 24th byte. (0 is the first byte) The 04 is the number of bytes currently programmed and 4C 49 4F 4E are ASCII for LION
We want to change LION to PbA and PbA is 50 62 41 in ASCII. The new string will be:
Where 03 is the number of bytes.
You will also need to calculate the checksum. Add the 32 bytes of data in hexadecimal and inverse the bits on the last byte to find the checksum. The string adds up to 7DC. The inverse of the last byte is 23, so this will be entered with the 60 command. Here is the full process to read the initial data flash contents, enter the new data and read the data flash to verify that it is correct.