
© 2006 Microchip Technology Inc. DS70183A-page 16-19
Section 16. Analog-to-Digital Converter (ADC)
16
For channel 0, if the ALTS bit is ‘0’, only the inputs specified by CH0SA<4:0> and CH0NA are
selected for sampling.
If the ALTS bit is ‘1’, on the first sample/convert sequence for channel 0, the inputs specified by
CH0SA<4:0> and CH0NA are selected for sampling. On the next sample convert sequence for
channel 0, the inputs specified by CH0SB<4:0> and CH0NB are selected for sampling. This
pattern repeats for subsequent sample conversion sequences.
Note that if multiple channels (CHPS = 01 or 1x) and simultaneous sampling (SIMSAM = 1) are
specified, alternating inputs change every sample because all channels are sampled on every
sampletime. If multiple channels (CHPS = 01 or 1x) and sequentialsampling (SIMSAM = 0) are
specified, alternating inputs change only on each sample of a particular channel.
16.7.2.2 SCANNING THROUGH SEVERAL INPUTS WITH CHANNEL 0
Channel 0 can scan through a selected vector of inputs. The CSCNA bit (ADxCON2<10>)
enables the CH0 channel inputs to be scanned across a selected number of analog inputs. When
CSCNA is set, the CH0SA<4:0> bits are ignored.
The ADCx Input Scan Select Register High (ADxCSSH) and ADCx Input Scan Select Register
Low (ADxCSSL) registers specify the inputs to be scanned. Each bit in these registers
corresponds to an analog input. Bit 0 corresponds to AN0, bit 1 corresponds to AN1 and so on.
If a particular bit is ‘1’, the corresponding input is part of the scan sequence. The inputs are
always scanned from lower to higher numbered inputs, starting at the first selected channel after
each interrupt occurs.
The ADxCSSHand ADxCSSL bits only specify the input of the positive input of the channel. The
CH0NA bit still selects the input of the negative input of the channel during scanning.
If the ALTS bit is ‘1’, the scanning only applies to the MUX A input selection. The MUX B input
selection, as specified by the CH0SB<4:0>, still selects the alternating channel 0 input. When the
input selections are programmed in this manner, the channel 0 input alternates between a set of
scanning inputs specified by the ADxCSSL register and a fixed input specified by the CH0SB
bits.
16.7.3 Channel 1, 2 and 3 Input Selection
Channel 1, 2 and 3 can sample a subset of the analog input pins. Channel 1, 2 and 3 can select
one of two groups of three inputs.
The CH123SA bit (ADxCHS123<0>) selects the source for the positive inputs of channel 1, 2 and
3. Clearing CH123SA selects AN0, AN1 and AN2 as the analog source to the positive inputs of
channel 1, 2 and 3, respectively. Setting CH123SA selects AN3, AN4 and AN5 as the analog
source.
The CH123NA<1:0> bits (ADxCHS<2:1>) select the source for the negative inputs of channel 1,
2 and 3. Programming CH123NA = 0x selects VREF- as the analog source for the negative inputs
of channels 1, 2 and 3. Programming CH123NA = 10 selects AN6, AN7 and AN8 as the analog
source to the negative inputs of channels 1, 2 and 3 respectively. Programming CH123NA = 11
selects AN9, AN10 and AN11 as the analog source.
Note: If the number of scanned inputs selected is greater than the number of samples
taken per interrupt, the higher numbered inputs will not be sampled.