Go Down

Topic: rotary encoder (Read 2 times) previous topic - next topic

dc42

Sure, you can use 2 interrupts to manage a rotary encoder, but it is a bit of a waste of interrupts. I poll rotary encoders every 1 to 2 milliseconds instead, which also allows me to multiplex them (I've just completed a design that uses 3 rotary encoders multiplexed on to 2 input pins). You can find the code I use at http://miscsolutions.wordpress.com/2011/10/16/five-things-i-never-use-in-arduino-projects/.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

JoeN


Sure, you can use 2 interrupts to manage a rotary encoder, but it is a bit of a waste of interrupts. I poll rotary encoders every 1 to 2 milliseconds instead, which also allows me to multiplex them (I've just completed a design that uses 3 rotary encoders multiplexed on to 2 input pins). You can find the code I use at http://miscsolutions.wordpress.com/2011/10/16/five-things-i-never-use-in-arduino-projects/.


I have a circuit that uses a couple of flip-flops and a counter that keeps the rotary encoder count without any processor involvement and you can get back to it once a second or once a minute, whatever works for you, but it takes a bunch of extra chips.  My first project I am going to do with a CPLD when I get that figured out is to put this circuit into my CPLD and hopefully give it multiple channels.
I have only come here seeking knowledge. Things they would not teach me of in college.

kf2qd

US Digital sells a chip that connects to the encoder and has a count up, count down output.

JoeN


US Digital sells a chip that connects to the encoder and has a count up, count down output.


Damn it, they stole my idea!  Or I stole their idea.  One or the other.  That was going to be my first CPLD project, now it will have to be better than their implementation (larger count or more channels at least) or I need a new project.

Link to this chip?
I have only come here seeking knowledge. Things they would not teach me of in college.

JoeN

Found it.  http://usdigital.com/products/interfaces/ics/lfls7083

Quote
The LSI Computer Systems LFLS7083 allow incremental shaft encoders to drive standard up/down counters. Connect the encoder quadrature outputs to the A and B inputs. The LFLS7083 outputs can connect directly to the up and down clock inputs of counters such as 74193 or 40193.

The next generation Encoder to Counter Interface chips are now available and recommended for new applications (DIP package, LFLS7183 / LFLS7184, or SOIC package, LFLS7183-S / LFLS7184-S ).


Well, that is not super impressive.  This is my circuit, without the 74193 counters.  Which means it is replacing two flip-flops and an inverter.  I think I can do better. :)
I have only come here seeking knowledge. Things they would not teach me of in college.

Go Up