Datasheet

ATmega48PA/88PA/168PA [DATASHEET]
9223F–AVR–04/14
224
24.7 ADC Conversion Result
After the conversion is complete (ADIF is high), the conversion result can be found in the ADC result registers (ADCL,
ADCH).
For single ended conversion, the result is
where V
IN
is the voltage on the selected input pin and V
REF
the selected voltage reference (see Table 24-3 on page 225 and
Table 24-4 on page 226). 0x000 represents analog ground, and 0x3FF represents the selected reference voltage minus one
LSB.
24.8 Temperature Measurement
The temperature measurement is based on an on-chip temperature sensor that is coupled to a single ended ADC input.
1000 setting in MUX[3..0] bits of ADMUX register selects the temperature sensor. The internal 1.1V voltage reference, a 11
setting in REFS[1..0] of ADMUX, must also be selected for the ADC voltage reference source during 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 temperature sensor.
The measured voltage has a linear relationship to the temperature as described in Table 24-2.
The voltage sensitivity is approximately 1LSB/°C (142/128) and the accuracy of the temperature measurement is ±20°C
using the manufacturing calibration offset value (TS_ADC_25[H..L]).
The values described in Table 24-2 are typical values. However, due to the process variation the temperature sensor output
varies from one chip to another.
24.8.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 and ADCL are the ADC data register values obtained during temperature sensor reading.
b. TS_ADC_25_H and _L is the 10-bit ADC temp sensor reading stored as two byte values during factory
calibration at 25°C in the signature row.
c. The ratio 128/142 is the design compensation factor for the temperature sensor gain, as the temp sensor is
slightly more sensitive than 1°C/unit.
d. The +25 is the offset compensation for the fact that the calibration values are obtained at +25°C during
factory calibration. See Section 27.8.10 “Reading the Signature Row from Software” on page 244
and Table 27-5 on page 244 for signature row access and parameter addresses.
ADC
V
IN
1024
V
REF
---------------------------
=
Table 24-2. Sensor Output Code versus Temperature (Typical Values)
Temperature/°C –40°C +25°C +125°C
0x010D 0x0160 0x01E0
ADCH<<8ADCL+TS_ADC_25_H<<8TS_ADC_25_L+ 128
142
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
25+