3 bit binary counter - D flip flop

Thread Starter

grizzly_pouches

Joined Nov 11, 2013
7
I will start by saying that I am very new to this so.......

I will try and make this as simple as possible as I am just looking for help with something specific. I don't want to know if a shortcut exists, or if I could build it another way. I am just looking to see if what I built is possible since I can not get it to work properly. (Once everyone is done lauging at my question then you can fill me in on how I should do it.)

I am trying to build a 3 bit binary counter using D flip flops. I have simulated it using a couple of programs with no problems but when I build the actual circuit I run into problems. To start: I have a small hobby breadboard, a variable power supply which has multiple settings (3V, 4.5V, 6V, 9V, and 12V) and no current control, one 555 timer, and two 74LS74 IC's. For the 555 timer I am using the following values: R1=5.6KΩ, R2=33KΩ, and C = 10μf (freq just over 2hz and a period of .49 sec). I am using the 4.5V setting on the power supply and I do not have access to any voltage regulators. All of my Q outputs go to a 330 ohm resistor followed by a simple 5mm red led. When I build the circuit and make it a two bit counter it works perfectly counting 0-3 (00, 01, 10, 11). When I attempt to introduce the second 74LS74 IC it starts to count wrong. My counting sequence now goes (100, 001, 010, 011.... and then loops thats sequence). It never displays 000 and never goes past 100 but the led does light up so something is happening. I would like for it to just count 0-7 in binary and then start over.

Any help that anyone can provide would be greatly appreciated. As I mentioned the simulation works. I have double checked all of the wiring. I have changed out components if possible. I have a feeling I am missing something and that the junky setup is what is causing my problems. I wish I had some pictures to show you but it is a crazy mess of wires and I wont be cleaning things up until I get it working. I am really new to this so if I left out anything I will try my best to answer any questions that might pop up.

Thanks in advance
 

WBahn

Joined Mar 31, 2012
30,058
How can we possibly troubleshoot your circuit when you don't post a schematic or anything? We are NOT mind readers!

Saying something like R1=5.6kΩ doesn't tell us much, either. "R1" is just the label for a resistor in a circuit and has no meaning unless you provide a schematic so that we can look as see what R1 is refering to and how the overall circuit is constructed.

What are you doing with unused inputs? Do you have power supply bypass caps in place?
 

MrChips

Joined Oct 2, 2009
30,806
1) It always helps to show a circuit diagram.

2) Photos of the breadboard can also reveal wiring problems and/or sloppy techniques.

3) 74LS series are designed to operate from a supply voltage of 5V, not 4.5V. Use the 9V output feeding a 7805 5V regulator or similar.

4) Make sure you have 0.1μF decoupling capacitors across the Vcc and GND pins of the 74LS74 and the 555 timer IC.

5) Make sure there is at least one 10-100μF electrolytic capacitor across Vcc and GND.
 

GopherT

Joined Nov 23, 2012
8,009
Your 555 timer may not be going low enough on each clock tick to be considered "low" by the flipflop. Add a large cap and measure the voltage. I think you need to get below 0.8 V for a Low.
 

Thread Starter

grizzly_pouches

Joined Nov 11, 2013
7
Your 555 timer may not be going low enough on each clock tick to be considered "low" by the flipflop. Add a large cap and measure the voltage. I think you need to get below 0.8 V for a Low.
This is what I was thinking as well but without knowing why. I was wondering if maybe once it cycles a few times something starts to go wrong due to me using sloppy wiring or missing something completely.
 

alexfreed

Joined Oct 8, 2012
72
If it counts at all, the input clock is not likely to be a factor. Check the wiring a few more times. Maybe the second chip is not wired quite right. And definitely add capacitors on the VCC. Otherwise power spikes can easily lead to weird behavior of the circuit.
One more thing: it is not recommended to connect unused inputs of 74LSxx circuits directly to VCC. Better to use a resistor. Direct connection to VCC is OK for CMOS chips like 74HCxx or the ancient 4000 series.
 

Thread Starter

grizzly_pouches

Joined Nov 11, 2013
7
If it counts at all, the input clock is not likely to be a factor. Check the wiring a few more times. Maybe the second chip is not wired quite right. And definitely add capacitors on the VCC. Otherwise power spikes can easily lead to weird behavior of the circuit.
One more thing: it is not recommended to connect unused inputs of 74LSxx circuits directly to VCC. Better to use a resistor. Direct connection to VCC is OK for CMOS chips like 74HCxx or the ancient 4000 series.
Thank you. I will make some changes and let you know how it works out.
 

WBahn

Joined Mar 31, 2012
30,058
There are two DFFs in a 7474, which means that you have one entire DFF that is unused. Be sure to tie its inputs to logic levels so that it isn't flailing around and injecting noise into the other DFF or into the power supply.

You also want to bypass the control pin on the 555 to gound with a capacitor, though this isn't likely to be your problem.

Definitely get your supply voltage up into the spec'ed operating range for the chips and bypass the supplies properly.
 

Thread Starter

grizzly_pouches

Joined Nov 11, 2013
7
All is good in the world and it is now working. I ended up purchasing a 7805 and everything started working. Maybe it was getting an actual 5V, maybe it was making some of the changes that people mentioned or maybe it was the fact that I had to redo (move) the 555 timer to make room for the 7805. I want to thank everyone who provided some assistance.
 

WBahn

Joined Mar 31, 2012
30,058
The critical step was moving from 4.5V supply to 5V supply.
I don't know how critical that was. The 74LS family has a minimum recommended operating voltage of 4.5V, so if his supply was actually 4.5V it satisfied the recommendations. And since there is always (an unknown and unreliable) margin there, especially if you aren't pushing the current or temperature ranges, it almost certainly should work at a bit below that level as well. Now, it's tolerance for power supply noise is going to be diminished when running close to the edge, and that might be enough to explain things.

It would be interesting if the OP would pull the regulator and run from the 4.5V again, leaving all else unchanged, to see if that really was a deciding factor.
 

MrChips

Joined Oct 2, 2009
30,806
True. If the OP ran with 4.5V but stiffened the power supply with an electrolytic capacitor it might work. But I don't like to live on the ragged edge.
 

Thread Starter

grizzly_pouches

Joined Nov 11, 2013
7
At your request I hooked up the original 4.5 volts and it did not work. I was getting a different counting sequence from before so something changed but it still did not work. I guess that was part of my original question. I had a feeling that my wiring was correct. I was just curious if the 4.5V should technically work based on the fact that 4.5V is usually in the acceptable range or right on the edge.

Thanks again
 

WBahn

Joined Mar 31, 2012
30,058
Thanks for doing the experiment. Did you by chance measure the 4.5V (preferably across the logic chip supply pins) to see how close to 4.5V it actually is?

Either way, it provides a practical data point -- don't push the recommended voltage range.
 

MrChips

Joined Oct 2, 2009
30,806
If you read the data sheet the minimum supply voltage Vcc is 4.75V for SN74LSxx.

I agree that there would be some margin that might allow you go lower than the specs but that leaves you no room for noise, design and spec fluctuations.
 

WBahn

Joined Mar 31, 2012
30,058
If you read the data sheet the minimum supply voltage Vcc is 4.75V for SN74LSxx.

I agree that there would be some margin that might allow you go lower than the specs but that leaves you no room for noise, design and spec fluctuations.
You are correct. I was looking in the SN5400 column when I checked it. My bad.

So that makes it a lot more reasonable that 4.5V would result in flaky behavior.
 
Top