up down counter with TIMx
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2008-10-09 8:11 PM
Posted on October 10, 2008 at 05:11
up down counter with TIMx
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:39 AM
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 utelettronicoOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 3:39 AM
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