Skip to main content
Graduate
July 25, 2024
Solved

What is the default timer clock frequency of APBx bus?

  • July 25, 2024
  • 2 replies
  • 1279 views

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

    This topic has been closed for replies.
    Best answer by waclawek.jan

    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

    2 replies

    Technical Moderator
    July 25, 2024

    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 

     

    Super User
    July 25, 2024

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

    JW

    Graduate
    July 25, 2024

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

    Super User
    July 25, 2024

    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