Hello,
according to AN12085 the system pll will be powered on in System Idle.
Looking at the power_mode_switch_bm example it looks like we have to set every clock divider and system pll setting manually in code. The same is true for the Low Power Idle mode - every PLL gets shut down by software and not by hardware.
void ClockSetToSystemIdle(void)
{
// CORE CLK mux to 24M before reconfigure PLLs
SwitchSystemClocks(LPM_PowerModeLowPowerRun);
ClockSelectXtalOsc();
/* Init SYS PLL */
CLOCK_InitSysPll(&sysPllConfig_PowerMode);
/* Deinit SYS PLL PFD 0 1 */
CLOCK_DeinitSysPfd(kCLOCK_Pfd0);
CLOCK_DeinitSysPfd(kCLOCK_Pfd1);
/* Init System pfd2. */
CLOCK_InitSysPfd(kCLOCK_Pfd2, 24);
/* Init System pfd3. */
CLOCK_InitSysPfd(kCLOCK_Pfd3, 24);
/* Deinit USB1 PLL */
CLOCK_DeinitUsb1Pll();
/* Deinit USB1 PLL PFD 0 1 2 3 */
CLOCK_DeinitUsb1Pfd(kCLOCK_Pfd0);
CLOCK_DeinitUsb1Pfd(kCLOCK_Pfd1);
CLOCK_DeinitUsb1Pfd(kCLOCK_Pfd2);
CLOCK_DeinitUsb1Pfd(kCLOCK_Pfd3);
/* Deinit AUDIO PLL */
CLOCK_DeinitAudioPll();
/* Deinit ENET PLL */
CLOCK_DeinitEnetPll();
SwitchSystemClocks(LPM_PowerModeSysIdle);
}
Kind regards,
Stefan
Hello,
>>In other words how can I put the CPU in a Wait for Interrupt state while keeping all peripherals running and not changing their settings (which would only be possible if they are in an idle state)?
It is not possible. The reason is that "system idle" and "all peripherals running" are contradictory.
Have a nice day
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------
Hello fangfang,
thank you for your answer.
What is going to happen if I do the following:
CLOCK_SetMode(kCLOCK_ModeRun);
// Interrupts are already disabled at this point
__DSB();
__ISB();
__WFI();
__ISB();
// Interrupts get enabled after leaving
The CPU will go to WFI while all peripherals keep running with their normal frequencies. Am I going to have any troubles with this code because I use WFI without setting LPM to WAIT or STOP and I do not change any clocks?
Kind regards,
Stefan