AP08056
Power Saving Features
Power Down of the Entire System (Power-Down Mode)
Application Note
14
V1.0, 2006-12
STACKSP = SP;
//Save current stack pointer at an absolute memory
//location. e.g. unsigned char idata STACKSP _at_
//0xe0; iram location 0xe0 = 0x42
SCU_PAGE = 0x01;//Open SCU page 1 to access PMCON0 and PASSWD
PASSWD = 0x98; //Open access to writing of all protected bits
PMCON0 |= 0x17; //Enable power-down with wake up source RXD or
//EXINT0 selected and select wake-up with reset
_nop_();
//2 NOPs necessary for proper execution of
_nop_();
//code upon wakeup. Function is defined in
//intrins.h.
Note: Some IRAM locations will be corrupted after a reset. The stack and the constant
variable location must avoid these locations. Please refer to the respective
product’s Errata Sheet for the detailed locations.
Note: START_XC.A51 will clear IRAM locations ranging from 0 to the number defined in
the symbol IDATALEN. It is therefore necessary to redefine the data assigned to
this symbol to avoid destroying the stack and the constant variable data.
4.2
Exiting Power-Down Mode
Power-down mode can be exited in two ways:
1. Hardware reset. The device is put into the hardware reset state.
2. The EXINT0 pin, the RXD pin or either of these two pins detects a falling edge. The
wake-up source(s) must be selected prior to entering power-down mode.
When a wake up source is selected, the device will wake-up from power-down mode
upon detecting a falling edge trigger at that source. In power-down mode, EXINT0
pin/RXD pin must be held at high level. Power-down mode is exited when EXINT0
pin/RXD pin goes low for at least 100 ns.
The device can wake-up with or without reset depending on the setting of the
PMCON0.WKSEL bit. If the WKSEL bit was set to 1 prior to entering power-down mode,
the system will execute a reset sequence similar to the power-on reset sequence.
Therefore, all port pins and SFRs are put into their reset state and will remain in this state
until they are affected by program execution. The only exception is that hardware will set
the wake-up indication bit PMCON0.WKRS to indicate that the device is woken up from
power-down reset.