Error checking of data is supported with a Checksum Calculation. The 8-bit CRC checksum transmitted after each data word is generated by a CRC algorithm. Table 8-1 shows the CRC properties. The CRC covers the contents of the two previously transmitted data bytes. To calculate the checksum, only these two previously transmitted data bytes are used.
A CRC byte is sent by the HDC302x to the I2C controller in the following cases:
- Following the transmission of a relative humidity measurement
- Following the transmission of a temperature measurement
- Following the transmission of the contents of the Table 8-12
- Following the transmission of any of the programmed ALERT limit values (High Alert, Set; High Alert, Clear; Low Alert, Set; Low Alert, Clear)
A CRC byte must be sent by the I2C controller to the HDC302x in the following cases:
- Following the configuration of any of the ALERT limit values (High Alert, Set; High Alert, Clear; Low Alert, Set; Low Alert, Clear).
Table 8-1 HDC302x CRC Properties
|Protected Data||Read and/or Write Data|
|Polynomial||0x31 (x8 + x5 + x4 + 1)|
|Examples||CRC of 0xABCD = 0x6F|
Retrieving the CRC byte from the HDC302x is optional. A NACK can be issued by the I2C controller prior to reception of the CRC byte to cancel, as shown in Figure 8-1 and Figure 8-2.
Figure 8-1 Example I2C NACK to Discard CRC Byte Corresponding to Humidity Measurement Readout Figure 8-2 Example I2C NACK to Discard CRC Byte Corresponding to Temperature Measurement Readout