The device operating mode is configured through the use of the following:
- Policy bits in the SYSOSCCFG and MCLKCFG registers in SYSCTL (to control the behavior of SYSOSC in RUN, SLEEP, and STOP modes)
- Policy bits in the PMODECFG register in SYSCTL (to set the deep sleep level of STOP, STANDBY or SHUTDOWN)
- SLEEPDEEP policy bit in the SCR local CPU register (to select whether a WFI instruction triggers SLEEP mode or STOP/STANDBY/SHUTDOWN mode)
- Use of the Arm WFI (wait for interrupt) CPU instruction (to enter the configured SLEEP/STOP/STANDBY/SHUTDOWN state)
Before entering an operating mode where the CPU is disabled, make sure that the appropriate peripheral that can wake the CPU from sleep has been configured to generate a CPU interrupt on the desired event.
For a detailed description of the behavior of each operating mode, see the operating modes section.
Policy Bit Configuration
Table 2-10 defines how to configure the relevant policy bits for each operating mode. All values are indicated in binary format. A dash (-) indicates that the particular policy bit is a don't care for the specified operating mode.
Table 2-10 Operating Mode Policy Bit Configuration
Operating Mode Policy Control |
RUN |
SLEEP(2) |
STOP |
STANDBY |
SHUTDOWN |
Register |
Bit |
RUN0 |
RUN1 |
RUN2 |
SLEEP0 |
SLEEP1 |
SLEEP2 |
STOP0 |
STOP1 |
STOP2(3) |
STANDBY0 |
STANDBY1 |
SYSOSCCFG |
DISABLE(1) |
0 |
0 |
1 |
0 |
0 |
1 |
- |
- |
(1) |
- |
- |
- |
USE4MHZSTOP |
- |
- |
- |
- |
- |
- |
0 |
1 |
0 |
- |
- |
- |
DISABLESTOP |
- |
- |
- |
- |
- |
- |
0 |
0 |
1 |
- |
- |
- |
MCLKCFG |
USELFCLK(1) |
0 |
1 |
- |
0 |
1 |
- |
0 |
0 |
- |
- |
- |
- |
STOPCLKSTBY |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
1 |
- |
PMODECFG |
DSLEEP |
- |
- |
- |
- |
- |
- |
00 |
00 |
00 |
01 |
01 |
10 |
SCR |
SLEEPDEEP |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
(1) The SYSOSCCFG.DISABLE and MCLKCFG.USELFCLK policy bits take effect immediately after being configured, as these bits affect the RUN mode behavior. Other policy bits only take effect when the CPU is put into deep sleep.
(2) SLEEP mode behavior is always identical to RUN mode, except with the CPUCLK disabled. As such, the SLEEP behavior is determined by the configuration of RUN mode.
(3) The STOP2 policy for STOP mode can be configured by setting the DISABLESTOP bit or DISABLE bit in the SYSOSCCFG register before entering DEEPSLEEP. When DISABLESTOP is set and DISABLE is cleared, SYSOSC is only disabled when DEEPSLEEP is requested. SYSOSC continues to run in RUN and SLEEP modes. When DISABLE is set, DISABLESTOP becomes a don't care, and SYSOSC is disabled immediately and is kept disabled in STOP mode.
Entering SLEEP Mode
Entering SLEEP mode disables the CPU, but otherwise maintains the same configuration as RUN. To enter SLEEP mode:
- Configure the Cortex-M0+ CPU for SLEEP by clearing the SLEEPDEEP bit in the Cortex-M0+ SCR local register
- Enter sleep mode by executing a WFI (wait for interrupt) CPU instruction
Entering STOP or STANDBY Modes
To enter STOP or STANDBY mode:
- Configure the PMODECFG register in SYSCTL to 0b00 (STOP) or 0b01 (STANDBY)
- Configure the Cortex-M0+ CPU for DEEP SLEEP by setting the SLEEPDEEP bit in the Cortex-M0+ SCR local register
- Enter sleep mode by executing a WFI (wait for interrupt) CPU instruction
Entering SHUTDOWN Mode
To enter SHUTDOWN mode:
- Configure the PMODECFG register in SYSCTL to 0b10 (SHUTDOWN)
- Configure the Cortex-M0+ CPU for DEEP SLEEP by setting the SLEEPDEEP bit in the Cortex-M0+ SCR local register
- Enter sleep mode by executing a WFI (wait for interrupt) CPU instruction