cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER1 STM32F411 Resync

vbesson
Associate III

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

 

2 REPLIES 2

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

Thanks Jan, 

I made a mistake, RESET mode is working.