
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
66
Revision 1.0, 2011-12-15
2.11
Get_Supply_Voltage()
2.11.1
Description
Get_Supply_Voltage() is the third part of a set of three functions to measure the battery voltage during RF
transmission. It reads the measured value obtained during Trig_Supply_Voltage(), turns off the ADC, and
performs battery voltage compensation. Typically this function is called by the application after the RF
transmission is finished.
2.11.2
Actions
•
Read the ADC result register
•
Turn off ADC
•
Compensate the result for offset using calibration data stored in FLASH
2.11.3
Prototype
unsigned char
Get_Supply_Voltage
( signed int idata *
Batt_Result
)
2.11.4
Inputs
2.11.5
Outputs
Table 54
Get_Supply_Voltage: Input Parameters
Register / Address
Type
Name
Description
R7
signed int
idata*
Batt_Result
Pointer to an integer array in RAM to receive the
measurement result
Table 55
Get_Supply_Voltage: 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
*Batt0
signed int
Compensated
battery voltage
8000
H
= -4096.0 mV (Only theoretical number)
0000
H
= 0.0 mV
7FFF
H
= 4095.875 mV
( = 4096 mV - 1 LSB where 1 LSB = 1/8 mV)
*Batt1
signed int
Raw battery voltage 10 Bit ADC Result Value:
0000.00xx.xxxx.xxxx
B