cancel
Showing results for 
Search instead for 
Did you mean: 

What will happen if I turn on multiple System Clock source on(MSI - HSI - HSE )

KHuyn
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

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.

View solution in original post

8 REPLIES 8

You'll have multiple clocks ticking, one of which you are clocking the rest of the part with.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II

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.

Thank you for your reply, but I don't quit get your explanation :(

0690X00000AQtR4QAL.png

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

Piranha
Chief II

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.

The mux can select only one source. You can have other clocks​ running.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you. That clears my mind.

Thank you, I got it now.