@cmartinez, everyone is going to disagree with me -- but you don't need to debounce a mechanical encoder. I've posted solutions that work here:
https://forum.allaboutcircuits.com/threads/another-pic-trick-quadrature-rotary-encoders.64318/
and here:
https://forum.allaboutcircuits.com/threads/pretty-good-weekend-effort.147311/post-1274688
Edit: The whole point of Gray Code is that only one bit switches (potentially with noise) at a time. A quadrature encoder has a two bit Gray coded output.
https://forum.allaboutcircuits.com/threads/another-pic-trick-quadrature-rotary-encoders.64318/
and here:
https://forum.allaboutcircuits.com/threads/pretty-good-weekend-effort.147311/post-1274688
Edit: The whole point of Gray Code is that only one bit switches (potentially with noise) at a time. A quadrature encoder has a two bit Gray coded output.
Last edited: