1.5 Cyclic Redundancy Check

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. See “Reference, 2” for more information on CRC.

Two different CRC’s are commonly found in 1-Wire devices. One 8-bit CRC (Dallas One Wire CRC, DOW-CRC, or simply CRC8) and one 16-bit CRC (CRC16). CRC8 is used in the ROM section of all devices. CRC8 is also, in some devices, used to verify other data like commands issued on the bus. CRC16 is used by some devices to check for errors on larger data sets.

The hardware equivalent of the 8-bit CRC used on the 64-bit identifier is shown in the first figure below. The blocks represent the individual bits in an 8-bit shift register. The equivalent CRC polynomial is X8+X5+X4+1.

Figure 1-11. Hardware Equivalent of an 8-bit CRC used in 1-Wire Devices

The hardware equivalent of the 16-bit CRC used in some 1-Wire devices is shown in the figure below. The blocks represent the individual bits in a 16-bit shift register. The equivalent polynomial is X16+X15+X2+1.

Figure 1-12. Hardware Equivalent of a 16-bit CRC used in 1-Wire Devices