English
Language : 

MLX75030 Datasheet, PDF (61/72 Pages) Melexis Microelectronic Systems – Universal ActiveLight Sensor Interface
MLX75030 Universal ActiveLight Sensor Interface
Datasheet
7.8. 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 14: 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 24.
ASCII String messages
-None-
"A"
"123456789"
a string of 256 upper case
"A" characters with no line breaks
CRC result
0x00
0xC0
0xF4
0x8E
Table 24: CRC examples
REVISION 005 – DECEMBER 2013
3901075030
PAGE 61 OF 72