2008-10-09 08:11 PM
up down counter with TIMx
2011-05-17 03:39 AM
Hi,
I'm developing a two channel application that require to increment a value if a impulse is received on a channel and decrement it if it is received on the other channel. Is it possible to use the TIMx interface to work like an up-down counter? It seems that the encoder interface and the external clock source mode X don't allow this. Any idea? Thanks utelettronico2011-05-17 03:39 AM
I resolved this issue using a channel as external clock and the other one as interrupt input that changes the TIMx direction bit.
I think the Encoder Mode 1 and 2 are completely useless. These configurations simply halve the counting of an incremental encoder. So you still need two signals in quadrature, but differently from Encoder Mode 3 the counter is incremented only on the rising/falling edge of one channel, the other one is used only to avoid glitch. Thank you