cancel
Showing results for 
Search instead for 
Did you mean: 

Code Examples

odissey1
Honored Contributor II

Hi,

Provided below is custom implementation of the button switch debouncer component (ButtonSw32). The component uses vertical stack counters algorithm to detect button pressed and released events, and can simultaneously process up to 32 switches without loss of performance.

Component can be useful whenever a simple button switch event need to be detected by PSoC with high reliability, such as control switches, panel-mounted momentary buttons, mechanical joysticks, etc. Component is useful when PSoC hardware debouncing is not justified for handling simple switch button, or for a system with limited hardware resources, such as PSoC4.

The component was tested using CY8KIT-059 PSoC5 prototyping kit and CY8KIT-042 PSoC4 Pioneer Board. Several demo projects are provided alongside the Application Note.

Component major features:

      Implements vertical counters algorithm.

      Detects button pressed and released events.

      Detects simultaneously up to 32 buttons.

      Does not consume hardware resources.

Attached archive contains component library, component datasheet and several demo projects for PSoC5 and PSoC4. Please read installation instructions in the readme.txt.

The component provided as-is, no liabilities. It is free to use and modify.

regards,

odissey1

Screenshot_1.png

ButtonSw_basic_1b.png

=============================================================================

=============================================================================

P.S. Another useful component for HMI can be found here:

Quad Decoder with Button Switch component for rotary shaft encoders

encoder_01b.png

4 Replies
RaAl_264636
Contributor II

Hello odissey1,

cool component, many thanks for that.

In the component datasheet, how did you create the timing diagrams? On a first look I thought it was InkScape with TimeInk extension, but I doubt that this is true.

Regards

0 Likes
odissey1
Honored Contributor II

Ralf,

They are more like a "handmade". A numerical table was manually created in IgorPro, plotted and exported as metafile. Quite tedious and error-prone.

/odissey1

0 Likes
jepaz
New Contributor II

this is such a good idea! thanks for sharing!!

0 Likes
odissey1
Honored Contributor II

You are welcome. 

/odissey1

0 Likes