cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L412KB clock options

deep_rune
Associate III

Im using a STM32L412KB for the first time and Im a little confused about the clock options. I can't seem to change the clock speed (input frequency) in cubeIDE, it's always stuck on 8MHz. However I notice there is an internal oscillator - does this mean I don't have to use an external crystal? This would be very good for my design, but I'm not sure - what are the disadvantages of using an internal oscillator?

1 ACCEPTED SOLUTION

Accepted Solutions

As I recall this L4 has a MSI clock sources as well as the HSI, and the MSI starts the part.

The MSI can be trimmed via the LSE (32.768 KHz) crystal.

Things like CAN and USB need an accurate clock source, as do things like radio/networking applications. If you have an existing clock source, like a TCXO, you can use that in many cases.

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

View solution in original post

3 REPLIES 3
TDK
Guru

If you're talking about the crystal clock speed, you need to enable it under RCC settings before you can change the value.

You can use the internal oscillator (HSI). The drawback is that it's less accurate.

If you feel a post has answered your question, please click "Accept as Solution".

As I recall this L4 has a MSI clock sources as well as the HSI, and the MSI starts the part.

The MSI can be trimmed via the LSE (32.768 KHz) crystal.

Things like CAN and USB need an accurate clock source, as do things like radio/networking applications. If you have an existing clock source, like a TCXO, you can use that in many cases.

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

The L412K has no HSE OSC_IN/OSC_OUT pins. But is has LSE OSC32 pins and you can use a 32768 Hz crystal or oscillatot to (PLL?) control MSI.

But the datasheets could be more specific about what the LSE controll of MSI can achieve.