
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
95
Revision 1.0, 2011-12-15
2.25
CRC_Baicheva_Calc()
2.25.1
Description
This function calculates a 8-bit CRC checksum for a memory area in RAM using a fixed polynomial
(x
8
+x
5
+x
3
+x
2
+x+1). It supports the standardized TPMS data protocol from the German Association of the
Automotive Industry (VDA) and is optimal for data word length of 119 bits and below. The CRC Baicheva
calculation starts with a defined preload value. The VDA protocol requires that a preload value of AA
H
be used.
2.25.2
Actions
•
Calculate CRC Baicheva
2.25.3
Prototype
unsigned char
CRC_Baicheva_Calc
(unsigned char
Preload
, unsigned char idata *
BlockStart
, unsigned char
BlockLength
)
2.25.4
Inputs
2.25.5
Outputs
2.25.6
Resource Usage
Table 109
CRC_Baicheva_Calc: Input Parameters
Register / Address
Type
Name
Description
R7
unsigned char Preload
Preload Value for the CRC Calculation.
According to VDA protocol value AA
H
is used.
R5
unsigned char
idata*
BlockStart
Pointer to first Byte of the Data that is to be used
for calculating checksum.
R3
unsigned char BlockLength
Length in Bytes of Block that is used for
calculation of the checksum, starting with
*BlockStart.
Table 110
CRC_Baicheva_Calc: Output values
Register/ Address
Type
Name
Description
R7
unsigned char CRC_Result
Calculated CRC Baicheva checksum
Table 111
CRC8_Baicheva_Calc: Resources
Type
Used or Modified
Registers
R0, R3, R5, R6, R7