Low Power Wake-Up

cancel
Showing results for 
Search instead for 
Did you mean: 

Low Power Wake-Up

Jump to solution
503 Views
burgeh
Contributor IV

Greetings,

I am currently using the MK22FN256LVH12 microcontroller with KDS v3.2 and Processor Expert.

I am looking to put the controller in a lower power mode. I currently am able to put it in a STOP mode in which it will wake up from a LPTMR from the code below.

//setup timer

LPTMR_PDD_WriteCompareReg(LPTMR0_DEVICE, 59);
LPTMR0_CSR &= ~1; //disable timer
LPTMR_PDD_EnableInterrupt(LPTMR0_DEVICE);

Later in the code I enable it and sleep. This works for DOM_SLEEP which sets it in STOP mode.

pastedImage_1.png

I read in the datasheet that when in VLLS1 or VLLSx that it can only be awaken by Wakeup Reset. Can this only done by hardware? There is a function I use which hard resets the controller by firmware. However, I doesnt seem like my LPTMR event is being achieved in this mode (I turn an LED on in the event where the timer overflows, and it never turns on).

pastedImage_3.png

Thoughts?

1 Solution
200 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

LPTMR can wake up (wakeup reset) system through LLWU. There is an example in SDK package named power_mode_switch. It shows how to recover from VLLSx by LPTMR or IO pin.

Regards,

Jing

View solution in original post

5 Replies
200 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Christopher,

No, you do not need to worry about that.

Regards,

Jing

0 Kudos
200 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Wake up from VLLSx do not need Cpu_SystemReset(). It's a wake up reset, not interrupt. In PE Components Library, please add Init_SMC. It set the VLLS control. But I'd rather copy the code in the power_switch demo directly.

Regards,

Jing

0 Kudos
200 Views
burgeh
Contributor IV

jingpan

Thank you. Do I need to worry about constantly resetting over time? Like how many times can I rewrite registers?

0 Kudos
201 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

LPTMR can wake up (wakeup reset) system through LLWU. There is an example in SDK package named power_mode_switch. It shows how to recover from VLLSx by LPTMR or IO pin.

Regards,

Jing

View solution in original post

200 Views
burgeh
Contributor IV

jingpan

I have been able to wake up by using these ISR  in my events.c file. However, I have not been able to recover unless I issue the Cpu_SystemReset(); function. That is what I at first expected, but from some readings is it necessary?

PE_ISR(Wakeup_Timer)

{
//HB_LED_ON;
LPTMR_PDD_ClearInterruptFlag(LPTMR0_DEVICE);
Cpu_SystemReset(); //Need to reset to wake back up
}


PE_ISR(LLWU_IRQ)
{
HB_LED_ON;
LPTMR_PDD_ClearInterruptFlag(LPTMR0_DEVICE); //call the LPTMR function
}

pastedImage_1.png

0 Kudos