Author Topic: Hardware debouncing  (Read 10780 times)

0 Members and 1 Guest are viewing this topic.

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 8366
  • Country: us
  • Retired, now restoring antique test equipment
Re: Hardware debouncing
« Reply #50 on: January 28, 2021, 09:15:42 pm »
Interesting that no one has addressed the issue of operation as the board powers up.  With the cap in the circuit it will take an RC time (approx) to charge up if that is the resting state of the circuit.  So an MCU that comes out of reset quickly may see an initial (phantom) button press at start up.  This happens if the switch is across the cap, discharging it when pressed.  That is a reason to use the diode perhaps.  However, if the switch is on the side of the circuit that charges the cap when pressed this is not an issue.

I've seen these conversations rage on and on arguing over many configurations and many circuit and operational details.  There is no one answer to the problem.  They all have limitations or require extra parts or function better or worse.  Choose your poison.

That can also be a problem with the R-S flipflop/SPDT switch circuit if the switch is momentary in both directions.  However, if the switch has no center position and is not momentary, the power-on state is well-defined by the position of the switch on power-up.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3871
  • Country: de
Re: Hardware debouncing
« Reply #51 on: January 29, 2021, 08:42:09 am »
C'mon, don't embarrass yourself...
Bye

 :palm: In other words, no arguments so we resort to ad-hominem.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19919
  • Country: gb
  • 0999
Re: Hardware debouncing
« Reply #52 on: January 29, 2021, 02:40:29 pm »
It looks like semi transparent deposition, so there is very little metal.


It looks like a Lichtenberg figure. Very weird. I've not seen one of those on a switch before.
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 701
  • Country: gb
    • Electronic controls
Re: Hardware debouncing
« Reply #53 on: February 23, 2021, 12:45:49 am »

btw I don't know how easy it can be to handle multiple push-button using sw debouncing.

Software de-bouncing is easy.
If switch is active low.
Look for first low.
Then starting looking for a high every 1ms.
Once its high for 20 cycles assume switch no longer pressed.
Been doing it that way for 40 years !

 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 9384
  • Country: gb
Re: Hardware debouncing
« Reply #54 on: February 23, 2021, 12:52:30 am »
It looks like semi transparent deposition, so there is very little metal.


It looks like a Lichtenberg figure. Very weird. I've not seen one of those on a switch before.
Right. Has that switch suffered a major ESD event?
 

Online wraper

  • Supporter
  • ****
  • Posts: 17581
  • Country: lv
Re: Hardware debouncing
« Reply #55 on: February 23, 2021, 01:03:06 am »
It looks like semi transparent deposition, so there is very little metal.
It looks like a Lichtenberg figure. Very weird. I've not seen one of those on a switch before.
Right. Has that switch suffered a major ESD event?
I don't think it a switch, just something else with the same silver dendrite growth problem. I found this picture on internet. I should have photos of actual faulty switches I made years ago but could not find them after searching for 20-30 minutes. It has nothing to do with ESD, its silver dendrites growing over time. A thread where monitors failed with the same problem: https://www.eevblog.com/forum/repair/repair-of-acer-h223hq-monitor/msg3475800/#msg3475800
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 701
  • Country: gb
    • Electronic controls
Re: Hardware debouncing
« Reply #56 on: June 03, 2021, 03:31:09 am »
I cant say that in 40 years of using microcontrollers i have ever used hardware de-bounce.
Its just so simple to do in software and save the cost and pcb space of the extra components.



 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf