SBASAE3 December 2025 ADS125H18
PRODUCTION DATA
The SPI cyclic redundancy check (CRC) is a check code used to detect transmission errors to and from the host controller. A CRC-IN byte is transmitted with the ADC input data by the host on SDI and a CRC-OUT byte is transmitted with the output data by the device on SDO. Use the SPI_CRC_EN bit to enable the SPI CRC. In addition, enable the transmission of the STATUS header using the STATUS_EN bit to get notified about any SPI input CRC faults.
The CRC-IN code is calculated by the host over the two command bytes. Any input bytes padded to the start of the frame are not included in the CRC-IN calculation. The ADC checks the input command CRC-IN code against an internal code calculated over the two received input command bytes. If the CRC-IN codes do not match, the command is not executed and the SPI_CRC_FAULTn bit is set to 0b in the STATUS_LSB byte.
The SPI_CRC_FAULTn bit is output as part of the STATUS header to provide immediate indication that a CRC error occurred in the previous frame. The SPI_CRC_FAULTn bit clears automatically in the next SPI frame, assuming there is no SPI CRC error in the current frame.
The number of bytes used to calculate the output CRC code depends on the amount of data bytes transmitted in the frame on SDO. Table 7-50 shows the number of bytes used for the output CRC calculation.
| ACTION | STATUS HEADER ENABLED | BYTE COUNT | BIT COUNT AND DESCRIPTION |
|---|---|---|---|
| Conversion data read | No | 3 | 24 bits of conversion data |
| Register data read | No | 3 | 8 bits of register data + 8 bits address byte + 8 bits of 00h padding |
| Conversion data read | Yes | 5 | 16 bits STATUS header + 24 bits of conversion data |
| Register data read | Yes | 5 | 16 bits STATUS header + 8 bits of register data + 8 bits address word + 8 bits of 00h padding |
The CRC code calculation is the 8-bit remainder of the bitwise exclusive-OR (XOR) operation of the variable length argument with the CRC polynomial. The CRC is based on the CRC-8-ATM (HEC) polynomial: X8 + X2 + X1 + 1. The nine coefficients of the polynomial are: 100000111. The CRC calculation is initialized to all 1s to detect errors in the event that SDI and SDO/DRDY are either stuck high or low.
Figure 7-46 shows a visual representation of the CRC calculation. The following procedure calculates the CRC value:
The example C code available for download here includes a potential CRC implementation.