cancel
Showing results for 
Search instead for 
Did you mean: 

HRTIM - High Resolution Timer

Anand Ram
Associate III

i wish to use HRTIM as general purpose timer with high resolution.

can i get sample code for HRTIM .

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

You will find sample code in the repositories for STM32, e.g. on Github in some examples for NUCLEO-G474RE.

When your question is answered, please mark this topic as Answered by choosing Select as Best. This will help other users find that answer faster.

Good luck!

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

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

You will find sample code in the repositories for STM32, e.g. on Github in some examples for NUCLEO-G474RE.

When your question is answered, please mark this topic as Answered by choosing Select as Best. This will help other users find that answer faster.

Good luck!

/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.
Anand Ram
Associate III

i want to use HRTIM for general purpose timer with high resolution.

i dont fid the examples for time like, start and stop and get-time

Please take a look at the AN4539 - HRTIM cookbook.

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.
JRudo.1
Associate

Hi Anand,

I use all 12 HRTIMs channels in my NUCLEO-G474RE port of MIcroPython.

https://forum.micropython.org/viewtopic.php?f=3&t=9082

This is a high resolution PWM application where I use a custom modg4ex.c to add HRTIM support. You can get a lot of mileage with the STM32CubeMX app to generate the initial 'C' code. The CubeMX generates brute force inline code for each channel so you need to refactor it into subroutines to shorten it up. The G474 is still a new beast so the cookbook and examples are of limited help.

best regards, RealSparky from the micropython forum