SBASAM0B March 2024 – November 2024 ADS127L18
PRODMIX
The SPI CRC is an SPI error check code that detects transmission errors to and from the SPI port. A CRC byte is transmitted with the ADC input data from the host. A CRC byte is transmitted with the register data from the ADC. The SPI CRC error check is enabled by the SPI_CRC_EN bit of the GEN_CFG3 register.
The SPI CRC argument is two bytes. The CRC-In code is calculated over the two input command bytes. Any input bytes padded to the start of the frame are not included in the CRC calculation. The ADC checks the input command CRC code against an internal code calculated over the two received bytes. If the CRC codes do not match, the command is not executed and the SPI_ERR bit is set in the STATUS byte. Further register write operations are blocked except to the STATUS register to allow clearing the SPI CRC error by writing 1b to the SPI_ERR bit. Register read operations are not blocked unless an SPI_CRC error is detected in the immediately preceding register read command frame.
The CRC-Out code is calculated over the output register data byte and the STATUS byte. If STATUS is disabled, the byte is treated as zero for CRC-Out calculation purposes.
The CRC value is the 8-bit remainder of a bitwise exclusive-OR (XOR) operation of the variable-length argument with the CRC polynomial. The 8-bit CRC is based on the CRC-8-ATM (HEC) polynomial: X8 + X2 + X1 + 1. The nine coefficients of the polynomial are: 1 00000111.
The following procedure computes the CRC value: