2022-04-03 06:34 AM
I have project that I'm designing around an STM32F411 that 99%+ of the time will not have a USB device attached. I'd like to run at the top clock frequency of 100MHz. I see that I can not do that and use the USB device as it needs to run at 48MHz. I'd need to drive the main clock at 72MHz to achieve the desired 48MHz USB clock.
I'm wondering if I can reconfigure to the main clock to run @ 72Mhz when detection of the USB connection and revert back to 100MHz after removal.
2022-04-03 07:20 AM
You, you can reconfigure the clock at will.
If you use internal timers, you will need to be cognizant of this and just durations accordingly.
2022-04-03 08:52 AM
You can configure sysclk at 96 MHz, and USB at 48 MHz. You only lose 4%.
Only change the AHB prescaler to change sysclk only: don't touch the PLL which generate the USB 48 MHz.
2022-04-03 08:27 PM
Thank you!!
When I was letting CubeMX try to figure it out, it always forced the main clock to 72. Entering 96 into the Mian Clock works just as you stated.
Thanks again.