2024-08-22 05:35 AM
Hello,
I have a signal that is coming to a GPIO and the period of the signal might slightly change and I need to realign a timer each time the GPIO is on rising edge.
I try to use the TIMER1 with Slave mode reset and use ETR1 as trigger source. but it is not really working the way I want
I tried as well to catch the UIF interrupt and TIM1->CNT=0 but it is creating lagging.
How to do "Reset" the timer each time I receive a GPIO pulse ? thanks
Vincent
2024-08-22 06:22 AM - edited 2024-08-22 06:24 AM
Reset/Update sets CNT=0 in hardware, so there should be no need to do that in interrupt.
Try perhaps to draw a timing diagram of what do you want to achieve.
JW
2024-08-22 01:28 PM
Thanks Jan,
I made a mistake, RESET mode is working.