User`s manual

DemoKit-LG2 User’s Manual
Figure 8. Typical Dependence of Sensor Resistance
The following equation, which approximates the characteristic curve, calculates temperature at the
sensor according to the change in the sensor’s resistance:
α²-4 x β + 4 x β x k
T
- α
T = 25 + ° C
2 x β
-3
α = 7,88 x 10 x K
β = 1,937 x 10 x K
k
T
=
-1
-5 -2
R
T
R
25
with:
α²-4 x β + 4 x β x k
T
- α
T = 25 + ° C
2 x β
-3
α = 7,88 x 10 x K
β = 1,937 x 10 x K
k
T
=
-1
-5 -2
R
T
R
25
-3
α = 7,88 x 10 x K
β = 1,937 x 10 x K
k
T
=
-1
-5 -2
R
T
R
25
with:
The temperature is measured using the dual-slope method in which a resistor value can be converted
into a digital countervalue. To do this, the charging time of capacitor C
18 will be measured with the 16-
bit timer/event counter 00 of the MCU. The first charging slope will use a reference resistor (R
REF = R6)
and the second charging slope a variable resistor (R
VAR = R5 + RT), which should be determined. By
comparing the two measured times and the known reference resistor R
REF, the variable resistor can be
calculated.
All of the 78K0/LX2 MCUs have bit-settable I/O ports and Schmitt-trigger inputs such as the TI000
timer input port. The DemoKit-LG2 uses the P0 bit-settable port as a bidirectional port.
At first, the complete port P0 is cleared and set to output mode. In this case, the C
18 capacitor is
discharged via P00/TI000 and prepared for the first measurement. The R
7 resistor is only used to limit
the current during the discharging of the capacitor. Then port P02 is set to 1 and output. At this point,
the 16-bit timer/event counter 00 is started. The rest of the port P0 is set to input (high impedance). So
the capacitor will be charged via the R
6 reference resistor. When the capacitor has reached the threshold
level of the Schmitt-trigger input P00/TI000, the actual timer value is automatically captured and an
15