Datasheet

203
7728G–AVR–06/10
ATtiny87/ATtiny167
However, if the signal is not bipolar by nature (9 bits + sign as the 10th bit), this scheme loses
one bit of the converter dynamic range. Then, if the user wants to perform the conversion with
the maximum dynamic range, the user can perform a quick polarity check of the result and use
the unipolar differential conversion with selectable differential input pair. When the polarity
check is performed, it is sufficient to read the MSB of the result (ADC9 in ADCH register). If the
bit is one, the result is negative, and if this bit is zero, the result is positive.
17.9 Temperature Measurement
The temperature measurement is based on an on-chip temperature sensor that is coupled to a
single ended ADC input. MUX[4..0] bits in ADMUX register enables the temperature sensor.
The internal 1.1V voltage reference must also be selected for the ADC voltage reference
source in the temperature sensor measurement. When the temperature sensor is enabled, the
ADC converter can be used in single conversion mode to measure the voltage over the tem-
perature sensor.
The measured voltage has a linear relationship to the temperature as described in Table 17-2.
The voltage sensitivity is approximately 1 LSB/
°C and the accuracy of the temperature mea-
surement is ±10°C using manufacturing calibration values (TS_GAIN, TS_OFFSET). The
values described in Table 17-2 are typical values. However, due to the process variation the
temperature sensor output varies from one chip to another.
17.9.1 Manufacturing Calibration
Calibration values determined during test are available in the signature row.
The temperature in degrees Celsius can be calculated using the formula:
Where:
a. ADCH & ADCL are the ADC data registers,
b. is the temperature sensor gain
c. TSOFFSET is the temperature sensor offset correction term
TS_GAIN is the unsigned fixed point 8-bit temperature sensor gain factor in
1/128th units stored in the signature row
TS_OFFSET is the signed twos complement temperature sensor offset reading
stored in the signature row. See Table 20-1 on page 221 for signature row
parameter address.
Table 17-2. Temperature vs. Sensor Output Voltage (Typical Case): Example ADC Values
Temperature/°C –40°C +25°C +85°C
0x00F6 0x0144 0c01B8
T
ADCH 8«()ADCL[]273 25 TS_OFFSET+()()128×
TS_GAIN
------------------------------------------------------------------------------------------------------------------------------------------------------- 25+=