SAM3N0C Atmel Corporation, SAM3N0C Datasheet - Page 73

no-image

SAM3N0C

Manufacturer Part Number
SAM3N0C
Description
Manufacturer
Atmel Corporation
Datasheets
10.8.1
10.8.1.1
10.8.1.2
10.8.1.3
10.8.2
10.8.2.1
10.8.2.2
11011A–ATARM–04-Oct-10
Entering sleep mode
Wakeup from sleep mode
Wait for interrupt
Wait for event
Sleep-on-exit
Wakeup from WFI or sleep-on-exit
Wakeup from WFE
The SLEEPDEEP bit of the SCR selects which sleep mode is used, see
ter” on page
Modes” in the PMC section of the datasheet.
This section describes the mechanisms for entering sleep mode, and the conditions for waking
up from sleep mode.
This section describes the mechanisms software can use to put the processor into sleep mode.
The system can generate spurious wakeup events, for example a debug operation wakes up the
processor. Therefore software must be able to put the processor back into sleep mode after
such an event. A program might have an idle loop to put the processor back to sleep mode.
The wait for interrupt instruction, WFI, causes immediate entry to sleep mode. When the proces-
sor executes a WFI instruction it stops executing instructions and enters sleep mode. See
on page 149
The wait for event instruction, WFE, causes entry to sleep mode conditional on the value of an
one-bit event register. When the processor executes a WFE instruction, it checks this register:
See
If the SLEEPONEXIT bit of the SCR is set to 1, when the processor completes the execution of
an exception handler it returns to Thread mode and immediately enters sleep mode. Use this
mechanism in applications that only require the processor to run when an exception occurs.
The conditions for the processor to wakeup depend on the mechanism that cause it to enter
sleep mode.
Normally, the processor wakes up only when it detects an exception with sufficient priority to
cause exception entry.
Some embedded systems might have to execute system restore tasks after the processor
wakes up, and before it executes an interrupt handler. To achieve this set the PRIMASK bit to 1
and the FAULTMASK bit to 0. If an interrupt arrives that is enabled and has a higher priority than
current exception priority, the processor wakes up but does not execute the interrupt handler
until the processor sets PRIMASK to zero. For more information about PRIMASK and FAULT-
MASK see
The processor wakes up if:
• if the register is 0 the processor stops executing instructions and enters sleep mode
• if the register is 1 the processor clears the register to 0 and continues executing instructions
• it detects an exception with sufficient priority to cause exception entry
without entering sleep mode.
“WFE” on page 148
“Exception mask registers” on page
173. For more information about the behavior of the sleep modes see “Low Power
for more information.
for more information.
49.
“System Control Regis-
SAM3N
“WFI”
73

Related parts for SAM3N0C