Wake-Up from Sleep

The device can wake up from Sleep through one of the following events:

  1. 1.External Reset input on MCLR pin, if enabled.
  2. 2.BOR Reset, if enabled.
  3. 3.POR Reset.
  4. 4.Watchdog Timer, if enabled.
  5. 5.Any external interrupt.
  6. 6.Interrupts by peripherals capable of running during Sleep (see the individual peripheral for more information).

The first three events will cause a device Reset. The last three events are considered a continuation of program execution. To determine whether a device Reset or wake-up event occurred, refer to the “Determining the Cause of a Reset” section in the “Resets” chapter.

When the SLEEP instruction is being executed, the next instruction (PC + 1) is prefetched. For the device to wake up through an interrupt event, the corresponding interrupt enable bit must be enabled. Wake-up will occur regardless of the state of the GIE bit. If the GIE bit is disabled, the device continues execution at the instruction after the SLEEP instruction. If the GIE bit is enabled, the device executes the instruction after the SLEEP instruction and will then call the Interrupt Service Routine. In cases where the execution of the instruction following SLEEP is not desirable, the user needs to have a NOP after the SLEEP instruction.

The WDT is cleared when the device wakes up from Sleep, regardless of the source of wake-up.