I have SPI communication with the chip in question.
https://ww1.microchip.com/downloads/en/DeviceDoc/MCP3561.2.4R-Data-Sheet-DS200006391A.pdf
According to the datasheet, section 6.5, after reading my 6 SDO bytes, last 16 bits being the checksum, the CRC16 of those 6 bytes will be 0x0000 when there is no error.
I tried comparing the CRC16 and I expected it to be 0x0000
The initialization value for the checksum was not specified on the datasheed
Here is a small dump using 0x0000 to initialize the CRC value
13 c8 ef ff 90 b5 crc16 0x204a
13 cb ef ff 90 bf crc16 0x278e
13 ca ef ff 10 ba crc16 0x2412
13 c6 ef ff 10 92 crc16 0x3b02
13 c8 ef ff 90 b5 crc16 0x204a
13 c5 ef ff 10 98 crc16 0x3cc6
13 ca ef ff 10 ba crc16 0x2412
13 c9 ef ff 10 b0 crc16 0x23d6
13 f1 ef ff 90 23 crc16 0x4b56
13 ea 7c ff fa 73 crc16 0x9131
Here is a small dump using 0xFFFF to initialize the CRC value
13 c2 ef ff 90 89 crc16 0x2bd2
13 bd ef ff 11 88 crc16 0x7166
13 bf ef ff 91 87 crc16 0x753e
13 bc ef ff 91 8d crc16 0x72fa
13 bc ef ff 91 8d crc16 0x72fa
13 bb ef ff 11 9c crc16 0x7eee
13 ca ef ff 10 ba crc16 0x3f12
13 c7 ef ff 90 97 crc16 0x239e
13 cc ef ff 10 ae crc16 0x309a
13 cc ef ff 10 ae crc16 0x309a
Here is a description for each of the 6 bytes
0 : statusByte
1 : 24 bit high byte
2 : 24 bit middle byte
3 : 24 bit low byte
4 : CRC16 high byte
5 : CRC16 low byte
Claude CPP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.