12 stage ripple counter odd problems!

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
So you guys know I've been trying to make a PAL video generator.

My first card didn't work. The final signals were all crazy and disorderly and I couldn't figure out why.

I disassembled the circuit and tried to get down to the first problem that occurs and I have found it!

I am using a 12 stage ripple counter to do the counting, and then using logic gates to compare the outputs and so on.

However, when I try to do logic with the last stages, that is, bits 12, 11, 10 and 9, errors occur and the logic goes crazy. The outputs are no longer in a single state.

However the first stages, 1, 2, 3 and 4 do work and the logic is clean.


Why would the last stages fail like this? Incidently, I saw a video generation circuit schematic, where they also use counters, but their counters are all 4 bits IC's, where the last bit of one feeds into the clock of the next. Why ?

Please help.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
I don't have schematics, I built the circuit from my mind. Maybe theres something wrong with my IC who knows. I have made one thousands tests
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
Like this ?

And if you really want some help, as others have suggested, some schematics are going to help. No one is going to steal you design.

Have you seen this ?

http://www.waveguide.se/?article=bitmapped-video-interface




Started reading the guys article. It seems he can make one using discrete logic. Awesome! Imma read on. Thanks a lot of sharing!!!!!!!

The guy is also using ripple counters... omg... How can his work and mine doesnt?
 

Marley

Joined Apr 4, 2016
501
I have not looked at the above links but the problem with ripple counters generally is that the state "ripples" through - basically there is a transmission delay through each stage of the counter and the outputs do not change state simultaneously. This effect gets worse with more counter stages.

So, if you use logic on the counter outputs you will get "race conditions" occurring and the logic outputs will have unexpected glitches. The counter needs to be synchronous - then all outputs will change state simultaneously.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
Please someone help. Look at these waveforms. I took 2 outputs from a ripple counter, as it's shown on the first two photos, and passed them thru an OR gate, and looked at the output. See how messy it is? It's crazy. Out of what to do I put a 47nF cap on the output of the gate and the waveform cleared somewhat. Can anyone tell me what's happening? I am going nuts.

 

DickCappels

Joined Aug 21, 2008
10,121
Maybe your logic will not care if the pulses are"messy" or not. Edge-sensitive inputs can be a problem if you get what I would call a double edge from ringing or such, or if the rise and fall times are in excess of specified limits.

The signals in your photographs are what I would expect in a circuit built on a plug-in breadboard. Standard advice applies: Shorten all leads, make sure you have adequate bypassing on power supplies and if possible, built on a circuit board where you can control the parasitic inductance, capacitance, resistance, and connection length. No kidding.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
Maybe your logic will not care if the pulses are"messy" or not. Edge-sensitive inputs can be a problem if you get what I would call a double edge from ringing or such, or if the rise and fall times are in excess of specified limits.

The signals in your photographs are what I would expect in a circuit built on a plug-in breadboard. Standard advice applies: Shorten all leads, make sure you have adequate bypassing on power supplies and if possible, built on a circuit board where you can control the parasitic inductance, capacitance, resistance, and connection length. No kidding.

I have tried shorting all leads and everything. Bypassed everything, and still the same.
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
And now the weirdest thing. My scope has 4 inputs. When I plug the main probe into one of the outputs from the counter, and the second probe into the output of the GATE, the output is shown perfectly !!!!! If I plug the secondary into the counter and the primary into the result of the gate, the output is messy again. It seems there is some PLL thing going on. Or maybe my scope is just broken ?

Whoever can explain this to me will get a box of cookies

 

crutschow

Joined Mar 14, 2008
34,017
If you are gating the output of a ripple counter you can get a glitch at the logic output when two or more inputs change state at the same time due to the ripple delay between stages (one counter output changes stage slightly later than the other).
That's normally not a problem with synchronous logic but can be if it's non-synchronous.

The changes you see when you connect the probes are likely due to the slight change is waveform risetime that the probe loading causes, which changes the glitch effect.

Your waveforms look pretty ratty. Do you have a good circuit grounding scheme with decoupling caps across the IC's, and are the probes 10:1 with the ground clips connected to the circuit ground close to where you are measuring the signals?
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
If you are gating the output of a ripple counter you can get a glitch at the logic output when two or more inputs change state at the same time due to the ripple delay between stages (one counter output changes stage slightly later than the other).
That's normally not a problem with synchronous logic but can be if it's non-synchronous.

The changes you see when you connect the probes are likely due to the slight change is waveform risetime that the probe loading causes, which changes the glitch effect.

Your waveforms look pretty ratty. Do you have a good circuit grounding scheme with decoupling caps across the IC's, and are the probes 10:1 with the ground clips connected to the circuit ground close to where you are measuring the signals?


My circuit is just 2 IC's. The leads are short. There;s really nothing I can do to improve it unless I move it to a PCB
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
If you are gating the output of a ripple counter you can get a glitch at the logic output when two or more inputs change state at the same time due to the ripple delay between stages (one counter output changes stage slightly later than the other).
That's normally not a problem with synchronous logic but can be if it's non-synchronous.

The changes you see when you connect the probes are likely due to the slight change is waveform risetime that the probe loading causes, which changes the glitch effect.

Your waveforms look pretty ratty. Do you have a good circuit grounding scheme with decoupling caps across the IC's, and are the probes 10:1 with the ground clips connected to the circuit ground close to where you are measuring the signals?


If my probes are destroying the signal then what can I do ? The signal is just a normal signal. If I cant probe this signal then what can I probe ? I have no idea what to do. I placed a 47nF capacitor at the output and the signal cleared up a little
 

AnalogKid

Joined Aug 1, 2013
10,943
And now the weirdest thing. My scope has 4 inputs. When I plug the main probe into one of the outputs from the counter, and the second probe into the output of the GATE, the output is shown perfectly !!!!! If I plug the secondary into the counter and the primary into the result of the gate, the output is messy again. It seems there is some PLL thing going on. Or maybe my scope is just broken ?
Scope probe ground lead management.

Each probe has a ground lead with a clip on the end. Each ground lead should be connected to the ground pin of the chip you are probing. Also, the ground leads should be as short as possible. A long ground lead acts like a combination of a loop antenna, one turn of a transformer, and a series inductor that causes ringing in the displayed waveform, ringing that is not actually in the signal being probed.

ak
 

AnalogKid

Joined Aug 1, 2013
10,943
I don't have schematics,
Here's a thought from someone who knows a thing or two about a thing or two:

He who loves practice without theory is like the sailor who boards ship without a rudder and compass and never knows where he may cast.

and

The greatest deception men suffer is from their own opinions.

- Leonardo da Vinci

ak
 

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
Here's a thought from someone who knows a thing or two about a thing or two:

He who loves practice without theory is like the sailor who boards ship without a rudder and compass and never knows where he may cast.

and

The greatest deception men suffer is from their own opinions.

- Leonardo da Vinci

ak

I love theory. I just wanted to get this circuit done really fast and see an image on the TV before I started drawing a proper one. But It seems everything is going wrong. I cant even get past this counter thing. I cant even see the proper signal out of a logic gate!
 

AnalogKid

Joined Aug 1, 2013
10,943
I love theory. I just wanted to get this circuit done really fast
So, how is that working out for you?

1. It isn't that building something as complex as a multi-stage counter from a schematic in your head won't work - it *can't* work.

2. There are dozens of fundamentally different counter ICs on the market, and hundreds of variations. 17 posts into this thread, you still have not shared so much as a part number. Exactly what kind of help do you expect?

I've seen this forum do some amazing diagnostic work by remote control, but not when completely blind, and not without some actual effort by the TS. Without a schematic, list of components, and photos of your assembly, this thread will fail.

ak
 
Last edited:

Thread Starter

PauloConstantino

Joined Jun 23, 2016
266
So, how is that working out for you?

1. It isn't that building something as complex as a multi-stage counter from a schematic in your head won't work - it *can't* work.

2. There are dozens of fundamentally different counter ICs on the market, and hundreds of variations. 17 posts into this thread, you still have not shared so much as a part number. Exactly what kind of help do you expect?

I've seen this forum do some amazing diagnostic work by remote control, but not when completely blind, and not without some actual effort by the TS. Without a schematic, list of components, and photos of your assembly, this thread will fail.

ak


The counter is a 74HC4040 IC. I'm not building it from lower parts. The gate is a 74HC08 AND gate.

I have posted photos of the waveforms. See how they look like a superposition of the two original inputs into the gate ?? My question is simply why this is happening? I've never seen such strange thing since I started electronics.

I can't tell if the waveforms are changing in time or whether my scope is doing something weird.

You want photos of the assembly? If it helps. Here they are



Can anyone build this simple circuit and see if you get the same results please ?
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,637
I love theory. I just wanted to get this circuit done really fast and see an image on the TV before I started drawing a proper one. But It seems everything is going wrong. I cant even get past this counter thing. I cant even see the proper signal out of a logic gate!
hi

hi PC,
A basic circuit diagram is not theory, its a road map of where you are trying to get too.

Having an idea of the circuit in your mind does not help us, we are not clairvoyant.
Put the bread boards to one side, create a circuit drawing that we can all see and use as a point of reference.

Please do not continue to ignore our advice and requests for information.

E
 
Top