Datasheet

2012 Microchip Technology Inc. DS30575A-page 479
PIC18F97J94 FAMILY
22.8.2.2 A/D Conversions While Scanning
Through All Analog Inputs
Figure 22-17 and Example 22-5 illustrate a typical
setup, where all available analog input channels are
sampled and converted. In this instance, 16 analog
inputs are assumed. The set CSCNA bit specifies
scanning of the A/D inputs to the S/H positive input.
Other conditions are similar to those located in Section
Section 22.8.2.1 “Sampling and Converting a
Single Channel Multiple Times”.
Initially, the AN0 input is sampled and converted. The
result is stored in the ADCBUFn buffer. Then, the AN1
input is sampled and converted. This process of scan-
ning the inputs repeats 16 times, until the buffer is full,
and then the module generates an interrupt. The entire
process will then repeat.
FIGURE 22-17: SCANNING ALL 16 INPUTS PER SINGLE INTERRUPT
Conversion
A/D CLK
SAMP
ADC1BUF0
TSAMP
TCONV
BSET AD1CON1, #ASAM
ADC1BUF1
DONE
ADC1BUFE
ADC1BUFF
Analog Input
AN0
TSAMP
TCONV
AN1
TSAMP
TCONV
AN14
TSAMP
TCONV
AN15
AD1IF
ASAM
Trigger
Instruction Execution