cancel
Showing results for 
Search instead for 
Did you mean: 

PLL Ready Interrupt not firing as expected

simonprentice9
Associate
Posted on November 18, 2016 at 16:06

STM32L053R8 (Nucleo dev board)

When setting the PLL state in HAL_RCC_OscConfig, rather than sit in a while loop waiting for RCC_CR_PLLRDY I want to enter sleep mode and wake based on the PLL ready interrupt.

I have a locally modified version of HAL_RCC_OscConfig which (A) clears the flag (if set, which it isn't), (B) enables the interrupt, (C) disables systick (to stop systick from waking it), (D) enter sleep mode:

(A) RCC->CICR |= RCC_CICR_PLLRDYC;

(B) __HAL_RCC_ENABLE_IT(RCC_IT_PLLRDY);

(C) SysTick->CTRL = 0;

(D) HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI);

I was expecting it to hit an interrupt when the PLL is set and then leap out of sleep mode back into normal operation.

I have tried waiting for RCC_IT_PLLRDY (E) and that works but I want to be in a lower power state while the PLL settles.

(E) while ((RCC->CR & RCC_CR_PLLRDY) == 0);

I have tried leaving systick enabled and that makes no difference.

I have RCC_IRQHandler() declared in the same file as RTC_IRQHandler() and EXTI2_3_IRQHandler() but it is never hit.

I suspect/hope I am missing something simple and obvious.

Has anyone successfully used the PLL ready interrupt?

Are there any examples people are aware of that would help me to determine what I have done wrong?

#stm32l0-pll #pll #stm32l0xx
3 REPLIES 3
Posted on November 18, 2016 at 17:36

Not using the L0, do you get the interrupt if you don't sleep the core? How long do you see the PLL taking to lock?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Radosław
Senior II
Posted on November 18, 2016 at 19:29

Wait for PLL ready in state where  all clock are off?    GOOD IDEA.

this will never work

simonprentice9
Associate
Posted on November 21, 2016 at 11:15

Thank you for the clear reply.

It had been suggested to me as a way to save power while waiting.

I'll look down other avenues.