Skip to main content
Senior
August 22, 2024
Question

TIMER1 STM32F411 Resync

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

 

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
August 22, 2024

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

vbessonAuthor
Senior
August 22, 2024

Thanks Jan, 

I made a mistake, RESET mode is working.