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.

4013 Toshiba flip flop

Status
Not open for further replies.
Hi all, I need a pro... I am slowly learning electronics, all my experience is line voltage electrical wiring and control, including, and/or/not/nor/nand logic so naturally (after 23 years) I am going to think like an electrician (which I learned fast, Ya Can't ! lol ) so if you can , please try to explain it so I can understand the logic, i.e on or off, now my question is about the standard operation of a flip flop. So far all I understand is it can hold 1 bit of memory and can also be used as a latch, similar to a motor starter auxilary holding contact that opens when the coil line opens and drops out the relay but I know it's nothing like that at all. Matter of fact, I hooked it up the way I saw in a diagram and it started acting like it had a mind of its own ! , it would come on and off by itself and when my hand came near the clock input wire it sounded like it was oscillating , kinda freaked me out.... i guess the chip has some internal capacitors, anyway, the following is how I hooked it up, so if you can I would appreciate the feedback and If I can ever help any of you with an electrical problem or code question I would be happy to return the favor: Thanks in advance, Jim ..... (I do have a 555 pulse timer if I need it)
but I manually did this by hand by making contact w/ a wire from positive to Pin 3, I would touch it for a second and it would not reset unless I touched a negative to it, then a positive pulse again )

Pin 1 ~ Out to piezo buzzer
Pin 2 ~ Connected to Data(5)
Pin 3 ~ Pulse from my clock (9 V pulse I did by hand)
Pin 4 ~ Reset , I connected to negative
Pin 5 ~ Data , connected to Pin 2
Pin 6 ~ Set , connected to negative
Pin 7 ~ Negative (0V)
Pin 14 ~ Positive (9V)

As you can see I was only using one side of the Toshiba 4013B
and I also inserted a 1000uf decoupler in the power bar and it really did'nt do anything... A tall order I know, Please help..... :eek:
 
The 4013 is a simple D-type flipflop, which means the output exactly follows the inputs, triggered by a rising edge of the clock.

From what you say, you are using the /Q for your data input. I suggest you simply apply positive to pin 5 and clock (by hand, as you say but something else would be much better) with positive. The piezo buzzer should then sound.

The fact you are not using a proper clock will cause you much grief. Get down to Radio Shack and get a 555 timer chip. Check other threads here to see how to hook it up. Let it be your clock and you'll be well set.

EDIT: The piezo may not be the best way to see the output. A LED and current controlling resistor would be a better indication.
 
Last edited:
hi jb,

The 4013 is CMOS technology, it has a VERY high input impedance, so hand capactance, near the clock pin,
if its 'floating' [ not connected] will send the chip into instability.

At least, connect a 10K resistor from pin 3 to ground [pin 7 is also at ground 0V].
Don't refer to ground 0v as [negative], it can be misleading

The 4013 at best, is very sensitive to the clock, if your just touching a wire on/off it will go unstable.

Tell us what you want to do with 4013 and we will help.

You have connected the 4013 as a divide clock by 2. by connecting /Q [2]back to D.[5]
 
Last edited:
Sound like you have a few problems here. By just touching or going near the wire, you're coupling 60Hz into the input of the 4013 and making it "oscillate". You could help get rid of this by putting the pulldown resistor (~10K) from pin 3 to ground (pin 7) like Eric said. I think a better way to fix this and the loads of switchbounce you're getting from just touching the wire to the terminal is to condition the signal, possibly using the 555 as a one-shot (AKA monostable multivibrator) before the 4013 input like AllVol suggested. Also any unused input pins on the chip (8,9,10,11) must be tied low (pin 7) to prevent strange behavior.
JB
 
Last edited:
Got it working

Thanks for all the advice, after I submitted the thread I sat down and decided to build the 555 pulse timer to send even signals to the 4013, I figured you all might tell me to build that first and then ( as mentioned in one of the replies) I got rid of the piezo buzzer and used LED's in its place. Now I have a pulse from the 555 about every 1.5 seconds and I can monitor the 555 pulse (which I did'nt realize at the time that the 555 is actually pulsing +9V then goes to 0V) So now I can see the pulse go 0V and LED1 latch then the next pulse the second LED latches and then it goes back to the first LED, so it's working at least for now. I can only guess that if I add another 4013 that the same sequence should happen. I would be trying to get the sequence from LED1 to 2 to 3 to 4 then reset and go back to 1. Will that work ? Thanks again for all the great advice, I'll have tons more questions as I continue with this, I am waiting for some components in the mail for a clock I want to build, I have the 555 and I'm waiting for some segment LED's, a decade counter and a comparator. Forgive my terminology of semi-conductors, sometimes I use the wrong wording but I think you know what I am trying to get across, after a while I'll be talking just like all of you. electrical wiring and inspection is night and day when it comes to electronics, alot of people dont believe that, but it's true. I'm proof ! Thanks again !!! jb :)
 
You are following the correct steps in troubleshooting. Keep up the good work. Help is at hand on this forum.

Just keep in mind the TTL/CMOS IC families are very fast devices. They will surely pick up signals changes longer than a few tenths of nanoseconds and thus the bouncing of switch contacts on closing or manually touching a wire to a certain pin, albeit happens in milliseconds, appears "very slow" to the ICs and easily pick up by them and they react accordingly, giving the wrong impression that they malfunctioned.

While you are waiting for your next lot of components to arrive, why not take some time and study/experiment with the 555 in details?
 
jbelectric777 said:
so it's working at least for now. I can only guess that if I add another 4013 that the same sequence should happen.

Way to go, JB!! As someone once told me,'blink a LED and you can rule the world".

And yes, four d FFs do equal one binary counter.
 

Attachments

  • DualD.JPG
    DualD.JPG
    38.3 KB · Views: 1,251
Thanks AllVol & LC, I see that the last ff's output (Q) is connected to the base of an NPN transistor which when turned on will pull Vcc to ground, if this is right, is it because of what you said previous pertaining to the IC not having any open pins anywhere ? And is the reason because as you both mentioned that it's that sensitive to noise / bouncing / or even my hand ?
 
Last edited:
The circuit posted by Allvol can be simplified.

The transistor and resistor are not necessary. Simply connect D of the first to Q bar of the last.

Have you done a search of this forum for terms such as "4013". "Flip Flop", 'Counter", "7474", etc. There have been plenty of threads on this in the past.
 
Last edited:
Thanks Len, I have another question. I pulled the battery source last night thinking these 4013's had some kind of internal capacitor/s to hold memory. I re energized them this morning and now I get the 555 pulse but the IC is now just pulsing both outputs in paralell (same time) It did this yesterday and I fixed it by lifting the pulse lead and at the right time placing it back in its terminal. Now I learned yesterday that the output follows the input but inverted (Ithink) Is there some way to just let the 555 pulse and take a tap from the power rail and tap it somewhere to get them back to sequence ? Yesterday was just luck and if I tinker long enough I'll get it back the right way but I'd rather know why not just how so if it happens again I'll know why and I'll know how to fix it. Thanks , jb
 
Answered my own question, touched the 0V to #2

It's sequencing now, I waited for the first output to go high and when it did I touched output 2 to 0V which kept it low while 1 was high. It went back through the sequence and started working again. Is that the theory behind using flip flops as an electronic combination lock ? And am I right to say that with four flip flops the total combinations would be 256 and 5 flip flops would be 3125 and so on ? (The number of FF's to the power of that number) Thanks , jb
 
hi jb,

To RESET the counter chain, link ALL the pins 4 and 10's together, connect them to 0V Gnd with a 10K resistor.
Connect another resistor 470R from the linked pins to +V, via a normally open push switch.

When you push the switch ALL the 4013's will be RESET.
The 4013 have no memory at power OFF, its just random when you power up.

If you would like a circuit that automatically RESETs the counter on power up, just ask.

The binary progression per half a 4013 is 2. So per half 4013, 128,256,512,1024, 2048......
[ obviously a 4013 is a dual FF, so its doubled]

All 4 LED's 'LIT' is binary 1111 or decimal 15 or 'F' in hex notation, another 4013 added would be 11,1111 or decimal 63 or '3F' hex
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top