Hi guys,
I may be stating the obvious but if you trip the interrupt off of the rising edge of one channel you're effectively dividing the resolution of the encoder by 4. To get the full resolution you need to count all edges of the quadrature cycle.That interesting but I repeat, int on A, on interupt read B, if it is c/w if 1 it is ac/w it is 0 (or the other way round).
There are two types of encoders with detents typically used as front-panel controls. One have a full quadrature cycle per detent and using the "interrupt on rising edge of one channel" method can work with these but what you think might be noise on the signal could (and probably is) the second rising edge on the A-signal within the same quadrature cycle. The divide by 4 "issue" doesn't really apply here because you basically can't position the encoder between two detents. Another possible issue though is that when the encoder "clicks" from one detent to another a full quadrature cycle is output. If the interrupt latency is "highish" the firmware might not actually "catch" channel B quick enough. Catching it at the wrong time results in it counting the wrong way.
The other type of encoder have one detent per quadrature state. Using the "interrupt on rising edge of one channel" method with this type will result in the software detecting every 4th click, skipping the other 3.
/Henrik.
Bookmarks