
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
78
Revision 1.0, 2011-12-15
2.16.7
Execution Information
2.16.8
Code Example
Figure 11
Code example for usage of StopXtalOsc()
Table 77
StopXtalOsc: Execution Time and Charge Consumption
Parameter
Symbol
Values
Unit
Note / Test Condition
Min.
Typ.
Max.
Execution Time
t
–
20
22
µs
DIVIC = 00
H
Charge Consumption
Q
–
0,035
0,058
µC
DIVIC = 00
H
// Library function prototypes
#include
"SP37_ROMLibrary.h"
#include
"Reg_SP37.h"
// Defines
#define
bitmask_TMOD_CLK 0x08
#define
bitmask_RFS_RFSE 0x02
void main()
{
// Return value of stop xtal oscillator is stored in StatusByte
signed char StatusByte;
while (!(RFS & bitmask_RFS_RFSE));
// Wait for RF Transmission to end
RFC &= ~0x03;
// Disable PA & PLL
TMOD &= ~bitmask_TMOD_CLK;
// Clear TMOD_CLK
StatusByte = StopXtalOsc();
// Stop XTAL oscillator
if(StatusByte != -2){
// Xtal oscillator is stopped or was already off
}
}