Maker Pro
Maker Pro

toggle between GND & 5v?

qweets

Sep 26, 2010
48
Joined
Sep 26, 2010
Messages
48
hello there : )

I plan to use lots of flip flop ics ( cd4013bc ). At times I will need to reset them all at the same time so that all the leds go off on my circuit board. I hope to do this via a single pin from a microcontroller.

To reset an individual 4013 on my breadboard: I have to disconnect a ground wire to pin 10 and then apply 5v to the same pin (10) and release, then I need to put the ground wire back also. ( basically toggling between GND and 5v)

to do this via a microcontroller. I am planning to use another flip flop with the Q outs connected to two transistors. one transistor will provide the ground and the other 5v, so that i can controll all the resets for all the flip flops with one logic 1 and 0.

I wonder if a 2n3904 be able to provide enough current to 64 flip flop reset pins?
is this a good idea ? Or maybe there would be a better way to toggle between ground and live.?

thanks for your help. : )

(edit)
lol, I just thought , using a flip flop to reset flip flops. i would need feedback to the computer so i know what state the reset flip flop is in. it might work ,but any other ideas would be great : )
 
Last edited:

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
Wow, overkill... How about Keep It Simple...

Pull pin 10 of the 4013 to ground with a 10K resistor, not a direct connection to ground...

Take an I/O pin of your micro and attached it to Pin 10 of the 4013 as well...

When you send logic 1 out of the micro pin it will bring the 4013 pin to 5v because it will overcome the 10K connection to ground... Change the micro pin to logic 0 or even input and the 10K resistor will return the 4013 to ground...

You could even forget about the 10K and do it all with the micro logic 1/0 swapping, but the 10K is more fool proof upon power up and always works...
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
qweets,

You should consider dispensing with all of your 4013s and just using more microcontroller I/O pins. If you require lots outputs, you can use multiple microcontrollers.

BTW, how many are "lots"?

Ted
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
You should consider dispensing with all of your 4013s and just using more microcontroller I/O pins.

That really depends on the application...

If you require lots outputs, you can use multiple microcontrollers.

Generally horribly inefficient and a battery gobbler...
 

qweets

Sep 26, 2010
48
Joined
Sep 26, 2010
Messages
48
hello

thanks for your replies.

i have 64 flip flops , from a 8x8 multiplexer.

'coca cola' your idea sounds great, but i wonder about the current required to reset 64 flip flops? would a 2n3904 connected post the micro controller pin be o.k for this? also if i use a 10k resistor to ground on each of the reset pins?

thank you for your ideas : )
 
Last edited:

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
CocaCola,



> max sink/source of single micro is far below that of multiple 4013s.

Surely you are not supposing that the OP is paralleling multiple 4013 outputs to get more current drive capability? It would make more sense to parallel processor I/O pins, as fewer pins would provide more current. 4013 outputs are feeble things, indeed.

> Generally horribly inefficient and a battery gobbler...

It is true that static 4013s draw almost no Vdd current at all, but if there are LEDs being driven, this may not matter, in practice. A microcontroller is already being used; a part having more I/O pins may not mean any extra Idd at all. If one chip does not have enough I/O pins, any additional ones used just for I/O can be run at a reduced clock speed, and will draw far less current than one LED.

Efficiency of hardware may matter more than efficiency of power consumption. If you have to hand wire the thing, each extra chip and each extra wire matters.

Indeed, if the application calls for driving many LEDs, specialized LED driver ICs would be the way to go, to minimize the parts count and wiring.

Of course, if the objective is to learn about how 4013s work, all this is irrelevant. As usual, the OP has left us with little information to work-with, so we are all speculating.

Ted
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
If you are resetting them all at once you can bring them all to a single 10K to ground... If you want individual control you will need a 10K at each chip... The reset current is minimal a 2n3904 will be plenty (at least off the top of my head should be)... Since you are using so many chips and transistor vs direct drive off the micro, it's probably best to also pull the base of the transistor to ground with a 10K just to make sure it goes 'off' when you toggle the micros pin status... If you go logic 0 on the micro it should do this anyway, but like before the 10K provides a fool proof state switch...
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
qweets,

You have not mentioned what controller IC you are using, but generally, a single I/O pin will be able to drive 64 CMOS inputs.

If you need more speed, you can parallel multiple I/O pins. ( There is no requirement for speed on the 4013 reset pin.)

Does the processor use the same Vdd as the flip-flops? That would matter.

If you are still in the design phase, you should look at LED driver chips. 16 output devices are commonly available. These can drive LEDs directly, without resistors. They have serial inputs and outputs for daisy-chaining. You can multiplex the LEDs, to further reduce the chip count and wiring. Any of these can provide far more LED current than a CD4013.

Ted
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
Surely you are not supposing that the OP is paralleling multiple 4013 outputs to get more current drive capability? It would make more sense to parallel processor I/O pins, as fewer pins would provide more current. 4013 outputs are feeble things, indeed.

The fact is most micros have a low total port and total chip sink/source regardless of the number of pins on the micro... Most people simply ignore this and think they can use every pin to it's rated max never considering the port(s) max or the chips max... Spreading this total load over multiple 4013 vs one micro gives more total drive ability in almost all cases...

It is true that static 4013s draw almost no Vdd current at all, but if there are LEDs being driven, this may not matter, in practice. A microcontroller is already being used; a part having more I/O pins may not mean any extra Idd at all. If one chip does not have enough I/O pins, any additional ones used just for I/O can be run at a reduced clock speed, and will draw far less current than one LED.

My reply was in regards to multiple micros not, more pins that was covered above.. IMO a it's a waste to slave micros to nothing but pin extenders...
 

qweets

Sep 26, 2010
48
Joined
Sep 26, 2010
Messages
48
thanks again cocacola , i shall use a 2n3904 and a 10k on the base of the transistor , as you mention, thanks

hi Ted i am using an arduino. and need 60 or more leds. each of the 4013s uses a transistor so to power them individualy. the arduino will be running from a 12v regulator that will also power the whole project box.

ive done so much already that im kinda set on my circuit. i wasnt keen to use 2 or 3 arduinos. i found a multiplexing video and was hooked on the idea. but needed to latch the outputs , so i use the flip flops to latch the leds on. works great so far. : )

thanks again for your help & have a great weekend.
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
qweets,

So the 4013 Vdd supply is +12V? Then all of the Arduino pins controlling the 4013s require level shifting. The MC14504 is a CMOS hex level shifter. That would do for the reset, as well.

Next time you do this, consider:

If you are using transistor LED drivers, and have 16 I/O pins on your Arduino, you don't need any 4013s. Possibly some level shifters for the anode drivers.

A single LED driver IC might replace all of the 4013s and 8 of the transistors. Look at the driver IC discovered by Steeeeeeeeve, in another current thread on this forum.

Just some ideas.

Ted
 

qweets

Sep 26, 2010
48
Joined
Sep 26, 2010
Messages
48
hi

There is a 5v regulator post the 12v reg for the 4013s , (the 12v regulator powers the whole project box.)

i shall try find the ic you mention,

thanks : )
 

TedA

Sep 26, 2011
156
Joined
Sep 26, 2011
Messages
156
qweets,

I'm sorry, I didn't understand about the power supply. So the controller and CMOS logic are all running off +5V.

You should be able to connect the the logic lines directly. Even the 4013 reset. If you want the 4013 array to be reset at power-up, adding a resistor to + 5 should take care of this.

( Should. I do not know about the Arduino's I/O pin behavior during power-up and initialization. I would hope that the pins do not jump up and down. This is a common-sense requirement, but in the past, both IBM PC parallel ports and Intel 8255 I/O chips would do crazy things that had to be designed-around.)

And don't consider all my advice to look at other solutions as commands to change what you are doing. If you are well into building the project it may make more sense to keep going forward with the present plan. The suggestions may be more useful for the next time you start such a project, or for another reader gleaning ideas for his project.

Speaking of plan, do you have a schematic of what you are building? If you could post it, we will be glad to look it over.

Ted
 

qweets

Sep 26, 2010
48
Joined
Sep 26, 2010
Messages
48
Thanks Ted , I had a play with a shift register today and it sure seems a better option.
with a Smaller foot print , less soldering and there will be less pins used on the arduino.
Also i do not need to blink the leds very fast either ( and they latch) so i may be able to daisy chain a few more of these ic's too. (74HC595)

it was a tough decision to scrap the original multiplexing circuit, as i spent ages on it. but yep, you were right.

so thanks again for the idea of looking up led driver ic's, it was definiately worth the experiment today.

have a great weekend. : )
 
Top