Microchip Technology DM183037 Data Sheet

Page of 696
 2012 Microchip Technology Inc.
DS30575A-page 479
PIC18F97J94 FAMILY
22.8.2.2
A/D Conversions While Scanning 
Through All Analog Inputs
 an
 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
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
T
SAMP
T
CONV
BSET AD1CON1, #ASAM
ADC1BUF1
DONE
ADC1BUFE
ADC1BUFF
Analog Input
AN0
T
SAMP
T
CONV
AN1
T
SAMP
T
CONV
AN14
T
SAMP
T
CONV
AN15
AD1IF
ASAM
Trigger
Instruction Execution