Skip to main content
chrkaras
Associate II
April 24, 2026
Solved

STM32H7 HRTIM clock drifting?

  • April 24, 2026
  • 2 replies
  • 118 views

Hello everyone,

 

I have a NUCLEO-H755ZIQ board and I am trying to use the HRTIM to output a 50Hz pwm signal. I hook the output to an oscilloscope and I see that the pulse has a period of 19.2ms instead of 20ms, meaning that while I have configured the clock for the HRTIM to run at 2MHz (meaning that it needs 40000 ticks to complete a period) it runs at 2.6MHz. Can anyone help me understand what am I doing wrong? I have attached the .ioc file.

 

Thanks in advance! 

Best answer by Shirley.Ye

since HRTIM has a dedicated kernel clock from RCC, you can use the MCO to output the reference clock and check if the reference clock is also wrong.

2 replies

Peter BENSCH
Technical Moderator
April 24, 2026

Perhaps someone can help you if you also attach the IOC file.

Regards
/Peter

chrkaras
chrkarasAuthor
Associate II
April 24, 2026

Hi @Peter BENSCH,

I thought I uploaded it. Sorry. Please take a look.

Thanks!

chrkaras
chrkarasAuthor
Associate II
April 26, 2026

Hello guys,

Has anyone checked out if I am doing something wrong in the chip configuration or I broke it?

Thanks again.

Shirley.Ye
Shirley.YeBest answer
ST Employee
April 27, 2026

since HRTIM has a dedicated kernel clock from RCC, you can use the MCO to output the reference clock and check if the reference clock is also wrong.

chrkaras
chrkarasAuthor
Associate II
April 27, 2026

Hi @Shirley.Ye,

After a long search, I concluded that the problem was the clock that the st-link provides. Thanks for telling me the way to validate it.