The ADC module allows for the ability to generate an interrupt upon completion of an analog-to-digital conversion. The ADC Interrupt Flag (ADIF) bit is set upon the completion of each conversion. If the ADC Interrupt Enable (ADIE) bit is set, an ADC interrupt event occurs. The ADIF bit must be cleared by software.
The ADC Interrupt can be generated while the device is operating or while in Sleep. While the device is operating in Sleep mode:
1
, PEIE =
1
, and GIE = 0
: An interrupt will wake the
device from Sleep. Upon waking from Sleep, the instructions following the
SLEEP
instruction are executed. The Interrupt Service Routine
is not executed.1
, PEIE =
1
, and GIE = 1
: An interrupt will wake the
device from Sleep. Upon waking from Sleep, the instruction following the
SLEEP
instruction is always executed. Then the execution will
switch to the Interrupt Service Routine.