English
Language : 

HD6433308 Datasheet, PDF (229/349 Pages) Hitachi Semiconductor – Hitachi Single-Chip MicroComputer
10.3.2 Scan Mode (SCAN = 1)
The scan mode can be used to monitor analog inputs on one or more channels. When the ADST bit
is set to “1,” either by software or by a High-to-Low transition of the ADTRG signal (if enabled),
A/D conversion starts from the first channel selected by the CH bits. When CH2 = “0” the first
channel is AN0. When CH2 = “1” the first channel is AN4.
If the scan group includes more than one channel (i.e. if bit CH1 or CH0 is set), conversion of the
next channel 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 placed in the data registers corresponding to the selected channels. The A/D
data registers are readable by the CPU.
Before selecting the scan mode, clock, and analog input channels, software should clear the ADST
bit to “0” to make sure the A/D converter is stopped. Changing the mode, clock, or channel
selection while A/D conversion is in progress can lead to conversion errors. A/D conversion begins
when the ADST bit is set to "1" again. The same instruction can be used to alter the mode and
channel selection and set ADST to "1."
The following example explains the A/D conversion process when three channels in group 0 are
selected (AN0, AN1, and AN2) and the external trigger is disabled. Figure 10-4 shows the
corresponding timing chart.
(1) Software clears the ADST bit to “0,” then selects the scan mode (SCAN = “1”), scan group 0
(CH2 = “0”), and analog input channels AN0 to AN2 (CH1 and CH0 = “0”) and sets the
ADST bit to “1” to start A/D conversion.
Coding Example: (with slow clock and ADI interrupt enabled)
BCLR #5, @H’FFE8
;Clear ADST
MOV.B #H’7F, ROL
MOV.B ROL, @H’FFEA
;Disable external trigger
MOV.B #H’72, ROL
MOV.B ROL, @H’FFE8
;Select mode and channels and set ADST to "1"
Value set in ADCSR
ADF ADIE ADST SCAN CKS CH2 CH1 CH0
0
1
1
1
0
0
1
0
217