English
Language : 

MLX75031 Datasheet, PDF (61/67 Pages) Melexis Microelectronic Systems – Optical Gesture & Proximity Sensing IC
MLX75031
Optical Gesture & Proximity Sensing IC
with Integrated LED Drivers
Datasheet
8.18. CRC Calculation
The 8-bit CRC calculation will be based on the polynomial x8+ x2+ x1+ x0. This polynomial is widely used in the
industry, it is e.g. used for generating:
• the Header Error Correction field in ATM (Asynchronous Transfer Mode) cells
• the Packet Error Code in SMBus data packets
Some probabilities of detecting errors when using this polynomial:
• 100% detection of one bit errors
• 100% detection of double bit errors (adjacent bits)
• 100% detection of two single-bit errors for frames less than 128 bits in length
• 100% detection of any odd number of bits in error
• 100% detection of burst errors up to 8 bits
• 99.61% detection of any random error
A possible hardware implementation using a Linear Feedback Shift Register (LFSR) is shown in the figure
below:
Figure 20 : 8-bit CRC implementation using a LFSR
The generation of the CRC requires the following steps:
Reset all flip-flops
0x00 is the initial value, shifting in all zeroes does not affect the CRC
Shift in the read-out data bytes. First byte is Data Byte 1 (= Internal Status Flags),
last byte is Data Byte (X+1) (with X defined in Figure 12).
When the last byte has been shifted in, the flip-flops contain the CRC: CRC=FF[8..1].
An easy method to check if there were no transmission errors is to calculate the CRC of the whole read-out
data stream including the CRC Byte. When the calculated CRC results in 0x00, the transmission was most
likely error free. If the resulting CRC is not equal to zero, then an error occurred in the transmission and the
complete data stream should be ignored.
Some CRC results for example messages are given in Table 25.
ASCII String messages
CRC result
-None-
0x00
"A"
0xC0
"123456789"
0xF4
a string of 256 upper case
"A" characters with no line breaks
0x8E
Table 25 : CRC examples
REVISION 001 – JANUARY, 2013
39010xxxxx
Page 61 of 61