Electronic – How is a simple push button implemented in professional grade electronics

button

I just want to ask how is one of the basic components of electronics a push button implemented in professional grade equipment?

The most basic of a tactile switch circuit might look like this:

enter image description here

This itself is good enough in theory, but we know that in practice we will encounter some problems; such as switch bounce. It can solved by adding capacitors on the switches, adding a delay in your code and checks again if it was a valid press, or doing both. This solution is simple and easy to do, and is the go to of almost everyone doing DIY.

Now for my question, how do big companies where a button not registering could mean bad PR for their products and their brand. Examples of what I mean are, iPhone's (or other phone brands) home and volume button (6 plus and older on iPhones), keyboards, mice, arcade games, etc.

Here are some of specific questions on my mind:

  • on high end keyboards that has "anti ghosting", how did they implement this anti ghosting feature? Is this done in hardware or software or both? Are they still using a matrix of buttons to save some space on the keyboard chip?
  • Is there an IC for buttons that handles everything (or most), pull down/ups, capacitors, multiple button press, or some other feature, that just send a very clean signal to your controller chip/computer?
  • In software what are best practices in registering a button press, rising/falling edge, the classic approach, interrupts?

Best Answer

First of all, bear in mind that all the approaches you cite are valid, it all depends on a lot of variables such as cost, space, already validated solutions, and so on.

To get to your questions:

  • I assume anti ghosting is some sort of feature that avoids registering double strokes, when the user only did a single stroke. But what is a double stroke? There is a time limit below which you say that the double stroke is invalid, e.g. 100 ms -> this is done in software.
  • yes, keys are organized in a matrix to save IOs. Keyboard controllers are IO limited, i.e. the silicon itself can be very small, but you need the IOs, so the full solution will be big (silicon + package). Matrix means less IO means less space means more money for your company
  • there are keyboard controllers with USB connection on one side, and 10x10 or 10x12 matrix on the other side, they take care of everything
  • best practice depends on what is best for your case, rising or falling edge depends if you want an action to happen on keypress, or key release. Interrupts is usually the way to go, but polling is acceptable in many cases too... Again, it all depends.