Odd Biasing on a Digital Circuit

MrChips

Joined Oct 2, 2009
34,819
One thing that has not yet been mentioned is contact wetting current.
With 5V supply and 500kΩ pullup resistor, the switch only has to pass 10μA.
A 5kΩ resistor will supply 1mA which is a more comfortable wetting current. This helps to clean the contact.
 

Thread Starter

SamR

Joined Mar 19, 2019
5,491
wetting current
Now that's a new one for me. Thanks for the tip. I am using 2kΩ pullups so that gives me 2.5mA. I can see how that applies to normal contacts but is also needed for sliding contacts. I would think the sliding would give some cleaning action IF used on a regular basis and not infrequently. Something to put on my todo list.
 
Last edited:

Audioguru again

Joined Oct 21, 2019
6,826
Why are you mixing up low value resistors used with antique 74xx gates with modern 74HCxx Cmos gates that work fine with high value resistors?
Please correct your schematics to show the 74HC00 that you are using.
I agree that a switch usually has silver contacts that tarnish (turns black) and do not pass very low current anymore. Use a switch with gold-plated contacts that never tarnish and are made to switch circuits that have low current or no current (cost is the same).
 

cmartinez

Joined Jan 17, 2007
8,767
problems that can destroy the chip.
Not only that ... but I've experienced religion coming into to play ... truly evil spirits possessing the circuit doing the weirdest stuff. Until I discover the stupid, maligned and forever cursed floating input that I forgot to connect! :mad:
 

MrChips

Joined Oct 2, 2009
34,819
Now that's a new one for me. Thanks for the tip. I am using 2kΩ pullups so that gives me 2.5mA. I can see how that applies to normal contacts but is also needed for sliding contacts. I would think the sliding would give some cleaning action IF used on a regular basis and not infrequently. Something to put on my todo list.
Oh, we're not done yet.

Now you're taking 2.5mA for every switch that is shorting to GND. In low power applications that is a real power hog.
Hence you may have to find a compromise depending on the application.

In the circuit you have shown, the S-R flip-flop serves no purpose except to debounce the switch if the switch is a push-button.
If the switch is a toggle switch or slide switch you can eliminate the 74HC00 altogether.
 

WBahn

Joined Mar 31, 2012
32,864
Oh, we're not done yet.

Now you're taking 2.5mA for every switch that is shorting to GND. In low power applications that is a real power hog.
Hence you may have to find a compromise depending on the application.

In the circuit you have shown, the S-R flip-flop serves no purpose except to debounce the switch if the switch is a push-button.
If the switch is a toggle switch or slide switch you can eliminate the 74HC00 altogether.
Not if that toggle or slide switch is being used to provide a signal to a glitch-sensitive circuit. Use a toggle switch to provide the clock signal to a counter to try to single step through the process and the need for debouncing that toggle switch becomes clear real fast.

I'm guessing that claim was intended to apply only to that (or similar) circuits and not in general.
 

WBahn

Joined Mar 31, 2012
32,864
We‘ve had this discussion before: debounce or no debounce. It depends on the application.
I just wasn't sure what you were trying to convey here. At first I thought you were saying that debounce wasn't needed when using static switches. But then after got to wondering if that's really what you were saying, but I still didn't want others to be left with that impression even if it wasn't.
 

Thread Starter

SamR

Joined Mar 19, 2019
5,491
If the switch is a toggle switch or slide switch you can eliminate the 74HC00 altogether.
Yes, I did notice that! This is from an old book in PDF format of "Fun Projects for the Experimenter" by Newton Braga. Actually it is not as old as the writing style led me to believe from all the corny things he says. Circa 90s. Just something to play with when I get tired of my bookwork. Maybe learn a practical thing or two along the way. After I built the circuit and got it working, I looked at it and analyzed it and laughed and said to myself "hell all it is doing is the same as the switch, it doesn't need a flip-flop to do this". Just a bit of intellectual frou-frau reminiscent of a Rube Goldberg machine. And yes I am using an SPDT slide switch and debouncing was not the focus of this exercise.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,140
Are you using a 7400 or a 74HC00?

Historical note: The first schematic in post #17, with a true 7400 gate, will work even though it does not have pull-up resistors on the inputs to guarantee a high state when a switch throw is floating. This is because old, original TTL inputs floated high, a quirk of that quirky input stage. It was not good practice, and prone to picking up noise, but it was a known thing back in the day.

ak
 

WBahn

Joined Mar 31, 2012
32,864
Yes, I did notice that! This is from an old book in PDF format of "Fun Projects for the Experimenter" by Newton Braga. Actually it is not as old as the writing style led me to believe from all the corny things he says. Circa 90s. Just something to play with when I get tired of my bookwork. Maybe learn a practical thing or two along the way. After I built the circuit and got it working, I looked at it and analyzed it and laughed and said to myself "hell all it is doing is the same as the switch, it doesn't need a flip-flop to do this". Just a bit of intellectual frou-frau reminiscent of a Rube Goldberg machine. And yes I am using an SPDT slide switch and debouncing was not the focus of this exercise.
The intent of that circuit is not to be useful, merely educational. It is very common that we use new things to accomplish old tasks as a means of introducing them so that we can focus on what's new without having to focus on what task they are trying to accomplish. Usually the next step is to then move into territory in which the old way of doing it wouldn't quite be up to the task, such as using two momentary push buttons to show that the latch will hold its state relative to the last button pressed. Or show that it can now be used as the clock input to a counter or similar circuit without producing the glitches that the switch itself would produced. Then perhaps showing how it can be modified to that the state toggles in response to successive pushes of a single push button switch.
 

Thread Starter

SamR

Joined Mar 19, 2019
5,491
Yes, I did investigate the switching to ensurethat it was actually latching and not simply being held on by the switch.

Are you using a 7400 or a 74HC00?

Historical note: The first schematic in post #17, with a true 7400 gate, will work even though it does not have pull-up resistors on the inputs to guarantee a high state when a switch throw is floating. This is because old, original TTL inputs floated high, a quirk of that quirky input stage. It was not good practice, and prone to picking up noise, but it was a known thing back in the day.
Very interesting! I still have a few chips from the 70s (when I was building an Iambic Memory Keyer) leftover but not the 7400. I did have some SN74HCs I picked up somewhere along the way that had the 74HC00 in them. I don't think I want to invest in the antique 7400s even if I could find some. Was surprised to see what I saw as an Input on the Output of the gate so I learned something new from the exercise. Somewhere in the back of my brain is a whiff of current whetting/wetting I learned long ago but had completely forgotten about during a career dealing mostly with industrial power level voltages. Anyhoo thanks for the inputs guys, on to better things.
 

AnalogKid

Joined Aug 1, 2013
12,140
The intent of that circuit is not to be useful, merely educational.
Disagree.

That circuit is a very common way to de-bounce a switch. If logic gate operations and combinational circuits are Logic 101, this circuit is taught on the first day of Logic 102.

Consider a simple switch-input circuit. Pull-up resistor to 5 V, and SPST switch to GND. Momentary, toggle, pushbutton - don't care. The "bottom" end of the resistor goes to the input of an inverter. TTL, CMOS, ECL, microprocessor, Apollo guidance computer - don't care. With each switch activation there will be a noise burst at the inverter output. This is caused by the switch contacts bouncing against each other before settling down. The faster the logic is, the worse the noise burst will be. It is only a few milliseconds, but can have hundreds of transitions.

Now replace the SPST switch with SPDT, and replace the inverter with the NAND S-R flipflop. The very first negative-going edge will cause the flipflop to change state. After that, even if the switch contacts make and break 1000 times over the next millisecond, the output of the flipflop will not change. The only thing that can change the FF output is the switch armature going all the way over to the other throw.

Also, a noise burst similar to that caused by contacts making can occur when contacts break, because the contacts slide against each other before separating completely. The flipflop circuit eliminates that as well. The FF output does not change until *both* inputs change state, and the structure of the switch guarantees that the break bounce is over before the next make bounce starts.

Yes, this circuit was a part of all of the Apollo computers. The flipflop was a two-transistor latch.

ak
 

MrChips

Joined Oct 2, 2009
34,819
We have to remember that there are many people following AAC forums, both experienced and knowledgeable folks as well as newcomers to the world of electronics.

We had a long discussion in another thread where a member insisted on debouncing every mechanical switch.

A switch debounce circuit is not always mandatory and the need to debounce is dependent on the application.

If multiple transitions of a switch will advance the state of a machine to a new state, then yes, switch debouncing via hardware or software is mandatory.

If the switch controls two static states, one position means A and the other position means B, then no debouncing is required.
If switch bounce is likely to cause a problem, for example the load chatters between the two states (and I cannot think of a valid situation) then yes, the switch needs to be debounced.
 
Wetting current gets to be important sometimes. I used mercury wetted relays for an I-V converter I built for in house use.
It also means that you can't use a 100 A contactor to switch 10 uA currents.
Precious metals help.
What's necessary for AC switching is very different than what's necessary for AC switching so you have both AC and DC ratingss for a switch. You also have what's the maximum current that the contact can carry and the maximum current that can be switched.
 
Top