
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
42
Revision 1.0, 2011-12-15
2.3
Scale_Pressure()
2.3.1
Description
A 450 kPa range TPMS sensor will typically transmit the pressure value as a single byte within an RF telegram:
the pressure range 100…450 kPa is represented with an unsigned byte ranging from 0…255. A scale factor of
1.373 kPa/LSB is required to meet this typical requirement. The SP37 Meas_Pressure function, however, returns
a signed integer value that represents pressure as 1/16 kPa/LSB. Conversion from 1/16 kPa/LSB to
1.373 kPa/LSB is therefore a commonly required task, but one that is not straightforward as care must be taken
to avoid excessive rounding or loss of precision. The full scale error (FSE) of this function is less than 0.4%.
As a convenience, this Scale_Pressure( ) function performs this conversion. In addition, pressure bounds
checking is performed so that 0 and 255 are returned for input pressure values below 100 kPa and above 450 kPa,
respectively. Finally, to reduce the amount of data handling required by the application program, note that the input
value to Scale_Pressure is passed as a pointer. This allows the same pointer to the
output
structure *(Pres0) to be re-used as the input pointer to Scale_Pressure().
Note: Scale function is intended to provide backward compatibility with SP30 100…450kPa numeric
representation. The 100kPa and 450kPa bounds checking feature prevents this function from being useful
outside of this range.
2.3.2
Actions
•
Check 16 bit input value against 100 kPa and 450 kPa bounds, if value is outside of these bounds return 0 or
255, respectively
•
Convert input value to unsigned 8 bit return value between 0 and 255
2.3.3
Prototype
unsigned char
Scale_Pressure
(signed int idata *
PressureValue
)
2.3.4
Inputs
2.3.5
Outputs
Table 19
Scale_Pressure: Input Parameters
Register / Address
Type
Name
Description
R7
signed int
idata*
PressureValue
Pointer to 16 bit input pressure value; Reuse of
Meas_Pressure output structure
*(Pres0)
Table 20
Scale_Pressure: Output values
Register/ Address
Type
Name
Description
R7
unsigned char Result
8 bit output pressure value