
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
59
Revision 1.0, 2011-12-15
2.8
Meas_Supply_Voltage()
2.8.1
Description
This function performs a battery voltage measurement and returns both raw and compensated voltage results. The
compensated battery voltage result is compensated for offset error.
2.8.2
Actions
•
Measure the supply voltage sensor with 2 ADC samples for averaging
•
Compensate for offset using calibration data stored in FLASH
2.8.3
Prototype
unsigned char
Meas_Supply_Voltage
( signed int idata *
Batt_Result
)
2.8.4
Inputs
2.8.5
Outputs
Table 42
Meas_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 43
Meas_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