16.4 ADC MODULE CONFIGURATION
The following steps should be followed for performing an A/D conversion:
1. Select 10-bit or 12-bit mode (ADxCON1<10>)
2. Select voltage reference source to match expected range on analog inputs
(ADxCON2<15:13>)
3. Select the analog conversion clock to match desired data rate with processor clock
(ADxCON3<7:0>)
4. Select port pins as analog inputs (ADxPCFGH<15:0> and ADxPCFGL<15:0>)
5. Determine how inputs will be allocated to Sample/Hold channels (ADxCHS0<15:0> and
ADxCHS123<15:0>)
6. Determine how many Sample/Hold channels will be used (ADxCON2<9:8>, ADx-
PCFGH<15:0> and ADxPCFGL<15:0>)
7. Determine how sampling will occur (ADxCON1<3>, ADxCSSH<15:0> and ADxCSSL<
15:0>)
8. Select Manual or Auto Sampling
9. Select conversion trigger and sampling time.
10. Select how conversion results are stored in the buffer (ADxCON1<9:8>)
11. Select interrupt rate or DMA buffer pointer increment rate (ADxCON2<9:5>)
12. Select the number of samples in DMA buffer for each ADC module input
(ADxCON4<2:0>)
13. Select the data format
14. Configure ADC interrupt (if required)
• Clear ADxIF bit
• Select interrupt priority (ADxIP<2:0)
• Set ADxIE bit
15. Configure DMA channel (if needed)
16. Turn on ADC module (ADxCON1<15>)