FXTH87xx11 and FXTH87xx12 Embedded Firmware User Guide, Rev. 2.1
12
Freescale Semiconductor, Inc.
Firmware Functions
•
Input Parameters:
— None
•
Returns:
— void
3.2.2
UINT8 TPMS_READ_VOLTAGE(UINT16 *u16UUMA)
•
Description:
Performs a 10-bit uncompensated voltage measurement and places it in the UUMA.
While waiting for the ADC to converge, this function goes into STOP4. If the ADC, for an
unexpected reason, fails to converge, this function has a built-in time-out: After five continuous
non-ADC interrupts, the function will assume a failed ADC reading, flag it accordingly, and exit.
— If the ADC value is over or under the normal operating condition, the “voltage error” status flag
will be set. The expected voltage result will be forced to either “0” or “1023.” (rail high or rail
low).
— If the ADC times out with no result, the “ADC error” status flag will be set.
— Measurements below 2.1 V are not guaranteed for accuracy.
•
Stack size:
22 bytes
•
Approx. Duration:
102 usec
•
Power Management:
This function requires the core to be configured for STOP4 mode and
running at full bus speed.
•
Interrupt Management:
This function utilizes the ADC interrupt to wake-up from STOP mode.
•
Resources:
ADC, bandgap.
•
Input Parameters:
— UINT16 *u16UUMA: Pointer to Universal Uncompensated Measurement Array (as described
). Only the 10-bit uncompensated voltage result will be updated.
•
Returns
:
— UINT8 u8Status: Valid error flags/outputs are described in
WARNING
The Bandgap bit (BIT0 in the SPMSC1 register) must be set prior to calling
this function for results to be valid.
Table 8. Valid output conditions for TPMS_READ_VOLTAGE
u8Status Value
Measurement Value
Condition
$20
$03FF
Uncompensated voltage reading outside of valid range (high).
$20
$0000
Uncompensated voltage reading outside of valid range (low).
$80
Undefined
Uncompensated voltage reading not acquired.
$00
Between $0001 - $03FE
Valid uncompensated voltage reading.