2.6 Cyclic Redundancy Check (CRC)

Cyclic Redundancy Check (CRC) is used by 1-Wire devices to ensure data integrity. The theory behind CRC is outside the scope of this document and will not be further discussed.

Two different CRCs are commonly found in 1-Wire devices, also found in the DS2433 data sheet:
  • One 8-bit CRC (Maxim’s 1-Wire CRC, DOW-CRC, or simply CRC8): Used in the ROM section of all 1-Wire devices; CRC8 is also in some devices used to verify other data, such as commands issued on the bus.
  • One 16-bit CRC (CRC16): Used by some devices to check for errors on bigger data sets.
CRC FunctionDescription
uint8_t crc8_maxim(uint8_t *data, uint8_t length)This function is used to compute CRC8
uint16_t crc16_maxim(uint8_t *data, uint8_t length)This function is used to compute CRC16