Skip to main content
Tobe
Senior III
April 18, 2024
Solved

G431 - reset counter and prescaler on input capture

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.
waclawek.jan
waclawek.janBest answer
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

2 replies

waclawek.jan
waclawek.janBest answer
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

Tobe
TobeAuthor
Senior III
April 18, 2024

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