43.1.5 Interrupts
The ADC module allows for the ability to generate an interrupt upon completion of an Analog-to-Digital Conversion. The ADC interrupt flag is the ADIF bit in the PIRx register. The ADC interrupt enable is the ADIE bit in the PIEx register. The ADIF bit must be cleared by software.
- The ADIF bit is set at the completion of every conversion, regardless of whether or not the ADC interrupt is enabled.
- The ADC operates during Sleep only when the ADCRC oscillator is selected.
This interrupt will be generated while the
device is operating and while in Sleep. If the device is in Sleep, the interrupt will
wake up the device. Upon waking from Sleep, the next instruction following the SLEEP
instruction is
always executed. If the user is attempting to wake up from Sleep and resume in-line code
execution, the ADIE bit and the GIEL bit must both be set and the GIE bit must be
cleared. When all three of these bits are set, the execution will switch to the
Interrupt Service Routine.