
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
115
Revision 1.0, 2011-12-15
2.35
HIRC_Clock_Check()
2.35.1
Description
This function measures the frequency of the 12 MHz RC Oscillator, using the crystal oscillator as a measurement
standard. It evaluates whether the 12 MHz RC Oscillator is working in the specified range (see
The crystal oscillator is automatically started, if not already enabled, and allowed a fixed startup time of
approximately 2.5ms (five 2 kHz RC LP Oscillator periods). The crystal frequency 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 is assumed
for the checking. Before the function returns the previous clock settings are restored.
2.35.2
Actions
•
Check the frequency of the 12 MHz RC Oscillator using the crystal oscillator as measurement standard
2.35.3
Prototype
signed char
HIRC_Clock_Check
(void)
2.35.4
Inputs
2.35.5
Outputs
Table 149
HIRC_Clock_Check: Input Parameters
Register / Address
Type
Name
Description
None
---
---
---
Table 150
HIRC_Clock_Check: Output values
Register/ Address
Type
Name
Description
R7
signed char
Statusbyte
0: success
-1: 12 MHz RC Oscillator out of specified range
-2: No valid crystal frequency found in FLASH
(12 MHz RC Oscillator in specified range for
default crystal frequency)
-3: No valid crystal frequency found in FLASH
(12 MHz RC Oscillator out of specified range for
default crystal frequency)