Datasheet
CRC Generation
CRC bytes are provided as part of the device’s 64-bit
ROM code and in the 9th byte of the scratchpad memory.
The ROM code CRC is calculated from the first 56 bits
of the ROM code and is contained in the most significant
byte of the ROM. The scratchpad CRC is calculated
from the data stored in the scratchpad, and therefore
changes when the data in the scratchpad changes. The
CRCs provide the bus master with a method of data vali-
dation when data is read from the device. To verify that
data has been read correctly, the bus master must recal-
culate the CRC from the received data and then compare
this value to either the ROM code CRC (for ROM reads)
or to the scratchpad CRC (for scratchpad reads). If the
calculated CRC matches the read CRC, the data has
been received error free. The comparison of CRC values
and the decision to continue with an operation are deter-
mined entirely by the bus master. There is no circuitry
inside the device that prevents a command sequence
from proceeding if the device CRC (ROM or scratchpad)
does not match the value generated by the bus master.
The equivalent polynomial function of the CRC (ROM or
scratchpad)is:
CRC = X
8
+ X
5
+ X
4
+ 1
The bus master can recalculate the CRC and compare it
to the CRC values from the device using the polynomial
generator shown in
Figure 5. This circuit consists of a
shift register and XOR gates, and the shift register bits
areinitializedto0.Startingwiththeleastsignificantbitof
the ROM code or the least significant bit of byte 0 in the
scratchpad, one bit at a time should be shifted into the
shift register. After shifting in the 56th bit from the ROM
orthemostsignificantbitofbyte7fromthescratchpad,
the polynomial generator contains the recalculated CRC.
Next, the8-bitROM code orscratchpadCRC from the
device must be shifted into the circuit. At this point, if
the recalculated CRC was correct, the shift register
contains all 0s. Additional information about the Maxim
Integrated 1-Wire CRC is available in Application
Note27:
Understanding and Using Cyclic Redundancy Checks
with Maxim iButton® Products.
iButton is a registered trademark of Maxim Integrated
Products, Inc.
Table 2. Thermometer Resolution Configuration
Figure 5. CRC Generator
R1 R0 RESOLUTION (BITS) MAX CONVERSION TIME
0 0 9 93.75ms (t
CONV
/8)
0 1 10 187.5ms (t
CONV
/4)
1 0 11 375ms (t
CONV
/2)
1 1 12 750ms (t
CONV
)
1ST
STAGE
2ND
STAGE
3RD
STAGE
4TH
STAGE
7TH
STAGE
8TH
STAGE
6TH
STAGE
5TH
STAGE
X
0
X
1
X
2
X
3
X
4
POLYNOMIAL = X
8
+ X
5
+ X
4
+ 1
INPUT DATA
X
5
X
6
X
7
X
8
MAX31820 1-Wire Ambient Temperature Sensor
www.maximintegrated.com
Maxim Integrated
│
10