Simple flip flop wiring for audio A/B channel switch

Thread Starter

d-rainger

Joined Jun 9, 2016
23
Hi!
I'm trying to make the two outputs (Q and /Q) of a D-type flip flop step from high to low, alternating with each other, with every rising edge of a squarewave input (ie a simple switch going to ground). I've never used flip flops before and I'm having real trouble getting it to work!

Attached is the circuit diagram I'm trying.... Have I connected it right?? Any advice is much appreciated!

The two outputs (Q and /Q) will work JFET gates on two audio outputs, so with the flick of a non-latching switch you can step between 'A' output and 'B'.
 

dl324

Joined Mar 30, 2015
16,943
Welcome to AAC!

Tie clear HIGH; with LOW, you force the flip flop to be reset, so Q will always be LOW.

And put a resistor between the switch and 5V.
 

dl324

Joined Mar 30, 2015
16,943
If the function you want is "toggle" where Q and /Q and switch between high and low states on the rising edge of the clock pulse you will probably find this easier with a T- type FF or a JK FF.
OP had the D FF connected as a T FF. Just had a problem with reset.
 

Thread Starter

d-rainger

Joined Jun 9, 2016
23

Marcus2012

Joined Feb 22, 2015
425
I should've said each falling edge, not rising.... So would the chip I'm using be any good for that?
The one you have is positive edge triggered so I'm unsure if it will operate as you would require. You could try the 74LS112 which is a negative edge D-type or the 74LS/HC/HCT73 is a JK negative edge triggered flip-flop.
 

Thread Starter

d-rainger

Joined Jun 9, 2016
23
Invert the trigger or get a negative edge triggered flip flop.
So now I've got this (see diagram) with trigger reversed for rising edge, /CLR tied to 5v, and also added 1k between switch and earth.
It sort of works occasionally, but I'm wondering if there's some sort of major switchbounce event going on....
Or is there something wrong with the circuit still?
Thanks!
 

GopherT

Joined Nov 23, 2012
8,009
So now I've got this (see diagram) with trigger reversed for rising edge, /CLR tied to 5v, and also added 1k between switch and earth.
It sort of works occasionally, but I'm wondering if there's some sort of major switchbounce event going on....
Or is there something wrong with the circuit still?
Thanks!
Try making your 1k into a 33k to 100k.

then add a 10uF across the switch.
 

Marcus2012

Joined Feb 22, 2015
425
You need a hex inverter on the clock output before the flip-flop but this additional component maybe justify getting a negative edge JK flip-flop. There will be a delay with this D-type topology but if your clock isn't that fast it should be ok.

D-type inverted clock.png
 

Marcus2012

Joined Feb 22, 2015
425
Sorry I was under the impression your switch was controlling a stable clock pulse. In that case put the inverter after the switch if you absolutely have to use this positive edge FF.
 
Top