
Firmware Functions
FXTH87xx11 and FXTH87xx12 Embedded Firmware User Guide, Rev. 2.1
Freescale Semiconductor, Inc.
27
3.2.19
UINT8 TPMS_LFOCAL(void)
•
Description:
Performs PWU clock calibration. The wake-up and periodic reset time can be
calibrated more accurately by using the TPMS_LFOCAL firmware subroutine. This subroutine
turns on the RFM crystal oscillator and feeds a 500-Hz clock via the DX signal to the TPM1 for
one cycle of the LFO. The measured time is used to calculate the correct value for the
WDIV0:5-bits for a WCLK period of 1 second. The resulting value for use in the WDIV0:5-bits is
returned in the accumulator. The user can decide whether to load the value to the WDIV0:5-bits or
store for future reference. The TPMS_LFOCAL subroutine cannot be used while the RFM is
transmitting or the TPM1 is being used for another task. This routine will also consume more
power due to the crystal oscillator running. This function accesses and writes data to the
SIMOPT2
register. Since some of the bits in this register are write-once-only, it should be configured prior to
calling this routine.
•
Stack size:
9 bytes
•
Approx. Duration:
1747 usec
•
Power Management:
This function executes entirely in RUN mode.It requires the MCU to be
configured for 4 MHz bus clock.
•
Interrupt Management:
This function does not await any interrupts. It
WILL
be affected by
interrupts.
•
Resources:
TPM, SIMOPT2, RFM
•
Input Parameters:
— None
•
Returns
:
— UINT8 u8WDIV: WDIV compensated value.
WARNING
This routine writes to
SIMOPT2
. Any configuration involving this register
must be performed before calling this routine.
3.2.20
UINT8 TPMS_MFOCAL(void)
•
Description:
Performs MFO cross-check verification. This function will measure the bus clock
relative to Dx, but first executes a test to verify the presence of the external XTAL. When error is
zero, it returns “128.” Any deviation from this value should be considered an error. This result can
then be used to estimate the error in the RFBT setting. The TPMS_MFOCAL subroutine cannot be
used while the RFM is transmitting or the TPM1 is being used for another task. This function
accesses and writes data to the
SIMOPT2
register. Since some of the bits in this register are
write-once-only, it should be configured prior to calling this routine.
•
Stack size:
9 bytes
•
Approx. Duration:
1825 usec
•
Power Management:
This function executes entirely in RUN mode. It requires the MCU to be
configured for 4 MHz bus clock.