D-Type flip flop for toggle. Slap-a-duck

AnalogKid

Joined Aug 1, 2013
11,044
Not changing the rules, just pointing out that while part count is one indicator of the total effort in assembling a circuit, total pin count or total soldered pin count also have metric value.

ak
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
Hi again, I just received my new chips, and have another wiring question. I still want to toggle on and toggle off.

http://www.ti.com/lit/ds/symlink/cd4013b.pdf

Q1: Ties to my LED ( load )
|Q1: Ties to D1
Clock1: Ties to my 555 timer output
RESET1: ?? ( How can you tell this is supposed to go to ground or hot? )
D1: Ties to |Q1
SET1: ?? ( How can you tell this is supposed to go to ground or hot? )
VSS: ground ( A weird way to write ground I think )
VDD: +5v power

The other ports shouldn't matter because I only need one flip flop. My question is what do I put on Reset1 and Set1 so this will function properly?

I test REST1 & SET1 to the ground and it seems like it might work right, but I'm not sure if that's proper. When both were set to ground I was able to toggle the LED using my finger instead of a 555 timer as the clock. If I touch it, the LED turns on, touch it again it turns off. Weird, but cool if that's how it's supposed to work. :)
 

crutschow

Joined Mar 14, 2008
34,452
The other ports shouldn't matter because I only need one flip flop. My question is what do I put on Reset1 and Set1 so this will function properly?
Did you not look at my circuit in post #5?

The other ports do matter. All unused inputs on a CMOS chip must be tied to ground or you may get flaky results.
 

AnalogKid

Joined Aug 1, 2013
11,044
As shown in the Function Table on page 10 of your datasheet, both the S and R inputs must be held at a logic low for the flipflop to function when clocked. They override the clock and data inputs.

Vdd - drain voltage, Vss = source voltage, Vcc = collector voltage, Vee = emitter voltage. Note that the CD4066 analog switch has both GND and Vss pins because the two are not necessarily equal.

ak
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
Did you not look at my circuit in post #5?

The other ports do matter. All unused inputs on a CMOS chip must be tied to ground or you may get flaky results.
It's been a while but I did see your post, Pre and CLR = Reset and SET? I just didn't know what I was looking at I guess.

AnalogKid: Vss = source voltage, so that should have been my +5v? I guess I put power to the ground and ground to the power. I'm surprised it worked at all. I'll rewire it when I get home to test it.

When wiring it, there is a little semi-circle cut out at what I thought indicates the top of the chip and a little circle cutout at the bottom center. On my 555 Timers, the top of the chip where power comes in on the top right, there is a semi-circle cutout in the center top. Because the semi-circle, that's why I thought Vss must go to ground because it was on the opposite side of the cut out semi-circle.

Thanks all
 

AnalogKid

Joined Aug 1, 2013
11,044
AnalogKid: Vss = source voltage, so that should have been my +5v? I guess I put power to the ground and ground to the power. I'm surprised it worked at all. I'll rewire it when I get home to test it.
NO! Do *not* change your power connections.

"Source" is the name of a pin on a FET or MOSFET, the one that is approximately equivalent to the emitter of a bipolar transistor. For N-channel FETs it usually is more negative than the Drain. In logic devices, Vss is connected internally to many of the N-channel transistor source pins, making it the more negative power input point, and almost always connected to the power system GND. Vdd is connected to many of the P-channel transistor drain pins, making it the more positive power input point.

ak
 

MrChips

Joined Oct 2, 2009
30,809
Circuit ALERT!

Someone in their infinite wisdom started to use electron flow when the FET (field-effect transistor) was invented.

Source, as in Vss, stands for the source of electrons.
Drain, as in Vdd, is the place where electrons exit the device.

Thus, follow AK instructions given above.
 

crutschow

Joined Mar 14, 2008
34,452
Vss = source voltage, so that should have been my +5v?
Nooooooooooooo. :eek:
Pre and CLR = Reset and SET?
PRE is Preset (SET) and CLR is Clear (Reset).
Someone in their infinite wisdom started to use electron flow when the FET (field-effect transistor) was invented.
That's because electrons are the carriers and you have to use electrons when describing the working of all semiconductor devices using solid-state physics, the same as using electrons when describing the internal operation of vacuum tubes (valves).
Trying to use positive carriers in those calculations does not work well. :rolleyes:
 
Last edited:

Thread Starter

sirchuck

Joined Feb 14, 2016
150
I just set it up and got it working now. For future readers ( including myself when I forget ) I had my vibration sensor connected to the +5v rail and to the clock. I figured when the switch vibrated it would send a + signal to the clock pin on the CD4013B chip and initiate the toggle. However, the clock apparently expects a + then a - then a + signal to switch. I then connected the vibration sensor to the |Q and Clock instead. That works correctly.

When I shake my breadboard, the light turns on, then shake again and the light turns off. :) I'll have to re-read some of the circuits above to figure out how to use capacitors and resistors to correct for double bouncing in the vibrator switch, but I'm excited to see it working! With my vibration sensor, the double bounce problem doesn't happen often.
 
Top