How to put a K60 into VLPR mode and back to Run?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to put a K60 into VLPR mode and back to Run?

642 Views
mathewl
Contributor I

I am trying to place a MK60DN512VLQ10 in Very Low Power Run mode using CodeWarrior 10.7 and am having difficulty.
The methods tab has function calls to do this, but it needs a very low power mode clock configuratin that I can not find.

I have tried App note methods for changing from PEE clock mode to BLPE (or BLPI) mode but it always locks up during a loop:
<while((MCG_S & 0x0CU) != 0x08U) { /* Wait until external reference clock is selected as MCG output */>
and it changes through BPE mode, with or without this mode being in the clock configuration.

I got advice through a representitive to:
“The SDK provides API's for the use of different power modes and examples for your application. For example, if you want to set the SMC_PMPROT to allow all power modes you may use the function SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll); Here you can download the SDK for your device https://mcuxpresso.nxp.com/en/welcome

The config tool available at MCUXpresso will allow configure your mcu in an easy way. I attached you a picture where I set the micro to run in VLPR at 32.768kHz. I reached this speed by using the RTC to set the System/Core clock to 32. 768kHz. For more detailed information about this tool please refer to https://www.nxp.com/docs/en/user-guide/GSMCUXCTUG.pdf

I managed to use the MCUXpresso Config Tools v7 to configure the clock as per the picture but the code it compiles calls on calls on header files I do not have.

My question is how can I do this with CodeWarrior, but any help to switch between Run mode and VLPR mode is what I need

Labels (1)
0 Kudos
Reply
2 Replies

552 Views
mjbcswitzerland
Specialist V

Hi Matt

Take a look at:
https://www.utasker.com/kinetis/TWR-K60N512.html
https://www.utasker.com/kinetis/TWR-K60D100M.html
https://www.utasker.com/kinetis/TWR-K60F120M.html

fnSetVLPR_speed(); // see https://www.utasker.com/kinetis/MCG.html
fnSetLowPowerMode(VLPR_MODE);
...
fnSetLowPowerMode(RUN_MODE);
fnSetRUN_speed(); // see https://www.utasker.com/kinetis/MCG.html

Free open source version (including Code Warrior, KDS and MCUXpresso support for K60s) available that allows effort-free professional solutions.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos
Reply

552 Views
mathewl
Contributor I

Thank you Mark. I will start investigating using this system. I was hoping it was going to be easier to find without the "fear factor" of working with the MCG.

I also noticed that the generated code from CodeWarrior tries to turn on the FLL in clock modes that has the FLL disabled. Might be a bug or something that is wrong with my current setup.

0 Kudos
Reply