Search the Community
Showing results for tags 'rotary encoders'.
Found 1 result
I worked on a new servicing routine for my kit oscilloscope's quadrature rotary encoder, and decided to write it all up and post it on Github. Included are routines for periodic polling and for pin-interrupt servicing. Hardware switch debouncing is not needed. The routines are for general use, but I wrote testing code for the MSP430G2231 installed on the Launchpad. The scope guys have used the "lookup table" state transition routine that most people use today, but it doesn't work very well on the scope, and I haven't found it to work very well generally. My routines are designed to avoid all effects of switch bouncing, and seem to work very well and efficiently. Everything is explained in the PDF file in the repo. All the testing code is also included, both source code and executable hex files, and I'm afraid it's all in assembler. But I hope it wouldn't be too difficult to create Energia versions if anyone is interested. I've provided hex files for both types of encoders - those with the same number of pulses as detents per revolution, and those with half as many pulses as detents. The code produces one "tick" per detent in both cases. https://github.com/gbhug5a/Rotary-Encoder-Servicing-Routines