231
ATmega16M1/32M1/64M1 [DATASHEET]
8209E–AVR–11/2012
21.10 Register description
The ADC of the Atmel ATmega16M1/32M1/64M1 is controlled through three different registers. The ADCSRA and
the ADCSRB registers which are the ADC Control and Status registers, and the ADMUX which allows to select the
V
REF source and the channel to be converted.
The configuration of the amplifiers are controlled via two dedicated registers AMP0CSR and AMP1CSR. Then the
start of conversion is done via the ADC control and status registers.
The conversion result is stored on ADCH and ADCL register which contain respectively the most significant bits
and the less significant bits.
21.10.1
ADMUX – ADC Multiplexer Register
Bit 7:6 – REFS[1:0]: ADC V
REF Selection Bits
These two bits determine the voltage reference for the ADC.
If bits REFS1 and REFS0 are changed during a conversion, the change will not take effect until this conversion is
complete (it means while the ADIF bit in ADCSRA register is set).
In case the internal Vref is selected, it is turned ON as soon as an analog feature needed it is set.
Bit 5 – ADLAR: ADC Left Adjust Result
Set this bit to left adjust the ADC result.
Clear it to right adjust the ADC result.
The ADLAR bit affects the configuration of the ADC result data registers. Changing this bit affects the ADC data
registers immediately regardless of any on going conversion. For a complete description of this bit, see
“ADCH andBit
7
654
3
2
1
0
REFS1
REFS0
ADLAR
MUX4
MUX3
MUX2
MUX1
MUX0
ADMUX
Read/write
R/W
-
R/W
Initial value
0
Table 21-4.
ADC voltage reference selection.
AREFEN
ISRCEN
REFS[1:0]
Description
1
0
00
External VREF on AREF pin, Internal VREF is switched off
10
01
AV
CC with external capacitor connected on the AREF pin
00
01
AVCC (no external capacitor connected on the AREF pin)
10
Reserved
10
11
Internal 2.56V reference voltage with external capacitor
connected on the AREF pin
0
x
11
Internal 2.56V reference voltage