# TTL Latching Problem

I built this circuit with a computer program. Basically when the switch S1 is pressed to fast I get a high/low pulse coming through the latch which really messes up the output. ( Output will continually go from high to low rapidly) I was wondering if this will be present also if I was to build the circuit. It will be a pushbutton and may be pressed pretty fast. I put a 100k resistor and a 2.2uf cap in the circuit to try to stop problems from debouncing but I think the problem is that there is just not enough time to get the latch. If this will carry over to a real circuit please let me know if there is anything I can add to it to stop this. Thanks

I cannot get this image to look good on this site you will have to save it and open it from windows picture and fax viewer.

#### Attachments

• 25.7 KB Views: 400
Last edited:

Related Electrical Engineering News on Phys.org
Averagesupernova
Gold Member
Several things are likely to be happening. One mistake you have made is that you don't have a diode across the relay coil to prevent flyback pulses. Another mistake is dumping that 2.2 uF cap across the 5 volt power supply. It is quite likely the 5 volt power supply cannot supply the sudden current demand of the discharged cap which causes the supply to dip. I'll look at your circuit closer later.

berkeman
Mentor
I agree with supernova that your gates will blow up when you build the circuit if you do not include flyback catch diodes on the relays. Hopefully your text or other learning resources discuss how to add those diodes to your circuit. I'm not very clear on what the circuit does or what the failure is that you are seeing. If you could post a simplified circuit that just exhibits the behavior, and post a plot of the bad simulated behavior, that would help a lot.

es1
Flyback sure, but also transient and dc current. If S1 closes quickly and stays closed shorting RLY2's coil to V1, v(RLY2)=Ldi/dt and the +5V source will probably supply a good amount of short circuit current.

Assume +5V limits current and slew rate (i.e. an intentionally horrible voltage source).

When the switch is pressed (strong drive to +5V) shouldn't L1 stay off? The switched node is wired directly an input of the 74LS27. If any input of the NOR is high the output should be low. As this is a strong pull high to an input directly I doubt there is a race condition or anything.

es1
I see why the simulation oscilates. The circled 74LS08 is just a buffer for the right settings of the keypad.

If S1 is closed for a long time the feedback loop from the 74LS08 completes and the output is latched, aka stays high due to the circled or-gate even when the switch input goes away. (If the keypad is changed the feedback loop is opened and L1 goes off.)

If S1 is closed for a very very short time the circled or-gate filters the pulse.

If S1 is closed for a time greater than the minimum input pulse of the circled or-gate but less than the prop delay of the circled and-gate, you get a ring oscilator as both outputs are just functioning as buffers.

http://en.wikipedia.org/wiki/Ring_oscillator

The feedback loop is actually a clever way to build the latch. I personally like hacks like this but they are dangerous becuase of corner cases. An alternative would be to, I dunno, just use a latch.

I would recommend fixing the problems with RLY1 and RYL2 (BTW, why make your life hard with relays, use digital logic here too), remove the redundant logic, and add a circuit to gaurentee the min pulse width of S1 (plus debounce).

If it were me, I would have the switch drive a high input impedance schmitt trigger and just do everything else with digital logic.

http://en.wikipedia.org/wiki/Schmitt_trigger

Last edited:
berkeman
Mentor
es1 said:
Flyback sure, but also transient and dc current. If S1 closes quickly and stays closed shorting RLY2's coil to V1, v(RLY2)=Ldi/dt and the +5V source will probably supply a good amount of short circuit current.
The relay coil will have a resistance that is sized for the drive voltage, and the datasheet will specify what the drive current is. So you might have a 12V relay that requires 40mA to hold, or a 5V relay that requires 60mA to hold.

Good answer on the feedback oscillation, es1.

es1
I thought the relay input side acted just like an inductive element. It was up to you to limit the current (via transistor, resistor, whatever) otherwise you got a dc short (just like with any inductor).

I guess these days, buy a relay get a resistor free. :)