MCU wakeup by LPIT0 from VLPS and Timer Callback

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

MCU wakeup by LPIT0 from VLPS and Timer Callback

Jump to solution
1,431 Views
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. 

0 Kudos
1 Solution
1,397 Views
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

 

 

View solution in original post

0 Kudos
4 Replies
1,407 Views
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 Kudos
1,406 Views
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 Kudos
1,398 Views
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 Kudos
1,347 Views
Raj_Nayyer
Contributor II

thank you my problem is solved with this.