SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide 112 Revision 1.0, 2011-12-15
2.33.7 Execution Information
2.33.8 Code Example
Figure 13 Code example for usage of the functions ECC_Check() and CRC16_Check()
Table 144 ECC_Check: Execution Time and Charge Consumption
Parameter Symbol Values Unit Note / Test Condition
Min. Typ. Max.
Execution Time
t – 6 7 µs DIVIC = 00
H
Charge Consumption Q – 0,009 0,016 µC DIVIC = 00
H
// Library function prototypes
#include "SP37_ROMLibrary.h"
void main()
{
// Return value of ECC check is stored in StatusByte
unsigned char StatusByte;
// ECC check function call to reset the ECC check function
StatusByte = ECC_Check();
// CRC16 check function call to test User Data Sector
StatusByte = CRC16_Check(0x5780,0x80);
// ECC check function call
StatusByte += ECC_Check();
if(!StatusByte){
// Both ECC and CRC16 check were successful
}
else{
// ECC and or CRC16 check was not successful
}
}