how do I wire a 74ls74 d type as a flip flop?

I had an old 74ls74 in my kit so I decided to learn about it.
I wired it up 5v (from a usb socket on the computer via a bread board power unit)

see (picture of similar supply)

http://www.ebay.co.uk/sch/i.html?_odkw=blob+board+power+supply&_osacat=0&_from=R40&_trksid=p2045573.m570.l2632.R2.TR2.TRC1.A0.H2.Xbread+board+power+supply.TRS0&_nkw=breadboard+power+supply&_sacat=92074

5v to pin 14. 0v to pin 7.
5v pin 1 (clear) 5v pin 4 (set)
pin 2 to pin 6 (d to 'not q')
pins 5 (q) and 6 to leds and resistors (checked working)
pin 3 (clock) to a wire that I could move around the bread board and touch 5v and 0v.

When powered 'not q' led lights, sometimes the q comes on as the 'not q' goes off when I touch 5v but when I remove it it goes back to the 'not q' on state.
Usually nothing happens.

Suspecting a duff chip after moving all my leads to the other side of the package and getting the same thing I purchased a new chip, this is doing the same?

I can't find anywhere on the net that actually shows how to test a d type flip flop.
Do I need to load the other side of the chip in some way?
Or what else could I be doing wrong?

I have a copy of circuit wizard and it works fine in the simulator but it is not the first time actual testing proves different to the simulator.

Thanks.

Outputs
S R D > Q Q'
0 1 X X 0 1
1 0 X X 1 0
1 1 X X 1 1

If you connect Q' to D you get divide by two for a clock input.
Set and Reset should be obvious.

.

I was trying to get it to act as a toggle by feeding the q' into the d input and making it toggle every time I put a positive edge on the clock.

Should work.

Hmm, should, but doesn't. It works on the simulator.
Do you think it might be that I am just using a flying lead on the clock? If a clock pulse is applied then surely there is a transition time that the signal is between 5v and 0 which is what I am causing with the flying lead.
If I put 0v on the clock, put 5v on d and pull the clock wire out the state changes to q' on.
If I put the clock back into 0v and put 5v on d when I remove the clock from 0 it toggles and q goes on this happens back and forth as it should if I gave it a positive edge clock pulse?

With d back in q'
I have a cheap logic probe and holding the probe on the q' pin it flashes the probe as if it it changing states very fast while I am just touching the 0v pin, I am not holding it very well onto the 0v pin. So it looks as if that could be my problem, I will set up a clock pulse, probably from an arduino to test it. Thanks for your help the picture of the dtype with 5v to set and reset helped.

Have you connected an output on an Arduino to the clock of the FF and a common ground between the two.
Then toggle the clock line?

The 74LS stuff works well up into the multi megahertz range - "touching a wire to +5 or GND" actually probably makes the connection many many times. It will be somewhat random where it stops. You need to provide a clean clock signal to the flip-flop if you want reliable outputs. Used to use those all the time (then there was the year - 1974 comes to mind) where the date code and the chip number were both possible numbers for the chip - a chip with 7408 and 7410 on it could be either a 7408 manufactured in the 10th week of 1974 or a 7410 manufactured in the 8th week of 1974 (both are 14 pin chips)). Drove us nuts back in the day :o

Drove us nuts back in the day :o

Come on, looks like you are a young pup.

.

I wish! Now THAT is one cute pup!! The image I use is of my female when she was about 6 months old (about 5 years ago). My male is 8 now. Hair today, hairier tomorrow :slight_smile:

I realised last night that the blink program is a clock pulse and I have a pro mini that has a blink program in it so I just connected that up and the 74ls74 works as it should.
Thanks for the replies.

Glad to hear it. Most people don’t realize that when you “touch” a wire to something (or click a switch) there are often many if not hundreds of make-break connections that happen in the first ms or two, hence the reason for all the discussions on “debouncing” :slight_smile:

And you have a decoupling capacitor on the 74LS74? You always need decoupling right at each
chip to avoid risk of erroneous behaviour. 0.1uF ceramic is pretty common. Within an inch of
the chip pins.

With 74xx and 74LSxx series you don’t connect inputs directly to 5V, always use
a resistor (typically 1k for 74xx, 10k for 74LSxx series). This is because TTL inputs have an
absolute maximum input voltage rating very close to 5V (the supply absolute maximum is 7V which
is safe against typical spikes and transients). Occasional random chip failures are possible
if you connect TTL inputs directly to 5V, depending on the quality of the power supply etc.
TTL is a very asymmetric logic technology.

CMOS chips like 74HC74 don’t have this restriction and use much less supply current. These
days TTL is more expensive than the superior CMOS parts, and only made for spares/repairs.

The 74HCxx family also have the advange of running on anything from 2V to 6V supply.

Going back to flip-flops: there are various sorts, 3 main categories are D/Q, R/S and J/K, and
its worth studying the differences - some are edge-triggered only (like D/Q), others are transparent
(on one phase of the clock the inputs drive the outputs directly), some have more pins (asynchronous
reset for instance). You can get many D/Q flipflops in one package with shared clock (74xx374 for instance).

You are an expert now! :wink:

.

You are an expert now!

Why do sense some sarcasm there ? :sunglasses:

I was told an ex is a has-been, a spirt is a drip under pressure.
EX-SPIRT ---> EXPERT :wink:

"Bartender, I'll have whatever that bloke is drinking..."

Hi, you need to make an antirebote circuit, you can make it with LM555 or a Schmitt Trigger ok?

I will leave the link of the information:
Antirebote:

7474 as a D type Flip Flop:
You need to set Preset and Clear in "1", D is connected to Q negative. In the clock signal is the button and the Q positive output is where you are going to put your Led or any load you have ther.

Your probably is almost certainly “bounce” in the loose wire you are using as a switch.
If you’re going to experiment with TTL chips, it is EXTREMELY WORTHWHILE to make yourself some bounceless pushbuttons.
Screen Shot 2017-04-07 at 6.56.11 PM.jpg

With 74xx and 74LSxx series you don’t connect inputs directly to 5V, always use a resistor (typically 1k for 74xx, 10k for 74LSxx series). This is because TTL inputs have an absolute maximum input voltage rating very close to 5V

Really? I recall seeing TTL with inputs tied directly to Vcc all the time (and usually 2.2k for pullups, if any.)

Really? I recall seeing TTL with inputs tied directly to Vcc all the time (and usually 2.2k for pullups, if any.)

Yes, you can do that if you have no intention of pulling that input to GND. The pullups are necessary when you want to establish a default HIGH state which will later be pulled low. Obviously can can't pull an input LOW it it has been hardwired directly to 5V . But if you want that input PERMANENTLY HIGH, then yes you can. The same applies to the reverse. (hardwired PERMANENTLY LOW).