
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
83
Revision 1.0, 2011-12-15
2.19
IntervalTimerCalibration()
2.19.1
Description
This function initiates a calibration of the Interval Timer precounter (ITPL and ITPH) to obtain a specific interval
timer timebase between 1Hz and 20Hz. The function can work with both clock sources (12MHz RC Clock and
Crystal clock), utilizing a special timer mode.
Note: To obtain the best possible Interval Timer accuracy, this function should be called after the crystal oscillator
has already been enabled.
In case the crystal oscillator is used the crystal frequency in Hz divided by 2 has to be stored in the FLASH user
configuration sector at address 57FA
H
(MSByte) to 57FC
H
(LSByte). If the value found at this FLASH location is
not within the range of 9 MHz to 10 MHz a default clock frequency of 9.843750 MHz (XTAL/2 for 315 MHz carrier)
is assumed for the tuning.
In addition, this function automatically calibrates the LF On/Off Timer precounter (SFR LFOOTP) to 50 ms.
2.19.2
Actions
•
Calibrate the interval timer precounter (SFR ITPL, SFR ITPH) to the value passed in WU_Frequency
•
Calibrate the LF On/Off Timer precounter (SFR LFOOTP) to 50 ms
2.19.3
Prototype
signed char
IntervalTimerCalibration
(unsigned char
WU_Frequency
)
2.19.4
Inputs
Table 85
IntervalTimerCalibration: Input Parameters
Register / Address
Type
Name
Description
R7
unsigned char WU_Frequency
Base frequency of the interval timer precounter
[Hz]
1dec: 1 Hz (precounter time ~1000 ms)
2dec: 2 Hz (precounter time ~500 ms)
...
19dec: 19 Hz (precounter time ~53 ms)
20dec: 20 Hz (precounter time ~50 ms)