problem cascaded jk flip flops

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
I just went and looked at the 74107 data sheet and noticed a couple of things. ........................Which do you WANT? An up counter or a down counter.
I don't know who you are , but thanks a million for taking time to help me out. i REALLY appreciate it. This is my first digital experiment that i am doing in my home. I honestly still dont care if the circuit counts up or down. as long as it counts i am happy and can check off in my head that i could put together a counter from scratch myself.
I use the textbook from this website as a guide to teaching myself digital electronics. I do have a digital course in school but i just dont want wait till next semester to learn that stuff.
I did make a 2 bit counter saturday night that counted from 3,2,1,0 and back to 3 again. i happened to use only one 74107 IC. It worked great! Then I went onto the next step of making a 4 bit counter and thats when I got into all this mess.
Last night and this whole day at work i was planning on giving up this whole 4 bit counter experiment but seeing your replies I feel its not fair to give up on this problem after so many people have tried to help me out. So, I have decided to get to the bottom of this problem no matter what and no matter how long it takes.
Maybe it a synchronization problem between the 2 ICs or maybe its something else. I will update this thread when i am successful.
Thank you again for your time.
 

MrChips

Joined Oct 2, 2009
30,714
So you got a 2-bit counter working. That's great. A 4-bit counter is just as easy.
Don't give up too quickly.

Go back and get the 2-bit counter working as you did before.
Now build a second 2-bit counter exactly like the first one and then report on your progress.
 

WBahn

Joined Mar 31, 2012
29,979
I honestly still dont care if the circuit counts up or down. as long as it counts i am happy and can check off in my head that i could put together a counter from scratch myself.
Hopefully that will change, but you are following a reasonable progression. First make something happen, then understand why that was the something that happened, then make something happen according to what you want to have happen. The first stage is tinkering (for lack of a better word -- perhaps wandering is better), the second is analyzing, and the third is engineering.

I use the textbook from this website as a guide to teaching myself digital electronics. I do have a digital course in school but i just dont want wait till next semester to learn that stuff.
A very healthy and, sadly, uncommon attitude. The more you learn now on your own, the easier the course will be when you take it and, the big bonus, the better positioned you will be to really learn things from it.
 

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
So you got a 2-bit counter working. That's great. A 4-bit counter is just as easy. Don't give up too quickly. Go back and get the 2-bit counter working as you did before. Now build a second 2-bit counter exactly like the first one and then report on your progress.
Got a new bread board.
The counter is counting as its supposed to now. i see the outputs for 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 and 0. The display is the way it is supposed to be, as shown in the datasheet. (Well 15 shows up as all LEDS turned off the way it is supposed to be.)
The previous experiment was failing because the bread board was bad. My wife told me that the toddler might have dumped water on the old bread board. Sorry for driving you guys nuts. My apologies. Case closed.
 

ian field

Joined Oct 27, 2012
6,536
Hello guys ! I am back again!...with a problem again....so i cascaded 2 jk flip flops (7407) so that i can make a 4 bit counter. The wiring is correct but the 7 seg display is ...well...just showing up weird characters. any ideas what i might be doing wrong? are there any precautions that i need to take while cascading flip flops?

thank you for ur replies.

p.s. the ground (black) wire from the frequency generator goes into the last flip flops ground ( pin 7 ) right ?


View attachment 61858
Sounds like you need to add either a BCD to 7-segment or a binary to 7-segment decoder/driver.

If you want to do binary count; you need to select the decoder/driver chip carefully - some chips blank on "illegal codes", others display weird jumbles of segments. One I know of that does the full hexadecimal character set is the Beckman DD700 - but its for driving neon type 7-seg displays at about 180V and only a couple of mA, so you'd have to add external driver transistors for LED displays. If you wanted to count decimal; the 7490 BCD counter was the chip of choice - IIRC it was replaced by something like the 74292 or 393 - you get 2 counters per package.
 

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
Sounds like you need to add either a BCD to 7-segment or a binary to............................... was the chip of choice - IIRC it was replaced by something like the 74292 or 393 - you get 2 counters per package.

The counter is working good , the way it is supposed to. Do you know by any chance what IC i would need to use to drive a 2 digit 7 segment display? cause the 15,14,13,12,11 and 10 outs are showing up as wierd symbols from stargate if you known what i mean. the IC i have right now is a 7447 that can only out put till the digit 9. thank you.
 

WBahn

Joined Mar 31, 2012
29,979
The problem isn't the decoder. The decoder decodes a 4-bit value for a single digit only. It is the responsibility of the circuitry supplying the 4-bit values to only deliver codes that correspond to valid digits. If you are only wanting digit values from 0-9, then the 7447 is just fine.

If you want to have a counter that counts from 00 to 99 (or 99 to 00), then you need two counters that are configured as BCD or decade counters. This means that they cycle from 0-9 instead of 0-F and produce borrow/carry signals consistent with base-10 counting. You can get counter ICs that are specifically designed as BCD counters, such as the 7490. They also make dual decade counters (two decade counters in the same package).

If you are wanting to make your own decade counter using J-K flip flops, you need to start learning about digital design. It's not as hard as it might seem, at least not for simple circuits.

If you are interested, we can walk through the design of a decade counter together, step by step, and you can learn how to do each step of the design process as we go.
 

ian field

Joined Oct 27, 2012
6,536
The counter is working good , the way it is supposed to. Do you know by any chance what IC i would need to use to drive a 2 digit 7 segment display? cause the 15,14,13,12,11 and 10 outs are showing up as wierd symbols from stargate if you known what i mean. the IC i have right now is a 7447 that can only out put till the digit 9. thank you.
You need to search the data catalogues for a decoder/driver that does the full hexadecimal character set - but they're pretty "rocking horse manure" these days. If you can get some really old NOS; OTP ROM, 8-bit wide in a small package, you can program the required segment patterns for 16 consecutive addresses. A couple of decades ago I'd have suggested intelligent LED display modules, they can do the full ASCII set, but they're rare as...... these days.

There are certain kinds of people who'd rather program a PIC to do the same job rather than use a 555 in a simple circuit - a PIC with a dozen free I/O pins could be programmed to imitate the decoder you require - probably cheaper and less hassle too!
 

WBahn

Joined Mar 31, 2012
29,979
You need to search the data catalogues for a decoder/driver that does the full hexadecimal character set - but they're pretty "rocking horse manure" these days. If you can get some really old NOS; OTP ROM, 8-bit wide in a small package, you can program the required segment patterns for 16 consecutive addresses. A couple of decades ago I'd have suggested intelligent LED display modules, they can do the full ASCII set, but they're rare as...... these days.

There are certain kinds of people who'd rather program a PIC to do the same job rather than use a 555 in a simple circuit - a PIC with a dozen free I/O pins could be programmed to imitate the decoder you require - probably cheaper and less hassle too!
I don't think he's looking for a decoder that does the full hex character set. Notice that, not once as far as I can tell, has he done or said anything related to hex. He wants to display "15" on 2 7SEG displays. He doesn't want to display "F" on a single 7SEG display.
 

ian field

Joined Oct 27, 2012
6,536
I don't think he's looking for a decoder that does the full hex character set. Notice that, not once as far as I can tell, has he done or said anything related to hex. He wants to display "15" on 2 7SEG displays. He doesn't want to display "F" on a single 7SEG display.
The weird random segments he described suggests he's feeding the decoder with straight binary when he needs to be feeding it BCD.

This is the correct counter chip to use, and its 2 in one package - so just right for 2 digits:

http://www.nxp.com/documents/data_sheet/74HC_HCT390_CNV.pdf
 

WBahn

Joined Mar 31, 2012
29,979
The weird random segments he described suggests he's feeding the decoder with straight binary when he needs to be feeding it BCD.

This is the correct counter chip to use, and its 2 in one package - so just right for 2 digits:

http://www.nxp.com/documents/data_sheet/74HC_HCT390_CNV.pdf
Yes, he was feeding it with straight binary. Not because we wanted to, but because that is what he ended up with. As he stated, at this point he didn't care what the circuit did as long as it did something that indicated that he could wire up a circuit and get it to work.

He is also trying to learn the basics and is working with FFs for that purpose. Sure, he could use a dual decade counter, but he is trying to become something other than a chip monkey. If he is willing and interested, he should work through the design of a decade counter using flip flops (JK or D, whichever) and, once he understands it at that level, implement the design using LSI decade counters, if he has easy access to cheap ones or if he things he will have use for them in projects.
 

ian field

Joined Oct 27, 2012
6,536
Yes, he was feeding it with straight binary. Not because we wanted to, but because that is what he ended up with. As he stated, at this point he didn't care what the circuit did as long as it did something that indicated that he could wire up a circuit and get it to work.

He is also trying to learn the basics and is working with FFs for that purpose. Sure, he could use a dual decade counter, but he is trying to become something other than a chip monkey. If he is willing and interested, he should work through the design of a decade counter using flip flops (JK or D, whichever) and, once he understands it at that level, implement the design using LSI decade counters, if he has easy access to cheap ones or if he things he will have use for them in projects.
Some of the better 7490 datasheets flesh out the logic diagram inside the chip, that can be copied with individual flip-flops and a few gates - but you're looking at a fair old rat's-nest of wiring to assemble it all.
 

WBahn

Joined Mar 31, 2012
29,979
Some of the better 7490 datasheets flesh out the logic diagram inside the chip, that can be copied with individual flip-flops and a few gates - but you're looking at a fair old rat's-nest of wiring to assemble it all.
That's a good recommendation and may be a decent match for where he is at. Even if he doesn't actually implement the functional logic diagram in the data sheet, there is much to be learned by analyzing them and seeing if you agree that the schematic matches the described logic functions.
 

Thread Starter

Nathan Hale

Joined Oct 28, 2011
159
Thought you guys might like this. I hooked up my o-scope to Q0 and Q1 and got these wave forms respectively. On the X axis is period of the waveform ; Q1 is well pretty much twice as big as Q0 which shows that it is toggling at half the rate of Q0.

q_0.png

q_1.png
 

ian field

Joined Oct 27, 2012
6,536
That's a good recommendation and may be a decent match for where he is at. Even if he doesn't actually implement the functional logic diagram in the data sheet, there is much to be learned by analyzing them and seeing if you agree that the schematic matches the described logic functions.
There's a Signetics applications book for a long extinct and obscure logic family - but it has pages & pages of internal logic diagrams that pretty much show how the MSI stuff is done:

https://archive.org/details/DigitalLinearMosApplications

You can search archive.com for pretty much anything - if you search "DATABOOK", you get several pages of download links.
 
Top