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.

TLV320ADC6120: What is the algorithm for the I2C checksum value?

Part Number: TLV320ADC6120

Tool/software:

Hi, 

I am trying to check if the I2C configuration of the ADC is correct by reading out the checksum value. I can read the value without problem following the documentation of the ADC, however, the documentation does not describe, what algorithm is used to create the checksum value. 
Where can I find the algorithm, to decode the checksum value? 

Thanks! 

  • Hi Gergley,

    Let me get back to you on this thread with an update by the end of this week.

    Thanks and Regards,

    Lakhsmi Narasimhan

  • Hi Gergely,

    The I2C Checksum works as follows:
    1) Consider the current value of the checksum register (B0_P0_R126) be I2C_CKSUM[7:0], an 8-bit value.
    2) If we are writing a value reg_data[7:0] into any register, the checksum updates to a value I2C_CKSUM_NEW[7:0] as follows:


    I2C_CKSUM_NEW[7] = I2C_CKSUM[5] ^ I2C_CKSUM[6] ^ I2C_CKSUM[7] ^ reg_data[5] ^ reg_data[6] ^ reg_data[7]
    I2C_CKSUM_NEW[6] = I2C_CKSUM[4] ^ I2C_CKSUM[5] ^ I2C_CKSUM[6] ^ reg_data[4] ^ reg_data[5] ^ reg_data[6]
    I2C_CKSUM_NEW[5] = I2C_CKSUM[3] ^ I2C_CKSUM[4] ^ I2C_CKSUM[5] ^ reg_data[3] ^ reg_data[4] ^ reg_data[5]
    I2C_CKSUM_NEW[4] = I2C_CKSUM[2] ^ I2C_CKSUM[3] ^ I2C_CKSUM[4] ^ reg_data[2] ^ reg_data[3] ^ reg_data[4]
    I2C_CKSUM_NEW[3] = I2C_CKSUM[1] ^ I2C_CKSUM[2] ^ I2C_CKSUM[3] ^ I2C_CKSUM[7] ^ reg_data[1] ^ reg_data[2] ^ reg_data[3] ^ reg_data[7]
    I2C_CKSUM_NEW[2] = I2C_CKSUM[0] ^ I2C_CKSUM[1] ^ I2C_CKSUM[2] ^ I2C_CKSUM[6] ^ reg_data[0] ^ reg_data[1] ^ reg_data[2] ^ reg_data[6]
    I2C_CKSUM_NEW[1] = I2C_CKSUM[0] ^ I2C_CKSUM[1] ^ I2C_CKSUM[6] ^ reg_data[0] ^ reg_data[1] ^ reg_data[6]
    I2C_CKSUM_NEW[0] = I2C_CKSUM[0] ^ I2C_CKSUM[6] ^ I2C_CKSUM[7] ^ reg_data[0] ^ reg_data[6] ^ reg_data[7]


    with ^ indicating bitwise XOR operation.


    The following register is not considered in this checksum computation:
    Register 0 of all pages, which is the page switch register


    When a SW/HW reset is done, the I2C_CKSUM register reverts to a default value of 0x00

    Thanks and Regards,

    Lakhsmi Narasimhan

  • Hi Lakhsmi,

    Thank you for your answer. I tried it out, and it works. 



    Best regards, 

    Gergely Kiss