cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 HRTIM clock drifting?

chrkaras
Associate III

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! 

1 ACCEPTED SOLUTION

Accepted Solutions
Shirley.Ye
ST Employee

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.

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

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

Regards
/Peter

In order 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.

Hi @Peter BENSCH,

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

Thanks!

Hello guys,

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

Thanks again.

Shirley.Ye
ST Employee

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.

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.