14.4.4 Sleep Mode Operation

A sleep mode is entered by executing the Wait For Interrupt (WFI) instruction. The Sleep Mode bit field in the Sleep Configuration (SLEEPCFG.SLEEPMODE) register selects the level of the sleep mode.

Note: There is a small latency between the store instruction and the actual writing of the SLEEPCFG register due to bus bridges. Software must verify that the SLEEPCFG register contains the desired value before executing the WFI instruction.
Table 14-2. Sleep Mode Entry and Exit
ModeMode EntryWake-Up Sources
IDLESLEEPCFG.SLEEPMODE = IDLESynchronous(2), Asynchronous(1)
STANDBYSLEEPCFG.SLEEPMODE = STANDBY
Synchronous(3), Asynchronous(1)
Note:
  1. Asynchronous: Interrupt is generated on GCLK generic clock, external clock, or an external event.
  2. Synchronous: Interrupt is generated on the APB clock.
  3. Synchronous interrupt: Only for peripherals configured to run in Standby sleep mode.
Note: The type of wake-up source (synchronous or asynchronous) is specified in the interrupt section of each peripheral.

The sleep modes (Idle, Standby) and their effect on clock activity and the regulator are described in the table and the sections below.

Table 14-3. Sleep Mode Overview
ModeCPU ClockAHB/APB ClocksMain ClockGCLK0 ClockGCLK1 -->n ClocksClock SourcesRegulator
ONDEMAND = 0ONDEMAND = 1
IDLEStopRun(1)RunRunRun/Stop(2)RunRun/Stop(3)Main(8)
STANDBYStopStop(4)Stop(4)Stop if RUNSTDBY=0Stop if RUNSTDBY=0ULP(7)
Stop/Run if RUNSTDBY=1(5)Run if RUNSTDBY=1Stop/Run if RUNSTDBY=1(6)
Note:
  1. The AHB and APB clocks operate up to the MCLK, and are supplied only to the peripherals requesting them. The other peripherals, not requesting the clocks, are gated at MCLK output.
  2. Each GCLK (GCLK1 to GCLKn) operates if at least one peripheral requests the associated generated clock. If no peripheral requests the clock, it is stopped.
  3. The clock source remains active if at least one GCLK Generator requests it. If no GCLK Generator is requesting the clock, the source is stopped. It will automatically restart when a peripheral requests a clock from a GCLK that is supplied by this clock source.
  4. The AHB and APB clocks are stopped unless requested by at least one peripheral, and in this case, only provided to this/these peripherals through GCLK0 and MCLK.
  5. Each GCLK generator is stopped unless the clock it generates is requested by at least one peripheral.
  6. Each Clock Source is stopped unless the clock it generates is requested by at least one GCLK Generator.
  7. The regulator state can be programmed using the SUPC.VREG.RUNSTDBY bit.
  8. If running on a slow clock (e.g., 32 kHz), the ULP regulator is used.