Kinetis K60 Very Low Power Mode

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis K60 Very Low Power Mode

404 Views
radomirkozub-re
NXP Employee
NXP Employee

The SDK 2.x doesn't exist on MK60FN1M0VMD15 

do we have any example code how to get into VLPS mode?

Thanks

Labels (1)
0 Kudos
4 Replies

134 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Radomir:

You also can refer to the Kinetis 120MHz bare metal sample code.

Kinetis 120MHz bare metal sample code 

Regards

Daniel

0 Kudos

134 Views
radomirkozub-re
NXP Employee
NXP Employee

OK, many thanks, so now I have code


SMC->PMPROT |= SMC_PMPROT_AVLP_MASK;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
SMC->PMCTRL &= ~SMC_PMCTRL_STOPM_MASK;
SMC->PMCTRL |= SMC_PMCTRL_STOPM(0x2); // VLPS mode
dummyread = base->PMCTRL;
dummyread++;
__asm("WFI");
LEDG_ON();
while(1)
{
__asm("NOP");
__asm("NOP");
}

to go to sleep and looks like chip is entering VLPS mode and then wakes up on GPIO or LPTMR.

However, chip allways wake up via reset .... but I need to have it continue after WFI instruction. Do I miss something?

Radomir

0 Kudos

134 Views
mjbcswitzerland
Specialist V

Hi Radomir

Please specify whether you have also GPIO interrupt and/or LPTMR operation in addition to this code and whether you have the watchdog enabled or disabled?

Some tips
1. SMC->PMPROT is a 'write-once' register so if you are using general example code there is a risk that it has already been written to in some other initialisation and so it is not in the mode that you expect and/or won't operate correctly.

2. The 150MHz K60 needs also the LPWUI flag in SMC->PMCTRL to ensure wake-up from an interrupt (although it is not critical if you are entering VLPS directly from RUN)
3. If the watchdog hasn't been disabled and you don't have a service that is regularly exiting from VLPS to service the watchdog and return to VLPS automatically you will need to ensure that the STOPEN flag in the watchdog control register is disabled to stop the watchdog firing in VLPS, and causing a reset.

4. You should disable interrupts before calling the WFI command and only enable them again once it continues (to ensure no race states and orderly recovery)

5. If you have the clocks operating from the PLL you also need to re-configure and restart the PLL each time you return to RUN mode

Regards

Mark

uTasker - for immediate and complete Kinetis solutions

0 Kudos

134 Views
mjbcswitzerland
Specialist V

Hi

See the uTasker open source project links below. It supports almost all processors and boards (even older ones) and includes dynamic low power support.


To go to VLPS you just do:
fnSetLowPowerMode(VLPS_MODE);
and it will move to the mode  as soon as all critical activity has stopped (eg. UART transmission that are still in progress that don't want to be frozen) and then recovers on any activity (and returns back to VLPS as soon as possible again).
See videos and links below for more information.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K60:
- http://www.utasker.com/kinetis/TWR-K60N512.html
- http://www.utasker.com/kinetis/TWR-K60D100M.html
- http://www.utasker.com/kinetis/TWR-K60F120M.html
- http://www.utasker.com/kinetis/ELZET80_NET-KBED.html
- http://www.utasker.com/kinetis/ELZET80_NET-K60.html
Low power and LLWU: http://www.utasker.com/kinetis/LLWU.html
Low power videos:
- https://youtu.be/kWNlsAoMly4
- https://youtu.be/iZEMRiDmHzw
- https://youtu.be/v4UnfcDiaE4
VLPS with continuous UART operation: https://community.nxp.com/message/421247#421247


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M


For better, faster, cheaper product developments consider uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

0 Kudos