Sunday, October 22, 2023

High Prices

When it comes to attention, most people like paying as little as possible.

That can be a very high price.

A partial counter to that is having a knack for occasionaly being able to see the obvious.



Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.

Wednesday, October 18, 2023

The Switch Debounce Problem

Figuring out the switch debounce circuit was not the difficult part of the problem. That only took a few hours to solve.

The most difficult part of the problem was recognizing there was a problem. That took over 50 years.



Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.

Friday, October 6, 2023

Finding the Debounce Article

Today I did a Google search on - Eliminate SPST Debounce Delay with an SR Latch - and my blog post didn't show up even after looking four pages deep for it. It did show up, sort of, when the search term was "Eliminate SPST Debounce Delay with an SR Latch". Note the quote marks. The search results looked like this:


I expect it will be a LOT easier to find once it gets more attention from Engineers.


Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.

Tuesday, October 3, 2023

Zero Debounce Delay Is Not Possible



The above image was obtained by doing a Google search on "zero delay debounce" a few days ago. The source page says delay is required. I have designed a circuit that says it isn't so.


Zero Debounce Delay


Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.

Monday, October 2, 2023

Simon's Law of Switch Debounce

If it is not a glitch, the switch

is changing position.



Corollary

Dont confuse glitches with switches.




Zero Debounce Delay - Debouncer.


Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.

Saturday, September 23, 2023

Eliminate SPST Debounce Delay with an SR Latch


I was looking into switch debounce problems for a project I was working on that required a foot switch. I solved that problem satisfactorily but that got me looking into articles on switch bounce. I came across an 8 part series by Max Maxfield that went into the problem in depth. What I came away with from that article series is that the only reliable way to detect a switch change quickly is with a SPDT switch and an S/R Flip-Flop. Which got me to thinking - why not do that for a SPST N.O. switch? After considerable (a few hours) of intense thinking and scribbling I came up with a workable circuit using an analog gate to route the switching signal. I later reduced that to a two output digital selector. You will note that as long as the changes take place after the debounce time, both the rising and falling edges will be indicated after a short "deglitch" delay.

The final circuit looks like this. If you need a name, call it "Simon De Bouncer" or if you need something a little more descriptive "Simon 'Zero Delay' De Bouncer"

Click on image to enlarge

There is a PDF of the schematic also.

Pretty fool proof eh? An SPST switch is made to act like a SPDT by selecting the SR Latch terminal that will drive it to the opposite state when the switch changes position. The XNOR insures the logic is correct in each state. The latch terminal selected doesn't change until after debounce time.

I'm multiplexing the switch between /PRESET and /CLR. So it acts like a SPDT. When the SR Q = 1 the switch is connected to /CLR and when the SR Q = 0 the switch is connected to /PRE. After a debounce delay.

The routing of the latch control signal doesn't change until after the bouncing stops. Simulating a SPDT switch. And the XNOR insures the logic is correct (ready for an input state change) after the bouncing stops. When I priced the logic out it was under $1.50 for all the chips at single piece prices. And if you put all the logic on a chip with a lot of other circuits? Almost free.

What does that give you? A switch logic indicator that responds in about 20 micro seconds to a change in switch position. The 20 micro second delay (glitch filter) eliminates noise pulses and ESD events from changing the indicated switch position. You may be able to shorten that time or may have to lengthen it as environmental requirements dictate.

So I was discussing all this with my esteemed first mate and I said it could also be done in software. (That's what they all say, isn't it?) That gave me the idea to write up some Forth code to show how it could be done. My buddy Clyde reviewed the code and made some suggestions. It looks like this: Switch Debounce Software.

Obviously there are some (not too difficult) details yet to be filled in.

I plan to run that code on my LPC1115 board with a Forth operating system also done by my buddy Clyde. The current version of that board uses a USB C connector. The compiled Forth code for the LPC1115 is available to anyone who wants to use it. You can find it here.

So that leaves us with VHDL for the deeply embedded. An exercise best left to the reader.

You can find me on LinkedIN at M. Simon.

You can see the beginnings of my thinking for the design at Sketch A and Sketch B.



Updated 28 Sept 2023 1945z - To give a better explanation of how the circuit works.


Updated 3 Oct 2023 1153z - Jack Ganssle's switch debounce experiments ==> A Guide to Debouncing

To clarify: Simon's Law of Switch Debounce.

Updated 16 Oct 2023 1759z A trackback from Jack Ganssle's Embedded Muse.



Space-Time Productions is a participant in the Amazon Services LLC Associates Program. We earn advertising fees when you use this link Amazon.com and other Amazon links we provide.

Engineering is the art of making what you want from what you can get at a profit.