This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ27220: BQ27220 update fuel gauge

Part Number: BQ27220

Dear sir,

 

We are facing some issue to get TI BQ27220 fuel gauge to work.

In BQ27220 TRM Page 65/88 Application example, we need to update “Data_len” at step 13. How to calculate this “Data_len”? Is it the same value read at step 8 or we need to calculate it based on the intermediate steps 9 to 12?

 

 

 

 

2. I saw the link at https://e2e.ti.com/support/power_management/battery_management/f/180/p/606723/2252474#2252474

Can any expert confirm if the #1. Data transfers MUST fill and transfer the whole MACData buffer (32 bytes) in a read-modify-write set of operations.  Partial transfers (like the example above with a length of 0x05) do not work?

 

Best regards,
kpk

  • Data_len equals the number of bytes that you want to update plus 4.

    You do not have to transfer the whole 32 bytes buffer. Partial transfers do work. I just tried the following sequence successfully:

    An easy method to update a specific parameter is this sequence:

    1. Enter CFG_UPDATE mode
    2. Write the address AND the parameter data to 0x3E+ (auto increment)
    3. Calculate the check sum: 0xFF - (sum of address and data) OR 0xFF
    4. Write the check sum to 0x60 and the total length of (address + parameter data + check sum + length) to 0x61
    5. Exit CFG_UPDATE mode

    Example: Set OT Chg Time to 8 seconds:
    OT Chg Time address = 0x9234
    Data = 0x08

    2. write 0x34 0x92 0x08 to registers starting at 0x3E
    3. check sum = 0xFF - (0x34 + 0x92 + 0x08) OR 0xFF = 0xFF - 0xCE = 0x31
    4. write 0x31 to 0x60 and 0x05 (=2 bytes address, 1 byte data, 1 byte check sum, 1 byte length) to 0x61