How to make KEA128 enter sleep mode ?

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

How to make KEA128 enter sleep mode ?

跳至解决方案
1,205 次查看
buckzheng
Contributor II

i want to make kea128 enter stop mode , here are my configuration code bellow

PMC->SPMSC1 = 0x80;
PMC->SPMSC2 = 0x00;
PMC->SPMSC1 &= ~PMC_SPMSC1_LVWIE_MASK;
/* disable LVD in stop mode */
PMC->SPMSC1 &= ~(PMC_SPMSC1_LVDE_MASK | PMC_SPMSC1_LVDRE_MASK |
PMC_SPMSC1_LVDSE_MASK);
/* Set the SLEEPDEEP bit to enable deep sleep mode (STOP) */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
/* Not using KEIL's uVision, so use the standard assembly command */
__WFI;

while(1)

{

}

but  MCU don't go to sleep , it continue run codes in while loop, rather stop in the front of while ! what i should do to make kea128 enter sleep mode ?

0 项奖励
回复
1 解答
976 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Hunter,

     I copy your code to the FRDM-KEAZ128_Driver Testcode, and test the power consumption on my FRDM-KEA128 board, the power consumption is just 132uA, so it can enter stop mode successfully.

    Now, please take care two points.

1. Did you add any other interrupt in your code?

   Because interrupt will wake up the stop mode.

   Please disable the interrupt, then try again.

2. After you download the code with debugger, please power down your board, remove your debugger(except you use the onboard debugger like FRDM board), then power on and test the power consumption again, power off and power on the board after downloading the code is very important, don't just press the reset button.

Wish it helps you!

If you still have question, please let me know!

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
977 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Hunter,

     I copy your code to the FRDM-KEAZ128_Driver Testcode, and test the power consumption on my FRDM-KEA128 board, the power consumption is just 132uA, so it can enter stop mode successfully.

    Now, please take care two points.

1. Did you add any other interrupt in your code?

   Because interrupt will wake up the stop mode.

   Please disable the interrupt, then try again.

2. After you download the code with debugger, please power down your board, remove your debugger(except you use the onboard debugger like FRDM board), then power on and test the power consumption again, power off and power on the board after downloading the code is very important, don't just press the reset button.

Wish it helps you!

If you still have question, please let me know!

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

976 次查看
buckzheng
Contributor II

hello, Kerry! thanks for your reply! I made a mistake , I use keil to compile my project, but  this function "__WFI" is defined "__wfi", rather than the instruction "WFI"!  So MCU did'nt enter sleep mode! The true synax is "__WFI()"  in keil !