STM32 timer ETR mode + slave reset
Hi,
I need to periodically count the number of pulses of signal A between two rising edges of signal B. For that I use a timer (TIM2) in ETR mode (signal A is the ETR input), input capture on signal B and slave trigger+reset on signal B rising edge.
Now I see the following problem: if both signals are in sync (e.g. B = A div 4) there is consistently one edge lost during the counter reset. I.e. the counter counts up to 3, not up to 4. Clearly, it is not the best idea to count pulses of the two signals with 0 phase shift, however I would assume that if the counter incremented during the reset it would add up to the next period of B. That does not seem to happen. I assume that is perhaps due to the internal synchronization of the two signals, each going through a different path.
Can someone please shed a bit more light upon it and possibly suggest how to get around it if the signals are in sync.
Thanks
Petr
