cancel
Showing results for 
Search instead for 
Did you mean: 

Clock frequency for STM32F303

DetlefS
Associate III

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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)

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

5 REPLIES 5

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)

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

>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.

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

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

Dear @DetlefS ,

it may happen that Timers are clocked by 72MHz directly from PLL output, but system clock mux is selecting HSI clock at 8MHz , you can check that by outputting the main MCO clock on PA8 and see the CPU and APB clocks . Hope it helps you.

STOne-32

DetlefS
Associate III

Hi,

bypassing HSE was the solution, thank you.

It was grayed out in the clock tree selection window and it took me a while to find it in PinoutConfiguration -> SystemCore -> RCC  -> HSEbypass.

Changing the clock configuration on the fly is challenging as well with PLL sync issues and CSS kicking in.

But now it is working, thx.

Cheers

Detlef