Up said:
Hello-
I am using a 4013 as a toggle to control a LED.
Simple school project.
I have Qbar connected to Data, Q is to a small fet that turns on a LED.
The clk input is connected to a MOM push button switch that grounds it
out when pushed.
I have RESET and SET at ground.
It works great so far!!
Now, how do I control the Startup condition?
I need to have one that powers up with the Q high (led on)
I also will use the other half of the 4013 in the same exact way,
totally independent, but need this Q to startup LOW( that led off).
Thanks.
Alvin
Hi, Alvin. I'm hearing that this is what you're doing with 1/2 of a
4013 (view in fixed font or M$ Notepad):
` .-----------------------.
` | .---. |
` | | | |
` | | | |
` | === | |
` | GND | |
` | .------o------. |
` | | S | |
` '----o D Q o-----------> To LED Driver
` | | |
` T | | |
` --- | | |
` .----o o------o 1/2 4013 | |
` | |CLK | |
` | | | |
` === | Q'o----'
` GND | |
` | R |
` '------o------'
` |
` ===
` GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
The way to get it to start in a known state is to apply a momentary
pulse to the SET or RESET pin (not both) at startup like this:
` .-----------------------.
` | .---. |
` | | | |
` | | | |
` | === | |
` | GND | |
` | .------o------. |
` | | R | |
` '----o D Q o-----------> To LED Driver
` | | |
` | | |
` | | |
` VCC o 1/2 4013 | |
` + |CLK | |
` | | | |
` .-. | Q'o----'
` 10K| | | |
` | | | S |
` '-' '------o------'
` | |
` o---------------'
` |
` ---
` ---
` .01uF |
` ===
` GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
The R-C will result in a brief (about 0.1 ms.) high pulse at the SET
pin, which will result in the 4013 coming up with Q = 1.
You've got a bit of a problem, though, with the clock input, at least
the way you describe it. You're trying to create a toggle, or "T" F-F
out of a D F-F. That means there can be one and only one clock
transistion each time you press the button. CMOS inputs can be seen as
very small (pF range) capacitive loads. Because of leakage current on
your perfboard or imperfections in the chip, your input seems to want
to float high. When you press the button, you're discharging that
small capacitor, leading to what seems to be a good single logic
transistion.
That's not a good idea for a couple of reasons. CMOS inputs aren't
like TTL inputs, where they just naturally go to onoe logic state. And
also, it's very bad practice to allow slow transistions on clock
signals unless they're going into a schmitt trigger or something else
that will shape them up. Strange things happen inside clocked logic
ICs when the clock transition is pokey, and none of them are good.
Possibly you're the beneficiary of beginners' luck.
Anyway, the other half of the 4013 can help you with your issue here.
If you've got a SPDT pushbutton, you could try this with the other half
of the IC (view in fixed font or M$ Notepad):
` .--o-----------.
` | | |
` | .-. |
` | | | |
` | | | |
` | '-' |
` | | .------o------.
` VCC | === | S | Debounced
` + | GND.--o D Q o-------->
` | | | | | Clock Signal
` | o-' | | |
` '----o--__ | | |
` o-. o--o 1/2 4013 |
` | | |CLK |
` | | | |
` | | | Q'o
` | === | |
` | GND | R |
` | '------o------'
` '--o-----------'
` |
` .-.
` | |
` | |
` '-'
` |
` ===
` GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
(Note that we're're following one of the primary rules of CMOS, which
is to never leave any input floating. Even if it isn't doing anything,
the intermediate logic level at the input almost always dramatically
increases power dissipation.)
The SPDT pushbutton is normally asserting the RESET input high. When
you press the button, it will let go of RESET before it asserts SET,
and you won't have to worry about pushbutton bounce causing multiple
clock transistions. When you let go of the pushbutton, SET will be let
go, but the Q output will remain high until the first contact of the
switch with the RESET input. This is called debouncing. One and only
one logic transition.
So, your whole one IC debounced toggle flip-flop should look something
like this:
` .--o-----------. .---------------------.
` | | | | .---. |
` | .-. | | | | |
` | | |10K | | | | |
` | | | | | === | |
` | '-' | | GND | |
` | | .------o------. | .------o------. |
` VCC | === | S | | | R | |
` + | GND.--o D Q o--------. '---o D Q o------>
` | | | | | | | | |
` | o-' | | | | | | |
` '--o--__ | | | | | | |
` o-. o--o 1/2 4013 | VCC'-----o 1/2 4013 | |
` | | |CLK | + |CLK | |
` | | | | | | | |
` | | | Q'o .-. | Q'o---'
` | === | | 10K| | | |
` | GND | R | | | | S |
` | '------o------' '-' '------o------'
` '--o-----------' | |
` | o--------------'
` .-. |
` | |10K ---
` | | ---
` '-' 01uF |
` | ===
` === GND
` GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta
www.tech-chat.de
You can put your R-C pulse at the SET or RESET pin of the 2nd 1/2 of
the 4013, depending on what you've got at the output, and whether you
need it to power up ON or OFF. You will also have one and only one
logic transition for every press of the pushbutton.
Good luck with your homework
Chris