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.

BQ27510-G3: Issue with checksum

Part Number: BQ27510-G3

Hi Team,

One of our customer is using BQ27510-G3 and getting error in checksum, attached is the programming sequence followed. Can you please review the same and help with your expert comments.

Writing into BQ27510 data flash.docx

Regards, Shinu Mathew.

  • In Step 6, what data do you write to 0x42? With your setup (subclass 0x22, block 0) locations 0x42 and 0x43 hold the charging voltage (in big endian format). Your doc just shows I2C->write(0x42) but it doesn't show the actual value.

    Step 7 writes 0x68 but it is not clear if this is data or address? Let's assume it is data and Step 6 and Step 7 mean you want to write the Charging Voltage. If we want to set this to 4200mV (=0x1068), we'll have to execute:

    I2C->write(0x42, 0x10); MSB first

    I2C->write(0x43, 0x68); LSB last

    Before you write these two values you should read the old values (read from address 0x42 and 0x43) and the old check sum (read from address 0x60). You need these values to calculate the new check sum.

    After writing these two values, we'll have to calculate the check sum:

    temp = mod(255 – OLD_checksum – OLD_MSB - OLD_LSB, 256)

    NEW_checksum = 255 – mod(temp + NEW_MSB (0x10) + new_LSB (0x68), 256)

    Then you must write NEW_checksum to 0x60. If this was correct, the gauge will ACK and copy the new data from its temporary buffer into its working data memory.

  • Hi Dominik,

    Thanks for the reply.

    Yes, In step 7 we are writing actual value which is 0x68, and reading old value, according to old value only we have calculated new checksum and writing new checksum at 0x60 location.. but is not getting change.

    What will be the possible reasons for this issue.

    Regards, Shinu Mathew.
  • The gauge will not take the new check sum if it doesn't match the expected check sum for the whole block. So something went wrong calculating the check sum.

    Please attach a corrected version of the communications protocol (based on my previous reply) and I'll analyze your procedure.

  • Hi Dominik,

    Tried two to three methods to calculate checksum for cross verification, in all method got same answer,

    In 1st method tried to calculate new checksum using old checksum (As given in TRM) using formula,
    In 2nd method read data from the whole block (address from 0x40 to 0x5F) and then did summation of it (Assume the LSB of summation is x) so, the checksum is (FF - x) and then replaced the value in the address and then calculated checksum.

    For both of the method got same answer for the new checksum.

    Regards, Shinu Mathew.
  • Please add the exact sequence and I will analyze it.