how to enter power-down/sleep/deep-sleep mode and wakeup

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to enter power-down/sleep/deep-sleep mode and wakeup

1,516 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by yanzhongsan on Fri Mar 26 18:04:11 MST 2010
hi every one.
   like the title, how to enter the power-down/sleep/deep-sleep mode, and how wakeup it? as the manual :

The Deep power-down mode is entered by using the following steps:
1. Pull the WAKEUP pin externally HIGH.
2. Set the DPDEN bit in the PCON register (see Table 47).
3. Write one to the SLEEPDEEP bit in the ARM Cortex-M0 SCR register (Table 284).
4. Ensure that the IRC is powered on by setting bits IRCOUT_PD and IRC_PD to zero in
the PDRUNCFG register before entering Deep power-down mode (this is the default).
5. Use the ARM WFI instruction

but where is the SCR register, i can not find it in the header file. i uses LPC1113

by the way, table 284 is not SCR register. it is table 283
0 项奖励
2 回复数

850 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by yanzhongsan on Fri Mar 26 19:15:07 MST 2010
i find the SCR register and enter the deep dower-down mode by use following code:

LPC_SYSCON->PDRUNCFG      = 0xFFFFFFFC;
SCB->SCR = 1<<2;
LPC_PMU->PCON = 1<<1;// WFI enter Deep-power down mode
__WFI();// enter Deep-power down mode

but i can not wakeup the chip by make a falling edge to th wakeup pin, why?
pls help me.
0 项奖励

850 次查看
cwembedded
Contributor I

Are you still having trouble with this? Were you able to enter Deep Power Down Mode, and wake up via the WAKEUP pin?

Try this:

(Make sure WDLOCKDP bit is zero, or simply set WD MOD register to 0)

LPC_PMU->PCON |= 0x02;            // set 2nd bit

SCB->SCR |= 0x04;                           // set 3rd bit

LPC_SYSCON->PDRUNCFG &= ~(0x03);   // clear 1st and 2nd bit

__WFI();         // execute ARM wait for interrupt

This works on my LPC1227, and the board appears to enter DPD mode. 

However, the problem I'm having is that my board still draws ~24mA. So something tells me that this isn't working as intended. Although, I see activity when I pull WAKEUP low. So I'm stumped.

Were you able to figure yours out? Does my code work for you?

Anyone else want to chime in on this?

0 项奖励