Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Wiring a 4013

Status
Not open for further replies.

matthewwren

New Member
OK, I have only built 2 electronics circuits before. The first was a flip-flop, and the second was a d-type flip-flop. Now I have designed a logical diagram of a simple calculator circuit using one of these simulators. All works fine. Now the hard bit, actually translating that logic diagram into a circuit. My first dilemma is wiring up a 4013 chip. I thought, ok simple, just +9v into v+ and 0v to ground. But it doesn't behave as i expect, in fact Q1 always seems to have output even if i ground data in and clock. Can someone explain to me how to correctly wire a 4013 chip.
 
matthewwren said:
OK, I have only built 2 electronics circuits before. The first was a flip-flop, and the second was a d-type flip-flop. Now I have designed a logical diagram of a simple calculator circuit using one of these simulators. All works fine. Now the hard bit, actually translating that logic diagram into a circuit. My first dilemma is wiring up a 4013 chip. I thought, ok simple, just +9v into v+ and 0v to ground. But it doesn't behave as i expect, in fact Q1 always seems to have output even if i ground data in and clock. Can someone explain to me how to correctly wire a 4013 chip.
What are you using it for, and what are you expecting it to do? A 4013 looks at the logic level (0 or 1, 0V or 9V in your case) presented to the D input, and transfers that level to the Q output when the clock input transitions rapidly from 0 to 1. Nothing happens on the falling edge of the clock, and nothing happens when the logic level changes on the D input, until the next clock edge. To make all this work, you must connect the SET and RESET inputs to logic 0.
 
Set and Reset must be grounded. Then the Q Output becomes the same logic state that the D Input is at when the Clock Input goes high.

If the D Input is high when the Clock Input goes high then the Q Output becomes high.
If the D Input is low when the clock Input goes high then the Q Output goes low.
It is clocked on the positive-going edge of the Clock Input.
 
At first I didn't connect s and r to ground. How would I know if I damaged the chip?

Must I have the clock connected? I was kind of sticking a wire in and out of the bread board to simulate a clock ticking.

The other thing I don't understand is how important the value of the resistors are. I mean I have a 9v input and these things can operate at a max of 12v, so do i ned to use resistors? And if so would that be purely to manipulate the direction of the current?

On Q output, can i directly connect this up to say an LED and then ground the LED, or should I stick the Q output to a transistor?

I also get stuck on running parallel circuits - how do I stop the current getting diverted away from one line of high resistance to the one with lower? I imagine there is some formula for equalising resistance so that current flows in both circuits, can someone help me understand how to get current flowing into both circuits?

Sorry, I am a real noob at electronics.
 
A clock signal is how fast the chip will operate. Do you know what a 555 Timer is?
 
yup, i already have build a circuit with a 555 chip ... my design for the calulator uses the clock to read/write to the flip-flops. First though I just want to control the inputs manually to see that the 4013 works the way i expect it to. Ie data only gets set when the clock has input. I did build a flip-flop using just transistors and resistors, so I understand how the chip should work ... i even wired it up to my pc. However I don't seem to be able to wire up this 4013 chip correctly ... :(
 
It is clocked on the positive-going edge of the Clock Input.

Will me sticking a wire in and out of the clock input create an edge? I didn't think these 4013 chips were edge triggered ... I thought it would read as long as I had the voltage high.
 
Hmmm

Well hook up a 555 timer to create a nice slow signal (around 5 hz) so that if you connected a LED up to it you could see it flashing. Then try and see if it works?
 
No luck with wiring the timer up. If I hook an LED up to the 555 output I can see the flashing light. If I then put this into the clock input on the 4013, then ground S and R, it really doesn't matter what I put in D, output Q just follows the clock pulse, ie Q is high when Clock is high, and low when it is low, and I get nothing out Qbar. Can someone maybe scribble me a diagram of how to wire this 4013 with a switch controlling input to D and a 555 inputting to clk, with resistors and all, as this has really stopped me in my tracks.

Thanks,

Matt
 
If you connect the D input of a CD4013 to its Q-bar output then it should divide the clock frequency by 2. Then the Q output can drive an LED.

Using a wire as the clock input is not good. The wire can "bounce" and make many contacts and the counter might count them all.

You show your circuit with its resistors and all for us to help fix it.

EDIT: Q-bar connects to the D input for the CD4013 to divide the clock frequency by 2.
 
Last edited:
Get yourself a pushbutton momentary contact switch. Build the circuit below.
The capacitor C1 debounces Switch. The first flipflop generates a single short pulse every time you push the switch. The second flipflop changes state every time it sees the pulse on the clock input.
To make the LED brighter, eliminate the resistor in series with the LED (replace it with a piece of wire).
 

Attachments

  • debouncer and toggle ff sch.PNG
    debouncer and toggle ff sch.PNG
    26.5 KB · Views: 905
OOPS,
Ron is correct.
Connecting Q-bar to the D input makes the CD4013 divide the clock frequency by two.
 
ok, here is the circuit I built. Initially the light is off, then if I push the button the light goes on - I release the swith and the light stays on ...

Bouncing is to do with the signal from the switch bouncing, right? Which wouldn't cause the above effect, or not?
 

Attachments

  • circuit.JPG
    circuit.JPG
    13.1 KB · Views: 999
Thank you for your diagram Roff. The problem is I don't understand why you put the resistors and capacitors where they are. I am a complete noob at this, so I need a little pointing in the right direction. Can you explain briefly why you are putting the capacitors and resistors where they are? And why do you have a separate circuit at the top? What does that do?

Sorry for the really basic questions.

Matt
 
Roff corrected my mistake before.

With the D input high all the time then clocking the CD4013 makes the Q output high. So it will always be high.
Connect the D input to the Q-bar output for the LED to alternately turn on and off with each clock pulse.

Roff's circuit uses one part of the CD4013 as a switch debounce circuit.

Never leave a Cmos input floating like you show with the D input and the switch open. It must be high or low. Use a resistor for one and the switch for the other.
 
Sorry, I dont want to see the light flashing on and off. I want to see it on when D and Clock are high and off when D is low and clock is high. At the moment i push the switch and Q goes high .... I release the switch and Q remains high and never goes to low. Is it because 0v in D is not the same as low voltage, and therefore it doesnt revert Q to low? How should I wire the switch to have D low when switch is off? On my diagram should I add a resistor to the 9v railand connect to D?
 
A resistor to ground at the D input will make it low when the switch is opened. Then the LED will turn off the next time the clock goes high.
Nothing happens until the rising edge of the clock pulse.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top