Multiple momentary switches to automatic alternate toggle latching outs

MisterBill2

Joined Jan 23, 2018
6,757
Excellent points for me to consider. I respect your opinion and apologize for using nasty comments (they’re gone from my original post).

And I’m the person who mentioned fuses. As an example that using different terms is not an Arduino-only “problem”. From the point of view of a noob, I would find that confusing, too.
My complaint is mostly driven by projects that claim to support learning but give not a single word about the electrical things happening, and only cover following the given software. Any computerized system needs to interface with the real world to be useful, even if that interface is a screen. And not mentioning that an output sources current to switch on a transistor is common to some of us, to others it is still some sort of magic function.
 

djsfantasi

Joined Apr 11, 2010
6,721
As far as debouncing goes, I’m right with you.

I have a project similar to the situation @crutschow described. The switch press drives logic which latches the state after the press. The time through the logic was an order of magnitude less than switch bounce. Worked perfectly without debouncing.

Another project, the switch press kicked off a process that took seconds. During that time, the switch was ignored. Again, no need to debounce the input.

However, the project I’m working on now, each press triggers an interrupt, which toggles an action. Here, the bounce would start and stop an action multiple times, servos would shake and LEDs would flash and worst of all, the final state of the output would be indeterminate. Debounce!
 

AnalogKid

Joined Aug 1, 2013
8,540
You've really tried the actual circuit will all those different logic families?
Yes. LS at the TV station in the 70's, and CMOS in a university research project in the early 80's. HC was prototyped, but that design was built with AC in multiple projects starting in the 90's, first industrial then MIL. I think the last one was in 2011(?).
The only possible disadvantage I can see with your circuit in post #16 is that you can't use an N-MOSFET if you need to boost the output current.
Yeah, for that you need to flip the switch polarity and add an inverting transistor before the clock input, as in your sim (and other posts of mine somewhere. So many fora ...).

ak
 
Last edited:

MisterBill2

Joined Jan 23, 2018
6,757
As far as debouncing goes, I’m right with you.

I have a project similar to the situation @crutschow described. The switch press drives logic which latches the state after the press. The time through the logic was an order of magnitude less than switch bounce. Worked perfectly without debouncing.

Another project, the switch press kicked off a process that took seconds. During that time, the switch was ignored. Again, no need to debounce the input.

However, the project I’m working on now, each press triggers an interrupt, which toggles an action. Here, the bounce would start and stop an action multiple times, servos would shake and LEDs would flash and worst of all, the final state of the output would be indeterminate. Debounce!
OK, in an instance where an input triggers an interrupt things are quite different. That is why hardware and software both must be carefully worked out in the early design stages of a project. And that is where an input simply setting a bit, not toggling it, can be a very powerful help. At that point either ACK or Nack can reset the bit, depending on what the required action needs to be. But certainly all interrupt request inputs need to be treated carefully simply because of what they are.
 

crutschow

Joined Mar 14, 2008
25,269
I just realized the power-on reset circuit I used in my post #15 circuit may not reliably work. :oops:
Trying to come up with a better circuit that's still simple------
 
Top