English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (508/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
22.3.9 BUFFER FILL MODE
The Buffer Fill mode allows the output buffer to be used
as a single, 16-word buffer or two, 8-word buffers.
When BUFM is ‘0’, the complete 16-word buffer is used
for all conversion sequences. Conversion results will
be written sequentially in the buffer, starting at
ADC1BUF0 until the number of samples as defined by
SMPI<3:0> (AD1CON2<5:2>) is reached. The next
conversion result will be written to ADC1BUF0 and the
process repeats. If the ADC interrupt is enabled, an
interrupt will be generated when the number of
samples in the buffer equals SMPI<3:0>.
When the BUFM bit (AD1CON2<1>) is ‘1’, the 16-word
results buffer (ADRES) will be split into two 8-word
groups. Conversion results will be written sequentially
into the first buffer starting at ADC1BUF0, BUFS
(AD1CON2<7>) will be cleared, until the number of
samples as defined by SMPI<3:0> (AD1CON2<5:2>)
is reached. The ADC interrupt flag will then be set.
After the ADC interrupt flag is set, the following result
will be written sequentially to the second buffer, starting
at ADC1BUF8 The next conversion result will be writ-
ten to the second buffer; starting at ADC1BUF8, BUFS
(AD1CON2<7>) will be set until the number of samples
as defined by SMPI<3:0> (AD1CON2<5:2>) is
reached. The ADC interrupt flag will then be set.
The process then restarts with BUFS = 0 and the
results being written to the first buffer.
22.3.10 SELECTING THE MUX TO BE
CONNECTED TO THE ADC
(ALTERNATING SAMPLE MODE)
The ADC has two input MUXs that connect to the SHA.
These MUXs are used to select which analog input is
to be sampled. Each of the MUXs have a positive and
a negative input.
22.3.10.1 Single Input Selection
The user may select one of up to 16 analog inputs, as
determined by the number of analog channels on the
device, as the positive input of the SHA. The
CH0SA<3:0> bits (AD1CHS<19:16>) select the posi-
tive analog input.
The user may select either VR- or AN1 as the negative
input. The CH0NA bit (AD1CHS<23>) selects the ana-
log input for the negative input of channel 0. Using AN1
as the negative input allows unipolar differential mea-
surements.
The ALTS bit (AD1CON2<0>) must be clear for this
mode of operation.
22.3.10.2 Alternating Input Selections
The ALTS bit causes the module to alternate between
the two input MUXs.
The inputs specified by CH0SA<3:0> and CH0NA are
called the MUX A inputs. The inputs specified by
CH0SB<3:0> and CH0NB are called the MUX B inputs.
When ALTS is ‘1’, the module will alternate between
the MUX A inputs on one sample and the MUX B inputs
on the subsequent sample. When ALTS is ‘0’, only the
inputs specified by CH0SA<3:0> and CH0NA are
selected for sampling.
22.3.11
SELECTING THE ADC
CONVERSION CLOCK SOURCE
AND PRESCALER
The ADC module can use the internal RC oscillator or
the PBCLK as the conversion clock source.
When the internal RC oscillator is used as the clock
source, ADRC (AD1CON3<15>) = 1, the TAD is the
period of the oscillator, no prescaler are used. When
using the internal oscillator the ADC can continue to
function in SLEEP and in IDLE.
When the PBCLK is used as the conversion clock
source, ADRC = 0, the TAD is the period of the PBCLK
after the prescaler ADCS<7:0> (AD1CON3<7:0>) is
applied.
The A/D converter has a maximum rate at which con-
versions may be completed. An analog module clock,
TAD, controls the conversion timing. The A/D conver-
sion requires 12 clock periods (12 TAD).
The period of the ADC conversion clock is software
selected using a 8-bit counter. There are 256 possible
options for TAD, specified by the ADCS<7:0> bits
(AD1CON3<7:0>).
Equation 22-3 gives the TAD value as a function of the
ADCS control bits and the device instruction cycle
clock period, TCY.
EQUATION 22-3: ADC CONVERSION
CLOCK PERIOD
TAD = 2 • (TPB(AADCS + 1)
ADCS = (TAD/(2 •TPB)) - 1
For correct A/D conversions, the ADC conversion clock
(TAD) must be selected to meet the minimum TAD time.
DS61143E-page 506
Preliminary
© 2008 Microchip Technology Inc.