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
Solved! Go to Solution.
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!
-----------------------------------------------------------------------------------------------------------------------
Thanks, Problem solved
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!
-----------------------------------------------------------------------------------------------------------------------