English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (511/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
FIGURE 22-4:
ADCLK
CONVERTING 1 CHANNEL AT 400 KSPS, AUTO-SAMPLE START, 2 TAD
SAMPLING TIME
TSAMP
= 2 TAD
TSAMP
= 2 TAD
TCONV
= 12 TAD
TCONV
= 12 TAD
SAMP
DONE
ADC1BUF0
ADC1BUF1
Instruction Execution SET AD1CON1,ASAM
22.4 Miscellaneous ADC Functions
The following section describes bits not covered in the
previous section.
22.4.1 Aborting Sampling
Clearing the SAMP (AD1CON1<1>) bit while in Manual
Sample mode will terminate sampling, but may also
start a conversion if SSRC (AD1CON1<7:5>) = 000.
Clearing the ASAM (AD1CON1<2>) bit while in Auto-
Sample mode will not terminate an ongoing
acquire/convert sequence, however, sampling will not
automatically resume after the current sample is
converted.
22.4.2 ABORTING A CONVERSION
Clearing the ON (AD1CON1<15>) bit during a conver-
sion will abort the current conversion. The ADC Result
register will NOT be updated with the partially com-
pleted A/D conversion sample. That is, the correspond-
ing result buffer location will continue to contain the
value of the last completed conversion (or the last
value written to the buffer).
22.4.3 BUFFER FILL STATUS
When the conversion result buffer is split using the
BUFM control bit, the BUFS Status bit (AD1CON2<7>)
indicates which half of the buffer the A/D converter is
currently filling. If BUFS = 0, then the A/D converter is
filling ADC1BUF0-ADC1BUF7 and the user software
should read conversion values from ADC1BUF8-
ADC1BUFF. If BUFS = 1, the situation is reversed and
the user software should read conversion values from
ADC1BUF0-ADC1BUF7.
22.4.4 OFFSET CALIBRATION
The ADC module provides a method of measuring the
internal offset error. After this offset error is measured,
it can be subtracted, in software, from the result of an
A/D conversion. Use the following steps to perform an
offset measurement:
1. Configure the A/D converter in the same manner
as it will be used in the application.
2. Set the OFFCAL bit (AD1CON2<12>). This
overrides the input selections and connects the
sample and hold inputs to AVss.
3. If auto-sample is used set the CLRASAM bit
(AD1CON1<4>) to force conversions.
4. Enable the A/D converter and perform a conver-
sion. The result that is written to the ADC result
buffer is the internal offset error.
5. Clear the OFFCAL (AD2CON<12>) bit to return
the A/D converter to normal operation.
Note: Only positive ADC offsets can be
measured with this method.
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 509