SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide 56 Revision 1.0, 2011-12-15
2.7 Comp_Temperature()
2.7.1 Description
This function will convert a previously obtained raw temperature value into a compensated temperature value. This
function can be called after a pressure, acceleration or raw temperature measurement to compensate the raw
temperature. Thus, the current ambient temperature is obtained without taking an extra temperature
measurement.
2.7.2 Actions
• Compensate raw temperature data using calibration data stored in FLASH.
2.7.3 Prototype
unsigned char Comp_Temperature (signed int idata TempRawIn, signed int idata * TempResult)
2.7.4 Inputs
2.7.5 Outputs
Table 38 Comp_Temperature: Input Parameters
Register / Address Type Name Description
R6(MSB),
R7(LSB)
signed int
idata
TempRawIn Raw measurement value (gathered from
Meas_Pressure() or Meas_Acceleration() or
Raw_Temperature)
R5 signed int
idata*
Temp_Result Pointer to an integer array in RAM to receive the
measurement result
Table 39 Comp_Temperature: Output values
Register/ Address Type Name Description
R7 unsigned char StatusByte 0000.0000
B
: Success
xxxx.xxx1
B
: Underflow of Result
xxxx.xx1x
B
: Overflow of Result
*Temp_Result 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)
*Temp_Result+1 signed int Raw Temperature 16 Bit scaled signed ADC Result Value