KL14 wake up from VLLS3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KL14 wake up from VLLS3

跳至解决方案
3,093 次查看
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?

标签 (1)
0 项奖励
回复
1 解答
2,408 次查看
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 项奖励
回复
4 回复数
2,409 次查看
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 项奖励
回复
2,408 次查看
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 项奖励
回复
2,408 次查看
ulivinico
Contributor II

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

0 项奖励
回复
2,408 次查看
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