Hello, TI
I have an ADS124S08 that I'm working to implement into a larger project. I have a few things I want to measure with it, but for now, I'm playing with measuring an RTD. I'm getting what I think are good readings, but the CRC doesn't line up with what I'm getting.
I'll use a reading I got yesterday as an example. When measuring a 100-ohm resistor, the reading 0x32,0x33,0xaa,0x62. The first three is about what I expected, but when I tried doing CRC on that value, I got 0xAE as a checksum value, not 0x62. I put the calculation I did at the bottom of this post in full, but basically, I
concatenated the first three bytes, and left shifted them by 8, adding trailing zeros.
lined up the divisor indicated in the ADS124S08 documentation, 100000111, with the most significant 1 in the data.
Xor'd the data with the divisor.
Moved the divisor to the next most sigificant 1 bit, and repeated until the data was less than 100000000.
I'm assuming that the chip is Sending the CRC correctly, and I'm doing the algorithm wrong, but I can't seem to find my mistake. And I don't think it's an arithmetic error, this happened on multiple readings, so I must be doing something systematically wrong.
If anyone can help me understand this algorithm, I would greatly appreciate it.
Original reading (left-shifted by 8) | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | |||||||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | ||||||||||||||||||
divisor | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||
remainder | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | ||||||||||||||||||||||
Remainder is now smaller than the divisor, so the CRC is 01011110, or 0xAE. |