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.

bq76940: Not clear how CRC version works

Part Number: BQ76940

If I could find the source code this sheet refers to I would not need to ask the question. 

http://www.ti.com/lit/an/slva626b/slva626b.pdf


When doing a block write we have 

<Slave Address + W> <Register> <Data1> <Crc1><Data2><Crc2><Data3><Crc3><Data4><Crc4>

I know that <Crc1> is the crc8 of <Slave Address + W> <Register> <Data1>

Is <crc2> the CRC of just <data2>? 

Is <crc3> the crc of <data3> or is it the crc of <Data2><Data3>?

Is <crc4> the crc of <data4> or is it the crc of <Data2><Data3><Data4>?



When doing a block READ we have 

<Slave Address + W> <Register> <RESTART> <Slave Address + R> <Data1> <Crc1><Data2><Crc2><Data3><Crc3><Data4><Crc4>

I know that Crc1 is the crc8 of <Slave Address + W> <Register>  <Slave Address + R> <Data1> 

Is <crc2> the CRC of just <data2>? 

Is <crc3> the crc of <data3> or is it the crc of <Data2><Data3>

Is <crc4> the crc of <data4> or is it the crc of <Data2><Data3><Data4>

I can not figure this out from the data sheet or this linked page. From the datasheet I could not tell there was a CRC for each data. I found that in the linked document.



Kip

  • Hi Kip,

    Apparently we realized the sample code was software and it was loaded to the Tools & software tab of the product folder, and no one knew.  Please see bq769x0 I2C Sample Code With CRC . I will see if the webpage experts can add a link with the application report.

    The CRC description in 7.3.1.4 of the bq76940 data sheet includes the sentence "The CRC for subsequent data bytes is calculated over the data byte only." for both write and read.  So the CRC will be on the preceding byte or ...<data4><crc4><data5><crc5>... 

    Hope this and the sample code link help.

  • Thanks,

    Yes. Your website search engine or Google could not find it.

    I also had another mistake.

    I said:
    When doing a block READ we have

    <Slave Address + W> <Register> <RESTART> <Slave Address + R> <Data1> <Crc1><Data2><Crc2><Data3><Crc3><Data4><Crc4>

    I know that Crc1 is the crc8 of <Slave Address + W> <Register> <Slave Address + R> <Data1>

    That is wrong should be:

    I know that Crc1 is the crc8 of <Slave Address + R> <Data1>



    Thanks,
    Kip