The device operating mode is configured through the use of the following:
- Policy bits in the MCLKCFG
registers in SYSCTL (to control the behavior of SYSOSC in STANDBY mode)
- Policy bits in the PMODECFG register in SYSCTL (to set the deep sleep level of STOP, STANDBY or SHUTDOWN (if present))
- SLEEPDEEP policy bit in the SCR local CPU register (to select whether a WFI instruction triggers SLEEP mode or STOP/STANDBY/SHUTDOWN mode (if present))
- Use of the Arm WFI (wait for interrupt) CPU instruction (to enter the configured SLEEP/STOP/STANDBY/SHUTDOWN state (if present))
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-13 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-13 Operating Mode Policy Bit Configuration
| Operating Mode Policy Control |
RUN |
SLEEP(1) |
STOP |
STANDBY |
SHUTDOWN (if present) |
| Register |
Bit |
STANDBY0 |
STANDBY1 |
| MCLKCFG |
STOPCLKSTBY |
- |
- |
- |
0 |
1 |
- |
| PMODECFG |
DSLEEP |
- |
- |
00 |
01 |
01 |
10 |
| SCR |
SLEEPDEEP |
0 |
0 |
1 |
1 |
1 |
1 |
(1) 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.
Entering SLEEP Mode
Entering SLEEP mode disables the CPU, but otherwise maintains the same configuration as RUN. To enter SLEEP mode:
- Configure the CPU for SLEEP by clearing the SLEEPDEEP bit in the local SCR register.
- Enter sleep mode by executing the 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 CPU for DEEP SLEEP by setting the SLEEPDEEP bit in the local SCR register.
- Enter sleep mode by executing a WFI (wait for interrupt) CPU instruction.
Entering SHUTDOWN Mode (if present)
To enter SHUTDOWN mode:
- Configure the PMODECFG register in SYSCTL to 0b10 (SHUTDOWN).
- Configure the CPU for DEEP SLEEP by setting the SLEEPDEEP bit in the local SCR register.
- Enter sleep mode by executing a WFI (wait for interrupt) CPU instruction.