Skip to main content
utelettronico
Associate II
October 10, 2008
Question

up down counter with TIMx

  • October 10, 2008
  • 2 replies
  • 664 views
Posted on October 10, 2008 at 05:11

up down counter with TIMx

    This topic has been closed for replies.

    2 replies

    utelettronico
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:39

    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

    utelettronico
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:39

    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

    utelettronico