13.2.1 Wake-Up from Sleep
The device can wake up from Sleep through one of the following events:
- External Reset input on MCLR pin, if enabled.
- BOR Reset, if enabled.
- Low-Power Brown-out Reset (LPBOR), if enabled.
- POR Reset.
- Windowed Watchdog Timer, if enabled.
- All interrupt sources except clock switch interrupt can wake up the part.
When the SLEEP
instruction is being executed, the
next instruction (PC + 2) is prefetched. For the device to wake up through an interrupt
event, the corresponding Interrupt Enable bit must be enabled in the PIEx register. Wake-up
will occur regardless of the state of the Global Interrupt Enable (GIE) bit. If the GIE bit
is disabled, the device will continue execution at the instruction after the SLEEP
instruction. If the GIE bit is enabled, the device
executes the instruction after the SLEEP
instruction and then call the Interrupt Service Routine (ISR).
NOP
as the immediate instruction after the SLEEP
instruction.The WDT is cleared when the device wakes up from Sleep, regardless of the source of wake-up. Upon a wake-from-Sleep event, the core will wait for a combination of three conditions before beginning execution. The conditions are:
- PFM Ready
- System Clock Ready
- BOR Ready (unless BOR is disabled)