How to restart counter of a timer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-24 8:49 AM
Hello All,
I'm using a STM32H743, and I would like on runtime from a GPIO IT, restart to zero the counter period of a timer, is it possible ?
How to do that ? I havn't found API for that.
Thanks.
Labels:
- Labels:
-
STM32H7 series
-
TIM
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-24 9:00 AM
The counter register can be directly accessed and modified.
TIM1->CNT = 0;
Or if you really want to use HAL:
__HAL_TIM_SET_COUNTER(&htim1, 0);
If you feel a post has answered your question, please click "Accept as Solution".
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-12-24 9:17 AM
Thank TDK, I gonna test that
