2024-07-24 10:47 PM
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).
Solved! Go to Solution.
2024-07-25 01:34 PM
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
2024-07-24 11:16 PM
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.
2024-07-24 11:26 PM
My crystal cube says, you are using Toggle mode in the timer.
JW
2024-07-24 11:37 PM
That's true! How does that affect the frequency? I have no idea! :(
2024-07-25 01:34 PM
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