On Thu, Apr 6, 2017 at 8:28 AM, David C Brown wrote: > I usually use a look-up table to decode the x4. Either interrupt on eve= ry > edge or sample at an appropriate rate. Then use the previous and present > values as indices to a 16 entry table which returns 1 for clockwise, -1 f= or > anti-clockwise and 0 for illegal transitions > Also a good mechanism for some applications. "Sample at appropriate rate" has never worked out for me on feedback applications, but front panel user input applications it works very well. Basically, assume it _will_ miss a transition now and then. For a user interface, that's usually a non issue, for motion feedback that can be a non issue or a deal breaker depending on app. I've also extended the "concatenate previous and present values, use them as an index in a lookup table" to use the three phases from the hall sensors of brushless motor as an encoder. Works quite well. -Denny --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .