cancel
Showing results for 
Search instead for 
Did you mean: 

What is the default timer clock frequency of APBx bus?

overbite8934
Associate II

What is the default timer clock frequency of the APBx buses on an STM32F410RB? I've been considering it to be 16MHz to calculate the frequency of my PWM wave, but it turns out I get half the frequency on scope (is the default clock at 8MHz for timers? I have not altered clocks, and I'm using TIM5_CH1).

1 ACCEPTED SOLUTION

Accepted Solutions

If you've programmed the timer so that its period is say 1ms, and there is one toggle per period, the output is high for 1ms and then low for 1ms, that's 2ms total period of the output, i.e. 500Hz.

JW

View solution in original post

4 REPLIES 4
STTwo-32
ST Employee

Hello @overbite8934 

This values depends on the system clock source (HSI, HSE, PLL). It also depends on the values of the prescalers (APBx prescaler for example). I suggest you to refer to all those configurations on your code and take a look at the Clock tree on the reference manual of your product (or even throw CubeMX) to understand how you need to set each parameter to have the values that you are looking for.

Best Regards.

STTwo-32 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

My crystal cube says, you are using Toggle mode in the timer. 

JW

That's true! How does that affect the frequency? I have no idea! :(

If you've programmed the timer so that its period is say 1ms, and there is one toggle per period, the output is high for 1ms and then low for 1ms, that's 2ms total period of the output, i.e. 500Hz.

JW