Solved! Go to Solution.
Hi @Oido,
You really need to do it step by step.
1. Disable all the peripherals that are not used in VLPS.
2. Switch the system clock to SIRC (measure BUS_CLK at CLKOUIT)
3. Disable all the other clock sources.
4. Enabled wakeup interrupt
5. Enter VLPS.
I would strongly recommended testing the VLPS entry/exit using a new simple project that does not use PLL / Motor control routines / any periperals except a GPIO wakeup interrupt.
I have already linked a few example that provide you with all you need.
Once you have such a simple project and still have problems, attach the complete project here so that I can test it.
Regards,
Daniel
Hello @Oido,
Refer to this example:
https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-RTC-VLPS/ta-p/1119655
You need to disable all the peripherals that are not active in VLPS, then, change the system clock to SIRC and disable FIRC, SOSC and SPLL.
On wakeup, enable all the clocks and peripherals.
Regards,
Dnaiel
First of all, thank you for your answer.
But even after posting this question, I referred to the example you provided and failed.
I can't check if it's vlps mode and I can't even get it back on. If you have any additional information, please do.
Hello @Oido,
The example I linked here before have these functions that can be used directly, or slightly modifies if it goes from RUN straight to VLPS.
init_VLPR(), switch_to_SIRC_in_RUN(), disable_FIRC_in_RUN(), enter_VLPR(), enter_VLPS()
When you change the system clock to SIRC, wait until the system clock is clocked by SIRC before other clocks get disabled, which is something you don't do in the code you posted.
Also, the example uses CLKOUT, which is something I would recommend using to confirm that the clock was correcly switch to SIRC, and that the MCU is VLPS.
There is also this example:
And the AN5425 that you mentioned come with SW:
https://www.nxp.com/webapp/Download?colCode=AN5425SW&docLang=en
If you have the S32K14W-Q064 Evaluation Board, there is J16 for current measurements.
You need to measure the just MCU consumption, not the consuption of other devices on the board.
Also, make sure you don't drive any load with the MCU outputs.
The outputs retain their states in VLPS set in the RUN mode.
Regards,
Daniel
Hi @Oido,
You really need to do it step by step.
1. Disable all the peripherals that are not used in VLPS.
2. Switch the system clock to SIRC (measure BUS_CLK at CLKOUIT)
3. Disable all the other clock sources.
4. Enabled wakeup interrupt
5. Enter VLPS.
I would strongly recommended testing the VLPS entry/exit using a new simple project that does not use PLL / Motor control routines / any periperals except a GPIO wakeup interrupt.
I have already linked a few example that provide you with all you need.
Once you have such a simple project and still have problems, attach the complete project here so that I can test it.
Regards,
Daniel
There are many issues in the code you posted.
You need to first switch the system clock to SIRC before you can disable all the other clock sources.
Also, in the wakeup interrupt, the system clock should be changed from SIRC before SIRC can be disabled.
Use CLKOUT as shown in the example to monitor the power modes, in VLPS the system clock is turned off. You should also measure the power consumption at VDD.
If you have any probelems with that, please elaborate,
Thank you,
BR, Daniel
Hello, Daniel
Which register should I look at that can change the system clock to SIRC?