English
Language : 

TLE4998C8D Datasheet, PDF (27/28 Pages) Infineon Technologies AG – High Performance Programmable Dual Linear Hall Sensor
TLE4998C8D Grade1
SPC Output Definition
9.2.5 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 TLE4998C8D Grade1 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
VVAALLUUEExor
xorSSEEEEDD
0
4x
xor only if MSB = 1
GENPOLY
Figure 9-6 CRC Calculation
A micro controller 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 9-7 Example Code for CRC Generation
Technical Product Description
27
Revision 1.0, 2014-05-21