
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
117
Revision 1.0, 2011-12-15
2.36
GetCompValue()
2.36.1
Description
This function retrieves an 8 bit value from a 2 dimensional lookup table depending on input values Value1 and
Value2. The lookup table is a M by N matrix and can be of any size from 2 x 2 up to 15 x 15 holding 225 different
values in its maximum configuration. This function may be used to obtain a compensation value from a lookup
table with 2 threshold types (e.g. temperature and voltage), according to the measured input values (Value1 and
Value2). The lookup table has to be stored in the FLASH.
The input values are compared against threshold points defined in the lookup table, and the thresholds must be
sorted in increasing order. The column is chosen by Value1 thresholds and the row is selected by Value2
thresholds respectively. If Value1 is lower than its lowest threshold then the left-most column is selected, and
likewise if Value2 is lower than its lowest threshold the top-most row is selected.
The matrix size is always 1 larger than the number of threshold points. Thus, a 12 by 7 matrix will have 6 threshold
points for Value1 (column) and 11 threshold points for Value2 (row).
Figure 14
M by N matrix
1
2
...
M
1
2
...
N
CompValue
1
CompValue
2
...
CompValue
M
CompValue
(N-1)*M+1
CompValue
(N-1)*M+M
CompValue
M+M
CompValue
M+1
CompValue
M+2
...
...
...
...
...
CompValue
(N-1)*M+2
...
Row
Column