Author Topic: are there ICs debouncing switches?  (Read 1088 times)

0 Members and 1 Guest are viewing this topic.

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 2036
  • Country: fi
    • My home page and email address
Re: are there ICs debouncing switches?
« Reply #25 on: October 27, 2020, 01:02:41 pm »
I can't believe anyone would do hardware denounce when firmware is an option.
Robustness.  Increasing complexity increases long-term maintenance costs proportionally more.  That's why I suggested a separate microcontroller for button handling.

The Padauk approach seems optimal to me: low price, one-time-programmable, enough resources to handle the buttons and encoders you have pins for.  However, it is nontrivial to write the software needed, as there is no hardware UART or SPI, and there is very little ROM or RAM; you don't always have access to capable enough programmers.  So, for a small run of devices, RC debouncing could result in better end result, given the resources available.

Thinking about this from a programmer point of view, I'd use a SPI daisy chain, with SCK, DI, DO, and a latch pulse, so a MCU could handle any number of buttons and encoders using just four pins.  Each byte would contain either the state of four buttons, or a rotary encoder (with a switch).  The button states would be 00=Open, 01=Pressed, 10=Released, 11=Autorepeat, and the rotary encoders would be 6-bit two's complement, with the switch state in the low two bits.  This way, the MCU would not need to scan them very often, as they would report the change since the last scan, and the MCU side would be as simple and robust as possible.
« Last Edit: October 27, 2020, 05:01:20 pm by Nominal Animal »

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo