219
ATmega16M1/32M1/64M1 [DATASHEET]
8209E–AVR–11/2012
Figure 21-6. ADC timing diagram, auto triggered conversion.
Figure 21-7. ADC timing diagram, free running conversion.
21.5
Changing channel or reference selection
The MUXn and REFS1:0 bits in the ADMUX Register are single buffered through a temporary register to which the
CPU has random access. This ensures that the channels and reference selection only takes place at a safe point
during the conversion. The channel and reference selection is continuously updated until a conversion is started.
Once the conversion starts, the channel and reference selection is locked to ensure a sufficient sampling time for
the ADC. Continuous updating resumes in the last eight ADC clock cycle before the conversion completes (ADIF in
ADCSRA is set). Note that the conversion starts on the second following rising CPU clock edge after ADSC is writ-
ten. The user is thus advised not to write new channel or reference selection values to ADMUX until two ADC clock
cycle after ADSC is written.
If Auto Triggering is used, the exact time of the triggering event can be indeterministic. Special care must be taken
when updating the ADMUX Register, in order to control which conversion will be affected by the new settings.
Table 21-1.
ADC conversion time.
Condition
First conversion
Normal
conversion,
single ended
Auto triggered
conversion
Sample & Hold
(Cycles from Start of Conversion)
13.5
3.5
2
Conversion Time
(Cycles)
25
15.5
16
1
2
3
4
5
6
7
8
11
12
13
14
Sign and MSB of result
LSB of result
ADC clock
Trigger
source
ADIF
ADCH
ADCL
Cycle number
12
One conversion
Next conversion
Conversion
complete
Prescaler
reset
ADATE
Prescaler
reset
Sample and
hold
MUX and REFS
update
12
13
14
Sign and MSB of result
LSB of result
ADC clock
ADSC
ADIF
ADCH
ADCL
Cycle number
12
One conversion
Next conversion
3
4
Conversion
complete
Sample and hold
MUX and REFS
update
5