Skip to main content
Graduate
April 18, 2024
Solved

G431 - reset counter and prescaler on input capture

  • April 18, 2024
  • 1 reply
  • 1024 views

Is there a way to reset the counter and the prescaler via a hard event or something when an input capture happens?

I use timer 1 to have a hall interface and to drive timer 8. But there are some fluctuations, because the interrupt (where i reset counter and prescaler) is not fired at the exact time as the input capture happens.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    > Is there a way to reset the counter and the prescaler via a hard event or something when an input capture happens?

    No; but you can set input capture and TRGI to the same source (or you can set input capture upon TRGI), and then use the slave-mode controller:

    waclawekjan_0-1713452801185.png

    JW

    1 reply

    Super User
    April 18, 2024

    > Is there a way to reset the counter and the prescaler via a hard event or something when an input capture happens?

    No; but you can set input capture and TRGI to the same source (or you can set input capture upon TRGI), and then use the slave-mode controller:

    waclawekjan_0-1713452801185.png

    JW

    TobeAuthor
    Graduate
    April 18, 2024

    I would not consider this as a "no", since it actually works ;)