Control the MCU to VLLS3 power mode.

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

Control the MCU to VLLS3 power mode.

794 Views
danielchai
Senior Contributor I

Hi All,

I have cw10.4 and MQX4.0.1. And I add some code in my main task to control the MK60FN1M0VLQ12 to enter the VLLS3 power mode.

The code is as following:

MCG_C6 &= ~(0x20u);

 

/* Write to PMPROT to allow VLLS3 power modes */

SMC_PMPROT = SMC_PMPROT_AVLLS_MASK;

        

/* Set the STOPM field to 0b100 for VLLS3 mode*/

SMC_PMCTRL &= ~(SMC_PMCTRL_STOPM_MASK);

SMC_PMCTRL |=  SMC_PMCTRL_STOPM(0x4) ;

  

SMC_VLLSCTRL =  SMC_VLLSCTRL_VLLSM(3);           // set VLLSM = 0b11

/* Now execute the stop instruction to go into VLLS3 */

SCB_SCR |= SCB_SCR_SLEEPDEEP_MASK;  

asm("WFI");

_task_block();

But I measure the current drop from MCU, it does not enter the VLLS3 mode.

Any suggestions about this?

Thank you.

-Daniel

0 Kudos
5 Replies

621 Views
jeremyzhou
NXP Employee
NXP Employee

I think your code is ok. I have a sample code of enter VLLS3 and you can have a try. I'm looking forward to your reply.

1.jpg

Regards,

Ping Zhou

0 Kudos

621 Views
danielchai
Senior Contributor I

Hi  Ping,

After I make it enter the VLLS3 mode, how should I set it wake up?

I use MQX4.0.1. When should I edit the wake up code?

Thank you.

-Daniel

0 Kudos

621 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel,

The LLWU module allows the user to select up to 16 external pin sources and up to 8

internal modules as a wakeup source from low-leakage power modes.So I suggest you can go

throgh the Chapter 16 Low-Leakage Wakeup Unit (LLWU) of K60 reference manual, then you can reference

a demo code through the C:\Freescale\Freescale_MQX_4_0\mqx\examples\lowpower.

Good luck for you.

Regards,

Ping.

0 Kudos

621 Views
danielchai
Senior Contributor I

Hi Ping,

I already read the demo code for lowpower, but it does not have the VLLS3. It just contains Run, VLPR, STOP and  LLS.

Thanks.

-Daniel

0 Kudos

621 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Daniel,

Yes, the demo code doesn't include VLLS3, however wake source setting for LLS is as similar with VLLS3.

I think the most important thing for you currently is to understand the mode operation of  LLWU unit.

0 Kudos