
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
51
Revision 1.0, 2011-12-15
2.5
Meas_Temperature()
2.5.1
Description
This function performs a temperature measurement and returns both raw and compensated temperature results.
The Compensated Temperature result is compensated for sensitivity and offset errors. The Raw Temperature
result is uncompensated and may be used as input for
and
.
2.5.2
Actions
•
Measures the temperature sensor with 2 ADC samples for averaging (arithmetic mean).
•
Compensate for offset using calibration data stored in FLASH (Compensated Temperature)
2.5.3
Prototype
unsigned char
Meas_Temperature
( signed int idata *
Temp_Result
)
2.5.4
Inputs
2.5.5
Outputs
Table 30
Meas_Temperature: Input Parameters
Register / Address
Type
Name
Description
R7
signed int
idata*
Temp_Result
Pointer to an integer array in RAM to receive the
measurement result
Table 31
Meas_Temperature: Output values
Register/ Address
Type
Name
Description
R7
unsigned char StatusByte
0000.0000
B
: Success
xxxx.xxx1
B
: Underflow of ADC Result
xxxx.xx1x
B
: Overflow of ADC Result
xxx1.xxxx
B
: VMIN warning
*Temp0
signed int
Compensated
Temperature
8000
H
= -256.0 °C
0000
H
= 0.0 °C
7FFF
H
= 255.9921875 °C
( = 256 °C - 1 LSB where 1 LSB = 1/128 °C)
*Temp1
signed int
Raw Temperature
16 Bit scaled signed ADC Result Value