19.6.3.3 Sleep Mode Controller
A Sleep mode is entered by executing the Wait For Interrupt instruction (WFI). The Sleep Mode bits in the Sleep Configuration register (SLEEPCFG.SLEEPMODE) select the level of the sleep mode.
Note: A small latency happens between the
store instruction and actual writing of the SLEEPCFG register due to bridges. Software
must ensure that the SLEEPCFG register reads the desired value before issuing a WFI
instruction.
Mode | Mode Entry | Wake-Up Sources |
---|---|---|
IDLE0 | SLEEPCFG.SLEEPMODE = IDLE0 | Synchronous (2) (CAN included), asynchronous (1) |
IDLE2 | SLEEPCFG.SLEEPMODE = IDLE2 | Synchronous (2) (CAN excluded), asynchronous (1) |
STANDBY | SLEEPCFG.SLEEPMODE = STANDBY | Synchronous(3)(CAN excluded), Asynchronous(1) |
Note:
- Asynchronous: interrupt generated on GCLK generic clock, external clock, or external event.
- Synchronous: interrupt generated on the APB clock.
- Synchronous interrupt only for peripherals configured to run in standby.
Note: The type of wake-up sources (synchronous or asynchronous) is given in each module
interrupt section.
The sleep modes (idle, standby) and their effect on the clocks activity, the regulator and the RAM state are described in the table and the sections below.
Mode | CPU clock | AHB/APB clocks | Main clock | GCLK0 clock | GCLK1-8 clocks | Clock Sources | Regulator | RAM | |
---|---|---|---|---|---|---|---|---|---|
ONDEMAND = 0 | ONDEMAND = 1 | ||||||||
IDLE0 | Stop | Run(1), CAN included | Run | Run | Run/Stop (3) | Run | Run/Stop (4) | Main | Normal |
IDLE2 | Stop | Run(2), CAN excluded | |||||||
STANDBY | Stop | Stop (5) | Stop (5) | Stop if RUNSTDBY=0 | Stop if RUNSTDBY=0 | LPVREG (8) | Low Power (9) | ||
Stop/Run if RUNSTDBY=1 (6) | Run if RUNSTDBY=1 | Stop/Run if RUNSTDBY=1 (7) |
Note:
- The AHB/APB clocks are running up to MCLK, and then provided only to the IPs requesting them and to the CAN (which is a specific IP with no clock request mechanism). For the other IPs not requesting their AHB/APB clocks, these are gated at MCLK output.
- The AHB/APB clocks are running up to MCLK, and then provided only to the IPs requesting them. For the CAN and for the other IPs not requesting the clocks, they are gated at MCLK output.
- Each GCLK1 to GCLK8 is running if the associated generated clock is requested by at least one IP. It is stopped if no IP is requesting this clock.
- The clock source is running if the clock is requested by at least one GCLK Generator. It is stopped if no GCLK Generator is requesting this clock and will be restarted as soon as an IP requests a clock coming from a GCLK fed by this clock source.
- The AHB/APB clocks are stopped, except if requested by at least one IP, and in this case, only provided to this/these IP(s) through GCLK0 and MCLK.
- Each GCLK generators is stopped, except if the clock it generates is requested by at least one IP.
- Each Clock Source is stopped, except if the clock it generates is requested by at least one GCLK Generator.
- Regulator state is programmable by using STDBYCFG.VREGSMOD bits.
- RAM state is programmable by using STDBYCFG.BBIASHS bit.