cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f101 changing cpu clock on the fly

filippo2991
Associate II
Posted on March 08, 2011 at 15:08

stm32f101 changing cpu clock on the fly

1 REPLY 1
Posted on May 17, 2011 at 14:27

What about the USART/SPI? Do I need to reconfigure them after changing clock speed? (As I do for systick prescaler) How can I do it quickly?

Since they are tied to the PCLK's of course you are going to have to change them if their source changes. Just update the baud rate registers. Which will obviously be easier if you just touch the registers rather than using the library. You could either use precomputed constants if you only have two speeds, or calculate them on the fly if you want a more variable clock speed.

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