2021-12-24 08: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.
2021-12-24 09: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);
2021-12-24 09:17 AM
Thank TDK, I gonna test that