10.4.1 Module Initialization
Initialization of the ADC module is a simple process with very few steps: enabling the clock to the ADC, disabling the analog isolation circuit associated with all inputs that are to be used, and reconfiguring the sample sequencer priorities (if needed).
The initialization sequence for the ADC is as follows:
- Enable the ADC clock using the RCGCADC register (see Section 4.2.97).
- Enable the clock to the appropriate GPIO modules using the RCGCGPIO register (see Section 4.2.87). To find out which GPIO ports to enable, see the device-specific data sheet.
- Set the GPIO AFSEL bits for the ADC input pins (see Section 17.5.10). To determine which GPIOs to configure, see the device-specific data sheet.
- Configure the AINx signals to be analog inputs by clearing the corresponding DEN bit in the GPIO Digital Enable (GPIODEN) register (see Section 17.5.18).
- Disable the analog isolation circuit for all ADC input pins that are to be used by writing a 1 to the appropriate bits of the GPIOAMSEL register (see Section 17.5.21) in the associated GPIO block.
- If required by the application, reconfigure the sample sequencer priorities in the ADCSSPRI register. The default configuration has Sample Sequencer 0 with the highest priority and Sample Sequencer 3 as the lowest priority.