Flip Flop Trouble

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
Well initially, I thought that would fix the situation because theres a small propagation delay time for the transistor. By accident, now that I have reviewed it, it is an invertor, I should've put the 2nd resistor at the emitter and tied to ground, not at the collector... then the output would've been the node between the emitter and resistor. Sorry the link doesn't work very well (the mobile app does perfectly fine and thats what I use) for some reason I can never get it to work on a computer.

Do you always need a capacitor to debounce the Input?
 

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
Is 74LS14 supposed to be an Invertor, cause I don't recognize the wave pattern in the center of it on Mrchips 3rd circuit.
 

crutschow

Joined Mar 14, 2008
38,520
Well initially, I thought that would fix the situation because theres a small propagation delay time for the transistor.
The transistor delay is much less than the millisecond time of the bouncing pulses.
Do you always need a capacitor to debounce the Input?
No.
But you need some way to ignore any pulses after the first, and easy way to get that several millisecond delay is with an RC circuit.
But you are free to use an alternate way to get that delay, if you like.

A microprocessor, for example, can be programmed to ignore any pulses after the first, for a desired delay time corresponding to the bounce time.
 

WBahn

Joined Mar 31, 2012
32,865
One thing that I would recommend is to make a digital test box that has a number of features in it. With a little forethought you can design it so that you can add more features as your needs increase. One feature would be to provide a 555-based clock generator that you can adjust the frequency on from a few Hz up to a few hundred kHz. Another would be several (perhaps eight) debounced slide/rocker switches and a couple of debounced push-button switches. Another might be a few 55-based pulse generators (one shots). Then you should have eight (or perhaps sixteen) LED drivers that let you input a signal and they drive the LED on when the signal is HI. Later features might be a 7-segment display (or perhaps a multi-digit display) that lets you input a binary value and it displays the hex/decimal (based on a switch setting) value. A counter circuit that uses this display could be added later. At some point, probably fairly early on, you can add higher-current driver outputs to let you drive higher voltage or higher power loads. Each time you need a new feature for a circuit you are playing with, see if you think it is something that you might want to use on future circuits and, if it is, add it to your test box (or make a new test box with the new features). Just make things so that you can easily interconnect the different features to make more complex circuits. You will end up with a very useful item for your testbench and you will learn a LOT about digital circuits along the way.
 

MrChips

Joined Oct 2, 2009
34,819
Do you always need a capacitor to debounce the Input?
One has to remember never to use the word "always" because it depends on context.

You will notice the first and second circuit I have posted do not have capacitors while the third circuit does.

Mechanical switch bounce occurs during the first 10ms of switch make or break. The purpose of the capacitor and resistor combination is to create an RC low pass filter with a time constant greater than 10ms. This helps to smooth out or reduce any transients.
 

MrChips

Joined Oct 2, 2009
34,819
Is 74LS14 supposed to be an Invertor, cause I don't recognize the wave pattern in the center of it on Mrchips 3rd circuit.
The symbol you see in a 74LS14 gate is the symbol for hysteresis. This symbol is used with any gate that has hysteresis or Schmitt-trigger switching characteristics.
 

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
One thing that I would recommend is to make a digital test box that has a number of features in it. With a little forethought you can design it so that you can add more features as your needs increase. One feature would be to provide a 555-based clock generator that you can adjust the frequency on from a few Hz up to a few hundred kHz. Another would be several (perhaps eight) debounced slide/rocker switches and a couple of debounced push-button switches. Another might be a few 55-based pulse generators (one shots). Then you should have eight (or perhaps sixteen) LED drivers that let you input a signal and they drive the LED on when the signal is HI. Later features might be a 7-segment display (or perhaps a multi-digit display) that lets you input a binary value and it displays the hex/decimal (based on a switch setting) value. A counter circuit that uses this display could be added later. At some point, probably fairly early on, you can add higher-current driver outputs to let you drive higher voltage or higher power loads. Each time you need a new feature for a circuit you are playing with, see if you think it is something that you might want to use on future circuits and, if it is, add it to your test box (or make a new test box with the new features). Just make things so that you can easily interconnect the different features to make more complex circuits. You will end up with a very useful item for your testbench and you will learn a LOT about digital
Ok sounds great, good advice!
 

MrChips

Joined Oct 2, 2009
34,819
Ok, I'll try that. What value capacitor do I need to use with a 1kOhm resistor?
RC time constant is calculated as the product of resistance and capacitance, i.e.

t = R x C

Watch your units and exponents carefully. I can do this in my head or without the use of a calculator.

Start with 1MΩ and 1μF.

1MΩ x 1μF = 1s
1kΩ x 1μF = 1ms

Hence
1kΩ x 10μF = 10ms
 

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
RC time constant is calculated as the product of resistance and capacitance, i.e.

t = R x C

Watch your units and exponents carefully. I can do this in my head or without the use of a calculator.

Start with 1MΩ and 1μF.

1MΩ x 1μF = 1s
1kΩ x 1μF = 1ms

Hence
1kΩ x 10μF = 10ms
Yeah I know all about rc time constants, I understand that it's an exponential growth as it charges, and an exponential decay as it discharges. It typically takes about 5 rc time constants for a full charge/ discharge... current is also exponential and inversely proportional to the rise and fall of the voltage accrosst the RC circuit. I also know that if you apply a square wave pulse to an rc circuit, you can shape the waveform with nothing but resistors and capacitors dependent upon the values. But I don't know how to use them in my circuits very well. For a long time I tried to design my own oscillator, but I could never get it to work... even through lots of research.
Do you know anything about oscillator design?

I understand the flip flop
 

WBahn

Joined Mar 31, 2012
32,865
You can use RC networks to debounce switch inputs, but it is a bit tricky. Let's consider a signal that is going from a LO to a HI as the result of flipping a switch. The case you have to design for would be just as the signal rises above the lowest level that the component the signal is going to be able to recognize as a HI (and this value is almost never even spec'ed because people are mostly interested in knowing the highest level that might NOT be recognized as a HI) the switch bounces and starts taking the signal LO. You need to allow have an RC filter that will not let the signal level fall below the highest level that the component might recognize as a LO input during the maximum amount of time that a single LO bounce might last. These are all very difficult to quantify parameters, especially if you want a truly robust design. So you end up using MUCH slower RC time constants that you might need to in order to cover your bases, but at some point you have slowed things so much that either the system response is too slow or the signal is changing too slowing to move through the "forbidden zone" quickly enough to prevent bad things from happening.

As for oscillators, those require a gain element, so you can't make one out of just resistors and capacitors. There are lots of different kinds of oscillators, each with advantages and disadvantages for which make different ones suitable for different applications. Perhaps the easiest oscillator to throw together is an inverter (preferably with a Schmitt trigger input) fed back to itself via an RC filter. Then, of course, you also have the venerable 555-based oscillators.
 

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
RC time constant is calculated as the product of resistance and capacitance, i.e.

t = R x C

Watch your units and exponents carefully. I can do this in my head or without the use of a calculator.

Start with 1MΩ and 1μF.

1MΩ x 1μF = 1s
1kΩ x 1μF = 1ms

Hence
1kΩ x 10μF = 10ms
Yeah, I'm very familiar with RC time constants, I just don't quite understand how to use them in my circuits, other than for some timing applications. If you asked me to build a radio -I would try, but probably fail. Same thing with oscillators... for a long time I tried to build a square wave oscillator, but it never worked -I always tried to manipulate a way to use a transistor to rapidly cut-off it's own power supply, but it would more often than not just end up acting as a voltage divider. I think I need to delay the saturation or cutt-off region ...
 

Thread Starter

IssacSutt

Joined Jan 6, 2017
45
You can use RC networks to debounce switch inputs, but it is a bit tricky. Let's consider a signal that is going from a LO to a HI as the result of flipping a switch. The case you have to design for would be just as the signal rises above the lowest level that the component the signal is going to be able to recognize as a HI (and this value is almost never even spec'ed because people are mostly interested in knowing the highest level that might NOT be recognized as a HI) the switch bounces and starts taking the signal LO. You need to allow have an RC filter that will not let the signal level fall below the highest level that the component might recognize as a LO input during the maximum amount of time that a single LO bounce might last. These are all very difficult to quantify parameters, especially if you want a truly robust design. So you end up using MUCH slower RC time constants that you might need to in order to cover your bases, but at some point you have slowed things so much that either the system response is too slow or the signal is changing too slowing to move through the "forbidden zone" quickly enough to prevent bad things from happening.

As for oscillators, those require a gain element, so you can't make one out of just resistors and capacitors. There are lots of different kinds of oscillators, each with advantages and disadvantages for which make different ones suitable for different applications. Perhaps the easiest oscillator to throw together is an inverter (preferably with a Schmitt trigger input) fed back to itself via an RC filter. Then, of course, you also have the venerable 555-based oscillators.
Ok thanks, that helps... makes a lot more sense.
 
Top