D6F-PH MEMS Differential pressure Sensor User’s Manual (A288)
16
・
Bit unit CRC-8 calculation method
1. The data bit sequence will be aligned in a line.
2. The polynomial bit string will be aligned under the line of the data bit sequence.
3. If the data bit above the leftmost the polynomial bit sequence is 0, the polynomial bit
sequence is shifted one bit to the right. If the data bit above the leftmost polynomial bit
sequence is 1, the data bit and the polynomial bit are calculated by XOR. Then the
polynomial bit sequence are shifted one bit to the right.
4. 1-3steps are repeated until the polynomial bit sequence reaches the right end of the data bit
sequence.
The following example shows how to calculate the CRC byte based on XOR calculation.
Fig.9 XOR operation example of CRC-8
1st Byte of data
hex
04h
02h
bin
100110001
00000010
00000100
225h
11100001
2nd Byte of data
Polynomial (x^8+ x^5+ x^4+ 1) 131h
CRC-byte checksum
Data bit sequence
0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
1 0 0 1 1 0 0 0 1
0 0 0 1 1 0 0 0 1 1 0 0
1 0 0 1 1 0 0 0 1
0 1 0 1 1 1 1 0 1 0
1 0 0 1 1 0 0 0 1
0 0 1 0 0 1 0 1 1 0 0
1 0 0 1 1 0 0 0 1
0 0 0 0 1 1 1 0 1 0 0 0 0
1 0 0 1 1 0 0 0 1
0 1 1 1 0 0 0 0 1
1st Byte of data
2nd Byte of data
P l
i l bit
Polynomial bit sequence
Summary of Contents for D6F-PH
Page 35: ......