KL14 wake up from VLLS3

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

KL14 wake up from VLLS3

Jump to solution
3,122 Views
ulivinico
Contributor II

I'm developing an application with KL14. I was able to enter VLLS3 mode and exit from it by using a button connected to a LLWU input, starting from examples given in code zipped in KL25_SC.exe

Now I need to exit the VLLS3 mode by using a CMP input, when an external input voltage goes below a certain level: is there any given example code to start from?

Labels (1)
0 Kudos
Reply
1 Solution
2,437 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Currently, there are no given example code to exit the VLLS3 mode by using a CMP input. But it is not difficult to find that in low_power_demo example there is a cmp.c , you can refer to case 3 in  low_power_ demo example (it use the LPTMR as the wake up source)to write the code.

When you use the cmp.c, some point you need to pay attention in your main.c:

1,set the CMP as the wake up source

llwu_configure(0x0000, LLWU_PIN_FALLING, 0x2);

2, open cmp clock

SIM_SCGC4 |= (SIM_SCGC4_CMP_MASK );

3,enable CMP interrupt

NVIC_EnableIRQ(CMP0_IRQn);

4,initial CMP

cmp_init (0x18);

you can refer the low_power_ demo example to write your own code.

I wish it helps you!

Best regards!

View solution in original post

0 Kudos
Reply
4 Replies
2,438 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Currently, there are no given example code to exit the VLLS3 mode by using a CMP input. But it is not difficult to find that in low_power_demo example there is a cmp.c , you can refer to case 3 in  low_power_ demo example (it use the LPTMR as the wake up source)to write the code.

When you use the cmp.c, some point you need to pay attention in your main.c:

1,set the CMP as the wake up source

llwu_configure(0x0000, LLWU_PIN_FALLING, 0x2);

2, open cmp clock

SIM_SCGC4 |= (SIM_SCGC4_CMP_MASK );

3,enable CMP interrupt

NVIC_EnableIRQ(CMP0_IRQn);

4,initial CMP

cmp_init (0x18);

you can refer the low_power_ demo example to write your own code.

I wish it helps you!

Best regards!

0 Kudos
Reply
2,437 Views
ulivinico
Contributor II

Thank you. It works fine. Now I'm trying to understand how to recognize which source causes the wakeup. In my case the internal module#2 - CMP0 or the external pin LLWU5.

After reset, reading the register RCM_SRS0 doesn't help since both CMP and llwu causes to set the same bit WAKEUP.

Which bit and wich register allows to distinguish between the two reset sources?

0 Kudos
Reply
2,437 Views
ulivinico
Contributor II

I solved by configuring filtered llwu pin and by using register LLWU_FILT1 to monitor the wakeup source.

0 Kudos
Reply
2,437 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ulivinico,

I don't think it have any example codes about use CMP to wake up the VLLS3 which is provided by Freescale. Attached is Kinetis L Peripheral Module Quick Reference which include LLWU configuration examples and hope it will help to design.

Regards,

Ping