Trying to put a KL02 microcontroler in VLPS mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Trying to put a KL02 microcontroler in VLPS mode

ソリューションへジャンプ
1,385件の閲覧回数
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,117件の閲覧回数
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,117件の閲覧回数
omerarregi
Contributor I

Thanks, Problem solved

0 件の賞賛
返信
1,118件の閲覧回数
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 件の賞賛
返信