2025-05-16 9:15 AM
Hi,
I used to run my STM32F303RE at 72Mhz clock from a 8Mhz CMOS oscillator. . Timers8/1 operated at 72Mhz as well. That worked fine.
I had to change the CMOS oscillator from 8 to 24Mhz.
I tried two modifications, see attachment:
a) I changed PLLMul from x9 to x3 and left PREDiv. at /1.
b) I changed PREDiv to /3 and left PLLMul at x9.
In both cases CubeIDE clocktree was fine with the setup, 72Mhz imput clock at Timers8/1.
Eventually now the input clock of the timers is low by factor 9, it is 8Mhz.
What did I miss?
Thank you.
Cheers
Detlef
2025-05-16 9:37 AM
Yes, sounds odd, not sure if we're missing some detail.
If you're using an XO (External Oscillator), rather than a crystal, you should be using HSE_BYPASS mode.
The Classic F3 architecture doesn't allow for different TIMCLK sources (Peripheral Clocks)
2025-05-16 12:18 PM
>Eventually now the input clock of the timers is low by factor
I dont unterstand: how you know, what is the real timer clock now? And changing HSE and adapt divider will not change the timer clock.
2025-05-16 2:18 PM
Hi,
I know the real timer clock by routing the output of the timer to an output pin and hooking up an oscilloscope or a counter. This works fine since decades.
I don't know how to bypass HSE input logic, this block is grayed out, maybe there are switches which are not available with CubeIDE.
I just realized another weird aspekt: the baudrates for USART2 work fine, so the USART seems to have the exspected clockrate. I will check the clock frequency for the processor kernel with SYSTICKS, maybe the problem is limited to the counters.
THX
Cheers
Detlef