English
Language : 

TLE4998S3C Datasheet, PDF (35/36 Pages) Infineon Technologies AG – Programmable Linear Hall Sensor
TLE4998S3C
SENT Output Definition (SAE J2716)
12.3
Checksum Nibble Details
The Checksum nibble is a 4-bit CRC of the data nibbles including the status nibble. The
CRC is calculated using a polynomial x4 +x3 + x2 + 1 with a seed value of 0101.
In the TLE4998S3C it is implemented as a series of XOR and shift operations as shown
in the following flowchart:
Pre-initialization :
GENERATOR = 1101
SEED = 0101 , use this
constant as old CRC
value at first call
CRC calculation
next Nibble
Nibble
VALUE
xor
SEED
<<1
VVAALULUEExor 0
xorSSEEEEDD
4x
xor only if MSB = 1
GENPOLY
Figure 12 CRC Calculation
A microcontroller implementation may use an XOR command plus a small 4-bit lookup
table to calculate the CRC for each nibble.
// Fast way for any µC with low memory and compute capabilities
char Data[8] = {…}; // contains the input data (status nibble , 6 data nibble , CRC)
// required variables and LUT
char CheckSum, i;
char CrcLookup[16] = {0, 13, 7, 10, 14, 3, 9, 4, 1, 12, 6, 11, 15, 2, 8, 5};
CheckSum= 5; // initialize checksum with seed "0101"
for (i=0; i<7; i++) {
CheckSum = CheckSum ^ Data[i];
CheckSum = CrcLookup[CheckSum];
}
; // finally check if Data [7] is equal to CheckSum
Figure 13 Example Code for CRC Generation
Data Sheet
35
Rev 1.1, 2009-09