SLUA790 November   2016 BQ34110 , BQ34Z100-G1 , BQ35100

 

  1.   Using I2C Communications With the bq34110, bq35100, and bq34z100-G1 Series of Gas Gauges
    1.     Trademarks
    2. 1 Example 1: Reading Cell Voltage
    3. 2 Example 2: Reading the Firmware Version
      1. 2.1 Standard I2C Commands
      2. 2.2 Extended I2C Commands
      3. 2.3 Control Subcommands
      4. 2.4 Data Flash Access for the bq34z100-G1
    4. 3 Data Flash Access for the bq34110 and bq35100
    5. 4 Summary
    6. 5 Glossary: Control-Bit-Sequence Definitions

Data Flash Access for the bq34z100-G1

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.

fig09_slua790.pngFigure 9. Data Flash Access Commands to Read the Serial Number

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

inline_text01_slua790.png

We want to change LION to PbA and PbA is 50 62 41 in ASCII. The new string will be:

inline_text02_slua790.png

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.

fig10_slua790.pngFigure 10. Data Flash Access Commands to Change the Device Chemistry Value