Skip to main content
Anand Ram
Associate III
Apr 19, 2021 1:51 PM UTC
Solved

HRTIM - High Resolution Timer

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

can i get sample code for HRTIM .

This topic has been closed for replies.
Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
Apr 19, 2021 3:06 PM UTC

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.

4 replies

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
Apr 19, 2021 3:06 PM UTC

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
Anand RamAuthor
Associate III
May 2, 2021 10:15 AM UTC

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

Peter BENSCH
ST Technical Moderator
May 3, 2021 7:38 AM UTC

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
Visitor II
May 11, 2021 5:22 AM UTC

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