Trying to put a KL02 microcontroler in VLPS mode

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

Trying to put a KL02 microcontroler in VLPS mode

跳至解决方案
1,343 次查看
omerarregi
Contributor I

I'm trying to put a KL02 microcontroler in VLPS mode (according to the datasheet the current consumption in this mode should be betwen 2 to 5 uA) but it seems that it doesn't enter in this mode properly. The current consumption is around 2mA after WFI instruction (3.6mA in normal operation)

I've an periodic interruption (1sec) using LPTIMER for RUN mode enter 1sec. after WFI instruction.

I'm trying to send the uC to VLPS mode out of this interruption with this code:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// set the uC in Very-Low-Power Stop mode (VLPS)

SMC->PMPROT |= (uint8_t)SMC_PMPROT_AVLP_MASK;    // allow entry in low power modes

SMC->PMCTRL |= 0x02;                                                      // set VLPS mode for WFI state

MCM->CPO |= MCM_CPO_CPOWOI_MASK;                       // clear CPOREQ on any interrupt or exception vector fetch

MCM->CPO |= MCM_CPO_CPOREQ_MASK;                       // request Compute Operation

while (!(MCM->CPO & MCM_CPO_CPOACK_MASK));           // wait until Compute operation entry has completed

__WFI();

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Any idea about what I'm doing wrong?

Thanks in advance

标签 (1)
0 项奖励
回复
1 解答
1,075 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Omer,

FSL's shared a sample code package of the FRDM-KL02 which includes a low power mode demo.

The demo's illustrated the ways to enter different low power modes, of course the VLPS mode in, you can refer to this demo for details.

Please download the sample code package through the link as below.

cache.freescale.com/files/32bit/software/KL02-SC.zip
Have a great day,
Ping

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,075 次查看
omerarregi
Contributor I

Thanks, Problem solved

0 项奖励
回复
1,076 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Omer,

FSL's shared a sample code package of the FRDM-KL02 which includes a low power mode demo.

The demo's illustrated the ways to enter different low power modes, of course the VLPS mode in, you can refer to this demo for details.

Please download the sample code package through the link as below.

cache.freescale.com/files/32bit/software/KL02-SC.zip
Have a great day,
Ping

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

0 项奖励
回复