Skip to main content
filippo2991
Associate III
March 8, 2011
Question

stm32f101 changing cpu clock on the fly

  • March 8, 2011
  • 1 reply
  • 630 views
Posted on March 08, 2011 at 15:08

stm32f101 changing cpu clock on the fly

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    May 17, 2011
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..