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.
Solved! Go to Solution.
I'm not sure what the issue is here.
But I would recommend using the Sleep-on-exit option.
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
Hi,
What are the priorities of these two interrupts?
The LPIT interrupt must have a higher priority than the FTM interrupt.
Regards,
Daniel
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
I'm not sure what the issue is here.
But I would recommend using the Sleep-on-exit option.
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
thank you my problem is solved with this.