Answer the question
In order to leave comments, you need to log in
How to get the value of the CNT register of the timer if master/slave reset mode is used?
Greetings!
There is a task - counting the number of impulses per unit of time.
I did this:
the TIM3 timer counts the time, generates an interrupt when it overflows, in the interrupt I check how much TIM2 counted through the CNT register
, the TIM2 timer is set to external clocking from the foot (it counts these pulses), while it is a slave of TIM3 and when TIM3 overflows it is reset ( reset mode).
The problem is that when TIM3 overflows, the CNT counter of TIM2 is also reset and, of course, I always get 0 in the interrupt.
Question: how to set it up correctly so that I can read the CNT value in the interrupt?
PS Yes, you can not configure TIM2 as a slave and reset the counter manually, but I want all this to be done automatically.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question