What's a simple way to build a 3-bit ring counter with real components?

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
I have never worked directly with flip flops before. I'm building a circuit that needs to loop between 3 states, and a ring counter appears to be a way to achieve this, if I understand it correctly. I want it to have 3 parallel output pins, in which only one of them at a time is on (positive voltage), and it will change to the next pin with every pulsation of an input voltage. This would be a 3-bit ring counter, right? I suppose that the pulsating voltage would be fed into the clock input pins.


There are many schematics online similar to the 4-bit ring counter shown above, but I haven't found any that specify particular components. They all just use generic flip flop symbols. This makes the selection confusing.

What would be a simple way to construct a 3-bit ring counter using few actual components? I would prefer using a single through-hole IC if possible.

On Digikey there are multiple options for flip flop, shift register, and counter ICs, but I'm not sure which one can easily be configured this way.
 

Papabravo

Joined Feb 24, 2006
21,217
I don't think what you want will be that easy. It would be possible if you have a way to initialize the three flip-flops and don't care about recovery from illegal states.

ETA: Here you go with mostly 74HC parts:

1704413888606.png
1704413935094.png
 
Last edited:

WBahn

Joined Mar 31, 2012
30,008
I think the TS said he wanted to work with flip-flops. I agree that an 8-pin pic would be fewer packages assuming you have enough pins to do everything necessary.
He said he had never worked with flip flops, not that he wanted to. He also referred to ICs other than flip flops in his quest.
 

Papabravo

Joined Feb 24, 2006
21,217
He said he had never worked with flip flops, not that he wanted to. He also referred to ICs other than flip flops in his quest.
I guess I read it differently than you did, and I also guess the TS needs to add more clarity to what he wants. We shall await his next post.
 

crutschow

Joined Mar 14, 2008
34,386
You can use a Johnson counter, such as the CD4017, to get 3 sequential signals.
It counts to ten but you can reset it after every third count.
 

Papabravo

Joined Feb 24, 2006
21,217
You can use a Johnson counter, such as the CD4017, to get 3 sequential signals.
It counts to ten but you can reset it after every third count.
There are uses for such a counter, but it is pretty hard to get a Johnson counter to produce only a single 1 in each position. Hopefully, the TS will clarify his requirements.
 

MrChips

Joined Oct 2, 2009
30,779
I have never worked directly with flip flops before. I'm building a circuit that needs to loop between 3 states, and a ring counter appears to be a way to achieve this, if I understand it correctly. I want it to have 3 parallel output pins, in which only one of them at a time is on (positive voltage), and it will change to the next pin with every pulsation of an input voltage. This would be a 3-bit ring counter, right? I suppose that the pulsating voltage would be fed into the clock input pins.


There are many schematics online similar to the 4-bit ring counter shown above, but I haven't found any that specify particular components. They all just use generic flip flop symbols. This makes the selection confusing.

What would be a simple way to construct a 3-bit ring counter using few actual components? I would prefer using a single through-hole IC if possible.

On Digikey there are multiple options for flip flop, shift register, and counter ICs, but I'm not sure which one can easily be configured this way.
I don't know what you mean by "real" or "actual" components.
Are not all components real and actual?
 

Thread Starter

Electric-Gecko

Joined Dec 10, 2016
56
For anyone who wants to know, I'm asking about flip flop counters to use as a backup plan in case the circuit I posted in this post doesn't work. I've been out of town and unable to go to my electronics store, but I will be back soon.

I don't think what you want will be that easy. It would be possible if you have a way to initialize the three flip-flops and don't care about recovery from illegal states.

ETA: Here you go with mostly 74HC parts:

View attachment 311740
View attachment 311741
Alright. That's more than I prefer; two 14DIP IC's, plus a NOR gate IC if I want to stop it from getting into illegal states as you mentioned, but it's nice to have confirmation on how I'm supposed to use it. It would be nice if there was a 16DIP quad flip flop IC in existence, but I don't see it on Digikey.

I found the SPICE model that you use, though unfortunately the simulation failed in Ngspice.

I notice that in your graph, the PRE & CLR pins are mostly set to 3.3V; not 5V like I would expect. Is this how it works? They are activated by pulling them down to 0 volts?

Can the clock input be any signal with a voltage that pulsates up and down sometimes, even with uneven timing? If I hooked it up to a push button, would it shift every time I pushed it? My actual intention is for something much faster than a push button; preferably over 100kHz, but without being evenly spaced.

It counts to ten but you can reset it after every third count.
Alright. But I still don't know how I would configure this IC in a circuit. In the datasheet, it looks like it's a line of flip flops combined with some NAND gates. Instead of the flip flop outputs being directly accessible, they are filtered through the NAND gates.

I may have figured it out now. Are the NAND gates there to allow it to count to a higher number than the number of flip flops? To make it loop back to the beginning would I just connect one of the outputs to the RESET pin?

This seems like a decent solution. I think I'll pick up one of these IC's on my next trip to the store.

I don't know what you mean by "real" or "actual" components.
Are not all components real and actual?
By "real" I mean specific products that are manufactured. The CD4017B is a "real" component in this sense, as is the SN74HC74. That is as opposed to the generic flip flop symbols used in schematics such as the one I linked, which don't refer to any particular product.

How about a transistor ring counter?
Very cool. I'm tempted to try and simulate this. It will be fun to try, though it's probably not the solution I will settle on in the end.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,217
For anyone who wants to know, I'm asking about flip flop counters to use as a backup plan in case the circuit I posted in this post doesn't work. I've been out of town and unable to go to my electronics store, but I will be back soon.


Alright. That's more than I prefer; two 14DIP IC's, plus a NOR gate IC if I want to stop it from getting into illegal states as you mentioned, but it's nice to have confirmation on how I'm supposed to use it. It would be nice if there was a 16DIP quad flip flop IC in existence, but I don't see it on Digikey.

I found the SPICE model that you use, though unfortunately the simulation failed in Ngspice.

I notice that in your graph, the PRE & CLR pins are mostly set to 3.3V; not 5V like I would expect. Is this how it works? They are activated by pulling them down to 0 volts?

Can the clock input be any signal with a voltage that pulsates up and down sometimes, even with uneven timing? If I hooked it up to a push button, would it shift every time I pushed it? My actual intention is for something much faster than a push button; preferably over 100kHz, but without being evenly spaced.


Alright. But I still don't know how I would configure this IC in a circuit. In the datasheet, it looks like it's a line of flip flops combined with some NAND gates. Instead of the flip flop outputs being directly accessible, they are filtered through the NAND gates.

I may have figured it out now. Are the NAND gates there to allow it to count to a higher number than the number of flip flops? To make it loop back to the beginning would I just connect one of the outputs to the RESET pin?

This seems like a decent solution. I think I'll pick up one of these IC's on my next trip to the store.


By "real" I mean specific products that are manufactured. The CD4017B is a "real" component in this sense, as is the SN74HC74. That is as opposed to the generic flip flop symbols used in schematics such as the one I linked, which don't refer to any particular product.


Very cool. I'm tempted to try and simulate this. It will be fun to try, though it's probably not the solution I will settle on in the end.
The 74HC175 is a quad flip-flop in a 16 pin package. Don't know about availability.

The HC series of parts can work with variety of VCC values including 3.3V and 5V. It is possible to have different VCC values on a single board since the parts with a lower VCC have inputs that are tolerant of the higher voltage. I chose 3.6 V, not 3.3 V just because I can. VCC disables the PRE* or CLR* input it is connected to. There is a RESET* generator, with net name "I" for Initialize, that creates a one-time low going pulse to coerce the flip-flops to their initial state. Notice also that when that signal is active (low), the CLK signal is ignored. You can also do this reset signal with a simple RC circuit.

The CLK signal can be anything you want that beats up and down. A pushbutton has a problem that mechanical contacts will "bounce" up and down an unpredictable number of times at each closure and release of the switch. You should research "contact debouncing" circuits. You can have a clock with a duty cycle that is not 50% and you don't have to have a continuous sequence of edges. You can do them in bursts with long gaps and the circuit will hold its present state as long as the power is on.
 

crutschow

Joined Mar 14, 2008
34,386
To make it loop back to the beginning would I just connect one of the outputs to the RESET pin?
Yes.
Below is the LTspice sim of the CD4017 circuit for a 3 sequence output:

Note that the clock input is a Schmitt-trigger type with a small hysteresis, so is unaffected by the actual clock rise-time.

1704467654503.png
 
Top