Here is my version of the quadrature decoder with a button switch custom component (QudDec_SW), which was designed for interfacing of rotary shaft encoders to PSoC4 and PSoC5. It has been created out of necessity to save hardware resources in projects with limited or exhausted UDB/PLD space. The stock PSoC5 QuadDec component with hardware debouncer are consuming three Datapath cells per single encoder, which is too much for a device which remains idle for most of the time.
The QuadDec_SW component is implemented entirely in software, without using any UDB resources. It is sufficient for hand-operated rotary shaft encoders for non-critical operations such as scrolling menu or updating parameters.
The QuadDec_SW component has several options
Returns position and direction of rotation.
Optional 8-bit, 16-bit, 32-bit, single or double position range.
Optional button switch with debouncing.
Optional increment step size.
Optional range limits.
Uses interrupt or polling technique.
Attached archive contains component library, several demo projects for PSoC5 and PSoC4, a component datasheet, Application Note and algorithm description paper. Please read installation instructions in the readme.txt. Since the Community Components forum is no longer exists, it is being posted here, PSoC5 forum, as the most relevant place to be.
The component provided as-is, no liabilities. It is free to use and modify.
YouTube demo: using QuadDec_SW with DDS24 signal generator
This is awesome! It makes many of the issues with Quad Encoders for this type of application MUCH easier.
I'm currently trying to use this in a project with a 4 Line LCD. It is working pretty well except that I get some "extra lines" of characters when the menu is scrolled down to the last menu item. Any hints on how to deal with this? i.e. The two actual LCD menu items are displayed on lines 0 and 1, so I'd like to blank out lines 2 and 3.