2019-09-08 02:23 PM
Hello every one.
I am working with the STM32L4R5ZI. By default, it will uses MSI as the system clock source at 4Mhz.
My question is: what will happen if I turn on HSI or/and HSE without turning the other clock source off?
Thank you in advance?
Solved! Go to Solution.
2019-09-08 07:25 PM
Setting HSION bit in RCC_CR register only turns on that oscillator, but doesn't select it as a system clock. The same is true for other oscillators. System clock is selected with RCC_CFGR register SW bits and You can't select multiple sources there.
2019-09-08 04:13 PM
You'll have multiple clocks ticking, one of which you are clocking the rest of the part with.
2019-09-08 05:22 PM
Turning on/off oscillators and selecting system clock are two different and to some extent unrelated things. But of course the oscillator, selected as a system clock at that particular moment, must be on.
2019-09-08 06:27 PM
Thank you for your reply, but I don't quit get your explanation :(
2019-09-08 06:33 PM
Sorry, my question was unclear. Yes, I was asking what happen when more than 2 clock sources are selected, what is the SYSCLK will be eventually?
Say that I set the HSION = 1 in RCC->CR to select HSI as my desired clock source, but forgot to turn off MSION in my code(which is selected as default).
Hope that is more clear.
Thank
2019-09-08 07:25 PM
Setting HSION bit in RCC_CR register only turns on that oscillator, but doesn't select it as a system clock. The same is true for other oscillators. System clock is selected with RCC_CFGR register SW bits and You can't select multiple sources there.
2019-09-08 07:32 PM
The mux can select only one source. You can have other clocks running.
2019-09-08 10:36 PM
Thank you. That clears my mind.
2019-09-08 10:37 PM
Thank you, I got it now.