Strange CD4013 behaviour?

Thread Starter

daviddeakin

Joined Aug 6, 2009
207
I have the following circuit set up on breadboard. It is supposed to toggle through each of the three outputs each time the button is pressed. At power up, output C should always come on high. As drawn it works as expected.

BUT! If I eliminate the NOT gate, it does a strange thing. It powers up OK, but the first time the button is pressed it usually goes into a random state (often all outputs high) and locks up. Further presses do nothing.

I don't understand why this should happen. All that has changed is that the clock changes on the button release rather than the push, and the clock edge may be slower and less clean. But why should the 4013 care if the clock transition is a bit slow? Surely all that should happen is that it might skip through a few states due to extra bouncing, but not lock up?

Can anyone explain why the NOT gate makes such a huge difference?
 

Attachments

ScottWang

Joined Aug 23, 2012
7,397
How are the set pin of 1,2 flip-flop, and the reset pin of 3 flip-flop?
The clock in of flip-flop of CD4013 is changing the output status by rising edge, when you remove the inverter that it will changed the input clock, and providing a clock from low to hi during the power up.
 

RichardO

Joined May 4, 2013
2,270
Your schematic does not show all of the pins of the 4013. You must never leave a CMOS input unconnected. Have you connected all of the Set and Reset pins?
 

eblc1388

Joined Nov 28, 2008
1,542
In the original circuit, because of initial zero charge in the 100nF inverter input capacitor, the inverter output will be HIGH at power ON and goes to LOW afterwards when the capacitor charges up. This level change on the 4013 clock will not upset or cause any problem to the 4013 F/F.

By removing the inverter, you are now in effect applying a positive going edge signal to the 4013 clock while they are in the process of being reset. Under this situation, anything can happen as you have found out. Therefore the answer is to hold the clock level steady upon power ON. The following circuit shows you how.

Another point is even when all three F/Fs output is HIGH, the circuit will still work as usual by passing the nth F/F logic state output to the (n+1)th F/F. However, as the level are now all HIGH, it would seem to you as the circuit has locked up.

 

Attachments

Thread Starter

daviddeakin

Joined Aug 6, 2009
207
By removing the inverter, you are now in effect applying a positive going edge signal to the 4013 clock while they are in the process of being reset. Under this situation, anything can happen as you have found out. Therefore the answer is to hold the clock level steady upon power ON.
But the circuit powers on OK even without the inverter. It only locks up the first time you press the button...
 

eblc1388

Joined Nov 28, 2008
1,542
But the circuit powers on OK even without the inverter. It only locks up the first time you press the button...
Your findings led me to build the same circuit and I have encountered the same problem as you have mentioned above.

Now I can confirm the problem is caused by contact bounce and manifest itself as multiple clockings in the manual push button, or the lack of signal conditioning on the clock edges. These clocking also occurs with improper logic level as seen on an oscilloscope. If I replace the manual clocking by pulse source, the circuit toggles without any problem even at 400 pulses/sec.

The schmitt trigger inverter in the original circuit takes care of this condition by providing a single clean edge.
 
Top