English
Language : 

HD6475348R Datasheet, PDF (308/487 Pages) Hitachi Semiconductor – Single-Chip Microcomputer
15.4.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, 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.
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.
The following example explains the A/D conversion process when three channels in group 0 are
selected (AN0, AN1, and AN2). Figure 15-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'FEE8
MOV.B #H'72, @FEE8
2. The A/D converter samples the input at AN0, converts the voltage level to a digital value, and
transfers the result to register ADDRA.
3. Next the A/D converter samples and converts AN1 and transfers the result to ADDRB. Then it
samples and converts AN2 and transfers the result to ADDRC.
4. After all selected channels (AN0 to AN2) have been converted, the AD converter sets the ADF
bit to 1. If the ADIE bit is set to 1, an A/D interrupt (ADI) is requested. Then the A/D
converter begins converting AN0 again.
5. Steps 2 to 4 are repeated cyclically as long as the ADST bit remains set to 1.
To stop the A/D converter, software must clear the ADST bit to 0.
294