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.

BQ27542-G1: Problems reading the BlockDataCheckSum and writing to BlockData.

Part Number: BQ27542-G1
Other Parts Discussed in Thread: BQSTUDIO

Hello,

I am working on bq27542-G1 FUEL GAUGE, interfacing it through I2C with my MCU.

I am refering essentially to bq27542-G1 TRM:  link.

In order to calibrate the FUEL GAUGE, I need to read the BlockData (from 0x40 to 0x5F) and also the BlockDataCheckSum (0x60) to set new parameters to the Data Flash but I am facing problems with that:

to read the 32 block Data bytes am following these steps:

*Enter Calibration Mode.

*Send  0x40

*Read 32 bytes

I get my 32 bytes and checksum calculation gives (0xDC), however the checksum read from (0x60) adress is (0x0C) which is the first byte of my 32 block Data bytes previously returned from the FUEL GAUGE.

+Checksum is (FF– x) where x is the 8-bit summation of the BlockData() (0x40 to 0x5F) on a byte-by-byte basis.

I am sure that I have a problem reading the checksum from (0x60) address or the whole BlockData  from (0x40) address.

Is there a problem with my methoid reading Data from the BQ27542-G1 ?

Is there any other reference documents about  BQ27542-G1 explaining in a better way writing and reading data from Data Flash ?

Kind Regards,

Bayram

  • Hi Bayram,

    Please refer to the I2C app note for this device found here: www.ti.com/.../slua467b.pdf

    The summary is extremely helpful:

    1. Handshaking between the host and gauge is performed by five bit sequences: START, REPEAT START, ACKNOWLEDGE, NO ACKNOWLEDGE, and STOP.

    2. The I2C address and read/write bit is the first data item sent at the beginning of an I2C packet transmission. The I2C address must not be mistaken for the command address in the gauge, the latter being the second data field to be transmitted by the host.

    3. The host initiates all communication to the gauge and uses the WRITE directive at the end of the I2C address (total byte is 0xAA). When followed by the gauge command, this sets the command address from which the host writes or reads gauge data.

    4. When reading or writing multiple bytes, the host should use the base-address auto-increment feature of the gauge, rather than specifying the gauge address location each time a byte is transferred.

    5. Whether command address or gauge data, all I2C data is transferred between host and gauge with the least-significant byte first.

    6. All bytes transferred between host and gauge is transferred most-significant bit first.

    Please also refer to this example of block read: e2e.ti.com/.../subclass_5F00_read_5F00_instruction_5F00_new.pdf

    Sincerely,
    Bryan Kahler
  • Hi Bayram,

    If the above response helped resolve your question, please click on the 'This Resolved my Issue' button below to improve the find-ability of this response for others that may have the same issue. Thanks!

    Sincerely,
    Bryan Kahler

  • Hi Bryan,

    I am sorry to give my feedback late because of some other issues, but I still have the same problem even after the above post.

    BR,

    Bayram ZAYET 

  • Hi Bayram,

    Please calibrate the gauge using bqStudio with a logic analyzer attached do you data lines. Please compare the output from bqStudio calibration to your custom code and share the logs from the logic analyzer for both the BqStudio calibration and custom code calibration implementation here for further analysis.

    Sincerely,
    Bryan Kahler