MCU wakeup by LPIT0 from VLPS and Timer Callback

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

MCU wakeup by LPIT0 from VLPS and Timer Callback

跳至解决方案
3,416 次查看
Raj_Nayyer
Contributor II

Hi,

I have an "S32K146" MCU and I'm using SDK. I want to have a power management procedure. The problem is that when I start LPIT0 timer in another timer (FTM1) callback and then set MCU in VLPS MCU will not wake up and don't go to LPIT0 callback function.

My configuration is this : WakeupTiming_pal_instance is FTM1, Continuous notification, External clock (SPLLDIV1_CLK = 20Mhz), Prescale = 16 and callback function : voidWakeupTimerCallback

SleepTiming_pal_instance is LPIT0, Continuous notification, SIRCDIV2_CLK = 8Mhz , and callback function : voidSleepTimerCallback

attached code should toggle a pin every 10ms in RUN mode for 10s and then for 9.9s each 60ms wake up with LPIT0 interrupt and toggle the pin and again go to VLPS but it doesn't go to voidSleepTimerCallback after MCU set to VLPS. 

标记 (3)
0 项奖励
回复
1 解答
3,382 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

I'm not sure what the issue is here.

But I would recommend using the Sleep-on-exit option.

danielmartynek_0-1612192987265.png

The MCU goes back to VLPS immediately once it exits the interrupt.

So, you don't have to call the POWER_SYS_SetMode(VLPS, ...) function every time.

 

BR, Daniel

 

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
3,392 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

What are the priorities of these two interrupts?

The LPIT interrupt must have a higher priority than the FTM interrupt.

 

Regards,

Daniel

0 项奖励
回复
3,391 次查看
Raj_Nayyer
Contributor II

I added this code after timer initialization :

INT_SYS_SetPriority(LPIT0_Ch0_IRQn,0);
INT_SYS_SetPriority(FTM1_Ch0_Ch1_IRQn,1);

now it goes to sleep callback just once after that it remains in VLPS 

0 项奖励
回复
3,383 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

I'm not sure what the issue is here.

But I would recommend using the Sleep-on-exit option.

danielmartynek_0-1612192987265.png

The MCU goes back to VLPS immediately once it exits the interrupt.

So, you don't have to call the POWER_SYS_SetMode(VLPS, ...) function every time.

 

BR, Daniel

 

 

0 项奖励
回复
3,332 次查看
Raj_Nayyer
Contributor II

thank you my problem is solved with this.