29.2 Instruction-Based Power-Saving Modes
The dsPIC33CK512MPT608 family devices
have two special power-saving modes that are entered through the execution of a special
PWRSAV
instruction. Sleep mode stops clock operation and halts all code
execution. Idle mode halts the CPU and code execution, but allows peripheral modules to
continue operation. The assembler syntax of the PWRSAV
instruction is
shown in PWRSAV Instruction Syntax in Assembly and
PWRSAV Instruction Syntax in C Language.
Note:
SLEEP_MODE
and IDLE_MODE
are constants defined in the
assembler include file for the selected device.Sleep and Idle modes can be exited as a result of an enabled interrupt, WDT time-out or a device Reset. When the device exits these modes, it is said to “wake-up”.
PWRSAV
Instruction
Syntax in Assembly
PWRSAV #SLEEP_MODE ; Put the device into Sleep mode
PWRSAV #IDLE_MODE ; Put the device into Idle mode
PWRSAV
Instruction
Syntax in C Language
Sleep() // Put the device into Sleep mode
Idle () // Put the device into Idle mode