JAJSVI4 October 2024 ADS127L21B
PRODUCTION DATA
The SPI cyclic redundancy check (CRC) is an SPI check code used to detect transmission errors to and from the host controller. An input CRC byte is transmitted with the input data on SDI by the host and a CRC byte is transmitted with the output data on SDO/DRDY by the ADC. The SPI CRC error check is enabled by the SPI_CRC bit of the CONFIG3 register.
The CRC code is calculated by the host on the two 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 input command bytes. If the CRC codes do not match, the command is not executed and the SPI_ERR bit is set in the STATUS byte. 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 SPI frame of a register read command.
The number of bytes used to calculate the output CRC code depends on the amount of data bytes transmitted in the frame. All data bytes that precede the output CRC code are used in the CRC calculation. Table 7-18 shows the number of bytes used for the output CRC calculation.
BYTE COUNT | BYTE FIELD DESCRIPTION |
---|---|
2 | 16 bits of conversion data |
2 | One byte of register data + 00h pad byte |
3 | 16 bits of conversion data + STATUS byte |
3 | 24 bits of conversion data |
3 | One byte of register data + two 00h pad bytes |
4 | 24 bits of conversion data + STATUS byte |
4 | One byte of register data + three 00h pad bytes |
The CRC value is the 8-bit or 16-bit remainder of a bitwise exclusive-OR (XOR) operation of the variable length argument with the CRC polynomial. The ADS127L21B uses 8-bit and 16-bit CRC lengths depending on the CRC function. An 8-bit CRC is used for SPI, main program memory, and IIR filter coefficients. 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.
A 16-bit CRC is used exclusively for the 128 FIR filter coefficients. The 16-bit CRC is based on the CRC-16-IBM polynomial: X16 + X15 + X2 + 1. The 17 coefficients are 1 10000000 00000101.
The following procedure computes the CRC value: