Skip to main content
Graduate
August 22, 2024
Question

TIMER1 STM32F411 Resync

  • August 22, 2024
  • 1 reply
  • 682 views

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.

    1 reply

    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
    Graduate
    August 22, 2024

    Thanks Jan, 

    I made a mistake, RESET mode is working.