2023-11-26 03:09 PM
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
2023-11-26 05:39 PM
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.
2023-11-27 01:00 AM
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.
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.
2023-11-27 05:31 AM
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