Skip to main content
Graduate
November 26, 2023
Question

STM32H723ZG Timer1 Source clock

  • November 26, 2023
  • 3 replies
  • 1419 views

Hey

I try to work with the Timer1 in interrupt mode. I saw that Timer1 is belong to APB2 BUS. 
I configure my source clock to the TIMER1 to 96MHz (picture1),at APB2 Timer Clocks But I saw that the frequency is match to the number on APB2 Peripheral clock (48MHz). (In the interrupt I toggle gpio pin and I measure the frequency with oscilloscope)

I try to change the frequency and the configuration of the timer but I still get resault that match to APB2 Peripheral clock label and not to APB2 Timer Clocks.

I don't understand what is the source clock of the timer.

Thank you very much

picture1.jpg

    This topic has been closed for replies.

    3 replies

    Super User
    November 27, 2023

    The clock display in CubeMX is correct.

    What is the calculation you are doing that is leading you to believe it is incorrect?

    > In the interrupt I toggle gpio pin and I measure the frequency with oscilloscope

    Note that interrupt speed is going to be limited by cpu availability. Try to stay below tens of kHz for interrupt frequency.

    Technical Moderator
    November 27, 2023

    Hello @TOsso.1 

    According to the reference manual, the frequency of the timer's clock depends on the APB prescaler corresponding to the bus to which the timer is connected, and on TIMPRE bit. Check Table 53. Ratio between clock timer and pclk.

     

    Super User
    November 27, 2023

    Also note, that if the timer's period is 1/f thus interrupt's frequency is f and you toggle a pin in the interrupt once, then the resulting waveform on that pin has frequency f/2.

     

    JW