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.

ADS131A0x Checksum/Hamming code

Hello,

I am unable to implement 2 bit checksum algorithm meant in hamming code verification mode in page 39 of the part datasheet. I have tested algorithm according data from ADS and my hamming code is corret, but I cannot find any correct checksum.

Ondrej Jezek

  • Hello Ondrej,

    Those checksum bits are simply the modulo of the sum of the bits in the data word with 4.

    For example, if you had a 24-bit data word of 0xC05F21, you would simply sum the binary 1's in the word totaling d'10 . Then calculate d'10 modulo d'4 which is d'2. The checksum in this case is b'10.

    If you want to accomplish this in software, it would require a function that loops through a data word, logically counts 1's, and modulo's the sum with 4. For transmissions, the complexity may be reduced by creating a lookup table of all possible transmissions with their checksums (and hamming codes or CRC's, for that matter).

    If you are implementing this algorithm in an FPGA, you can create an adder with 24 single bit inputs corresponding to the bits in the data word a 2-bit output with no carry.

    Regards,
    Brian Pisani