English
Language : 

AN897 Datasheet, PDF (7/16 Pages) Microchip Technology – Thermistor Temperature Sensing with MCP6SX2 PGAs
PIECE-WISE LINEAR INTERPOLATION TABLE
Each of the three gains uses a piece-wise linear inter-
polation table [9] to convert ADC codes to estimated
temperature. Within each table, the ADC’s codes were
divided into 64 segments, with 16 codes per segment.
The tables only include those ADC codes at the end
points between segments. Table 3 shows the extreme
valid table entries for each of the three tables.
TABLE 3:
INTERPOLATION TABLE END
POINTS.
Gain ADC Code TTH
RTH
VOUT
(V/V)
(LSb)
(°C)
(Ω)
(V)
1
960
-43.5
420k
4.688
112
51.2
3.44k
0.547
8
960
49.2
3.72k
4.688
224
94.9
787
1.094
32
960
92.6
845
4.688
208
150.9
179
1.016
Values of TTH and RTH beyond the specified tempera-
ture range of the thermistor (-40°C to +150°C) are
estimates only; they are not supported by actual data.
The thermistor self-heating error correction has been
included in Table 3.
The table’s entries go outside of -40°C to +150°C to
ensure proper functioning of the piece-wise linear
interpolation table when the reading overflows. In this
algorithm (Appendix A.2.6 “Firmware for the Signal
Analysis PICtail Daughter Board”), the table values
outside the valid range take on the nearest valid value.
This means that when G = 1 and ADC code > 960, the
table returns a value of -43.5°C. When G = 32 and
ADC code < 208, the table returns a value of 150.9°C.
The other table entries beyond the end points in Table 3
(e.g., near gain-change points) are zero because the
hysteresis algorithm will prevent them from being read.
This approach has been used for readability.
Digital Error Analysis
Figure 17 shows the estimated interpolation error for
the interpolation table. Changing the PGA’s gain takes
full advantage of the ADC’s resolution. The accuracy of
this piece-wise linear interpolation table is 0.034°C
over the -40°C to +150°C temperature range. The
improved ADC temperature resolution makes this
design’s piece-wise linear interpolation table behave
much better than the first design’s.
AN897
0.04
Design # 2
0.03
0.02
0.01
0.00
-0.01
-0.02
-0.03
-0.04
-50 -25 0 25 50 75 100 125 150
Thermistor Temperature (°C)
FIGURE 17:
Piece-wise Linear
Interpolation Error, Design # 2.
The digital roundoff error will be roughly proportional to
the ADC temperature resolution curve’s envelope (see
Figure 13). If the roundoff error is much less than the
ADC resolution, this error will have little impact.
The total digital error includes both the piece-wise lin-
ear interpolation error and round-off error.
DESIGN COMPARISON
Figure 18 shows the thermistor’s specified accuracy. It
contributes the same error to both designs.
2.0
1.8 BC Components®
1.6 # 2322 640 55103
1.4 10 kΩ @ +25°C
1.2
1.0
0.8
0.6
0.4
0.2
0.0
-50 -25 0 25 50 75 100 125 150
Thermistor Temperature (°C)
FIGURE 18:
Thermistor Accuracy.
Figure 19 compares the ADC temperature resolution
between the first and second design. The second
design is better because changing the PGA’s gain
helps improve the ADC temperature resolution.
 2004 Microchip Technology Inc.
DS00897B-page 7