[sdiy] Rotary encoder reading.. hardware solution (fast & accurate)
modular at go2.pl
Thu Aug 12 12:53:13 CEST 2021
One time, like decades ago I had an idea to use CD4029 reversible
counter as interface beteen rotary encoder and uC. The pulses from the
encoder are obviously filtered with RC and fed to Schmitt gates, then
one encoder end goes to clock of 4029, the other to U/D (direction) pin.
So depending on rotation direction the counter would count up or down.
And it can count up to 8 pulses before uC will read it and reset to 0
with each read. This gives some more time between polling counter state.
That was when Z80 running at 2MHz was top of my accessible possibilities
so may look silly today.
W dniu 2021-08-11 o 22:27, Jean-Pierre Desrochers pisze:
> For anybody who could be interested..
> Just found this video yesterday and tried the circuit..
> Outputs A and B (CD4013) connected to PORTB of a PIC16F1783
> (RB0 and RB1) using interrupts on change (rising edges).
> Now I only have to check one incoming pulse on each RB0 & RB1
> to increment or decrement a counter.
> Much faster than computing all the 4 possible states in each encoder step
> to finally get a result.
> My interrupt uses TIMER1 (1msec steps), RB0 & RB1 on change.
> No missing counts anymore even rotating fast, on both direction.
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> Selling or trading? Use marketplace at synth-diy.org
More information about the Synth-diy