418
14.4.2
Scan Mode (SCAN = 1)
Scan mode can be used to monitor analog inputs on one or more channels. When the ADST bit in
ADCSR is set to 1 by software or an external trigger input, A/D conversion starts with the first
channel (AN0 when CH2 = 0, AN4 when CH2 = 1) in the group.
If the scan group includes more than one channel, conversion of the second channel (AN1 or
AN5) begins as soon as conversion of the first channel ends.
Conversion of the selected channels continues cyclically until the ADST bit is cleared to 0. The
conversion results are stored in the data registers corresponding to the selected channels.
Before changing a mode or analog input channels, clear the ADST bit in ADCSR to 0 to stop A/D
conversion in order to prevent malfunctions. Setting the ADST bit to 1 after changing the mode or
channel selects the first channel and starts A/D conversion again (changing the mode or channel
and setting the ADST bit can be performed simultaneously).
The following is an example of the A/D conversion process in scan mode when three channels in
group 0 are selected (AN0, AN1, and AN2). See figure 14.4 for the timing.
1.The program selects scan mode (SCAN = 1), scan group 0 (CH2 = 0), and analog input
channels AN0–AN2 (CH1 = 1, CH2 = CH0 = 0), then sets the ADST bit to 1 to start A/D
conversion.
2.The A/D converter samples the input at the first channel (AN0), converts the voltage level to a
digital value, and transfers the result to register ADDRA. Next, the second channel (AN1) is
automatically selected and conversion begins.
3.Then it does the same for the third channel (AN2).
4.After all selected channels (AN0–AN2) have been converted, the A/D converter sets the ADF
bit to 1 and begins conversion on channel AN0 again. If the ADIE bit is set to 1, an A/D
interrupt (ADI) is requested after the A/D conversion.
5.Steps 2–4 are repeated cyclically as long as the ADST bit remains set at 1.
To stop A/D conversion, clear the ADST bit to 0. The moment the ADST bit is set to 1 again,
A/D conversion begins with the first channel (AN0).
Содержание HD6417032
Страница 21: ......
Страница 35: ...xiv ...
Страница 85: ...50 ...
Страница 101: ...66 ...
Страница 129: ...94 ...
Страница 135: ...100 ...
Страница 343: ...308 ...
Страница 369: ...334 ...
Страница 383: ...348 ...
Страница 475: ...440 ...
Страница 525: ...490 CK RAS CAS TRp TRc TRcc tRASD1 tRASD2 tCASD3 tCASD2 TRr tCSR Figure 20 18 Self Refresh ...
Страница 578: ...543 CK RAS CAS TRp TRc TRcc tRASD1 tRASD2 tCASD3 tCASD2 TRr tCSR Figure 20 62 Self Refresh ...
Страница 689: ...654 ...