Datasheet

255
2545T–AVR–05/11
ATmega48/88/168
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-2 and Table 24-3 on page 256). 0x000 represents analog ground, and 0x3FF repre-
sents the selected reference voltage minus one LSB.
24.8 Register description
24.8.1 ADMUX – ADC multiplexer selection register
Bit 7:6 – REFS1:0: Reference selection bits
These bits select the voltage reference for the ADC, as shown in Table 24-2. If these bits are
changed during a conversion, the change will not go in effect until this conversion is complete
(ADIF in ADCSRA is set). The internal voltage reference options may not be used if an external
reference voltage is being applied to the AREF pin.
Bit 5 – ADLAR: ADC left adjust result
The ADLAR bit affects the presentation of the ADC conversion result in the ADC Data Register.
Write one to ADLAR to left adjust the result. Otherwise, the result is right adjusted. Changing the
ADLAR bit will affect the ADC Data Register immediately, regardless of any ongoing conver-
sions. For a complete description of this bit, see ADCL and ADCH – The ADC data register” on
page 258.
Bit 4 – Res: Reserved bit
This bit is an unused bit in the Atmel ATmega48/88/168, and will always read as zero.
ADC
V
IN
1024
V
REF
--------------------------=
Bit 76543210
(0x7C) REFS1 REFS0 ADLAR MUX3 MUX2 MUX1 MUX0 ADMUX
Read/write R/W R/W R/W R R/W R/W R/W R/W
Initial value00000000
Table 24-2. Voltage reference selections for ADC.
REFS1 REFS0 Voltage reference selection
0 0 AREF, internal V
ref
turned off
01
AV
CC
with external capacitor at AREF pin
10Reserved
1 1 Internal 1.1V voltage reference with external capacitor at AREF pin