Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] trying to manually advance SN74LS191N counter... having problems

Status
Not open for further replies.

maark6000

Member level 5
Member level 5
Joined
Jan 15, 2013
Messages
92
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
2,270
I'm trying to advance a SN74LS191N binary counter manually. I've got the circuit working beautifully with a 555 timer, it advances the counters (I have two cascaded together to make 8-bit) by placing the timer's output into the CLK inputs. No problems there. But I also want to be able to advance the counters manually using a push button. When I try this, the counter acts very weird. It tends to skip numbers, it'll go backwards, forwards, sometimes huge jumps forward... very strange behavior. At first I thought was having switch bounce issues. I actually hunted down some 7414's to make an RC switch debouncing circuit, I've looked at my manual clock waveform on the scope and it's perfect... no bounce. But still, the counters are going nuts. Any idea where I've gone wrong?

Thanks in advance...

Mark J.
 

okay, made some progress. created a CLK pulse using a mono-stable one shot 555 schematic. Using a 100K & 1 uF cap gives me about a 100ms time constant on the pulse. this was at least getting me close... as now the counters would advance on the rising edge AND the falling edge... so it was advancing two #'s for every button push. Then I noticed something really weird... when I would hook up my scope to the last counter's clock input to see what it was receiving, the circuit worked perfectly. So I put in a small circuit to essentially replicate my scope probe... a 10M resistor in parallel with a .01 uF cap from CLK input to ground. now it works... although, it'd still be nice to know why.

Not the most hardy circuit, if I go too fast on the button it causes all kinds of craziness.
 

It's a common problem. What you are seeing is switch contact bounce. When the contacts of a switch close and open they never (or very rarely) do it 'cleanly'. The result is that although you only press once the contacts actually produce a lot of very brief pulses and because the counter ICs can accept such short pulses they are counting them as though they were the intended clock signal. It isn't uncommon for several hundred pulses to come from a single press and release so when it appears to have counted backwards what you are seeing it it counting forwards so many times it has rolled over back to zero and counted up again.

With an electronic clock generator you get clean single edges so it works OK. The solution is to use what's called a 'debounce' circuit on the switch which may be as little as extra capacitance across the switch as you see with your probe or more commonly is a 'lock-out' timer that once triggered, rejects any further pulses for a brief time (usually around 5 - 10 mS) so the unwanted pulses are not passed on.

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top