[Dprglist] Encoder decoding

David Anderson davida at smu.edu
Tue Feb 9 20:42:47 PST 2021


Howdy DPRG

As mentioned in the RBNV this evening,  Dave Ackley forwards the following logic table for decoding
quadrature encoder which are triggered on rising and falling edges of both A and B channels using XOR.


Channel A, rising edge.                XOR    Action
              Forward:  A = 1 and B = 1  0 => decrement \
              Reverse:  A = 1 and B = 0  1 => increment  \
                                                          \ Channel_A_Any_Change:
Channel A, falling edge.                                 /  If ( channel_A  ^ channel_B) count++;
              Forward:  A = 0 and B = 0  0 => decrement  /  else count--;
              Reverse:  A = 0 and B = 1  1 => increment /

------------------------------------------------------

Channel B, rising edge.
              Forward:  A = 0 and B = 1  1 => decrement \
              Reverse:  A = 1 and B = 1  0 => increment  \
                                                          \ Channel_B_Any_Change:
Channel B, falling edge.                                 / If ( channel_A  ^ channel_B) count--;
              Forward:  A = 1 and B = 0  1 => decrement  /  else count++;
              Reverse:  A = 0 and B = 0  0 => increment /

Thanks Dave.

cheers!
dpa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dprg.org/pipermail/dprglist-dprg.org/attachments/20210209/19a7698a/attachment.html>


More information about the DPRGlist mailing list