another logic switching question... help!

Started by caress, September 04, 2010, 07:31:36 AM

Previous topic - Next topic

caress

most likely pointed in rg's direction...  ::)

so i'm wondering about logic switching...  i'm using 2 CD4066s (used as SPDT switches) driven by a CD4049.
what i'm hoping to do is to use a rotary switch to select the different switches in a sequence, like so...

using all 8 switches (ABCDEFGH) starting CLOSED the rotary switch would simply open the next switch in line, keeping the previous switch open as well so you'd get this (O-open, C-closed):
ABCDEFGH (C)
A (O) BCDEFGH (C)
AB (O) CDEFGH (C), etc.
switching back would close the previous switch.

i understand that logic gates work on high/low states, but is there a way to get in-between points to do this or would i need a bunch of 4049s, each driver assigned to each switch?  i thought perhaps a CD4051 would help me get where i need to go, but i'm just unsure of how...

slacker

You could do this with a rotary switch and a load of diodes to handle the logic, I'm not great at explaining things though so I'd have to draw it up instead.
I think the simplest way would be to use an LM3914 LED driver. If you set this to bar mode that will give you outputs that follow the exact pattern you want, you might need to add inverters to the outputs, or you might be able to hook them straight up to your CD4066 depending on what you want.
To control it you just need a pot wired as a voltage divider hooked up to the signal input.

Processaurus

This is the brute force approach:  You can do it with no 4049 inverter, and just the analog switches and the SP9T rotary switch (probably a 2 to 12 position switch).  You need a ton of diodes (35, I think).  You tie all of the 4066 control lines low with 100K resistors to ground.  Next, the common on the SP8T rotary switch goes to V+.  Lastly, each throw of the SP8T switch fans out, through series diodes to each of the 4066 control lines you want that throw to turn on.

This is more elegant, you use a ladder of 8 buffers from 2x CD4050 hex buffer IC's.  The output of each buffer goes to each 4066 control input.  The buffers outputs are also connected through a series 100K resistor to the input of the next buffer, in a line, like elephants holding tails of the one in front of it.  The last buffer in the line (the caboose elephant in the train) has its input tied to ground through a 100K resistor.  The SP9T switch has its common tied to V+.  Each consecutive throw goes to the input of each of the 8 consecutive buffers, except the first (the all off position).  That way, the buffer elephants tell the one in front to TURN YOUR 4066 SWITCH ON!  and PASS IT ON!  The ones behind don't get the message.

You could probably just use one 4050 and micky mouse a buffer for 7 and 8 with a diode in place of each buffer.  I originally thought of an 8 diode ladder, but thought the voltage drop would be too much getting toward the front of the train for a reliable logic state.

R.G.

The replies you received are good ones. If you want to enable one of a number of paths, a rotary switch is a good way to do it. Rotary switches usually have a single contact which *closes* to the selected position, instead of opening. This is mechanically simpler to do than to have all positions but one open, not to mention far more reliable.

Let me take you for a (very) short ride in logic theory. The terms "one" and "zero" in logic theory refer to the first way of representing "true" and "false" as logical results. The translation into switch open/switch closed or voltage high/voltage low is purely arbitrary, and flipped mentally by skilled logic designers without a thought.

You can use a rotary switch to either pull up one of (for instance) eight of its throws by tying all eight trows to ground through a high resistance. You can use the same switch to pull one of its throws to ground by pulling all of the throws UP to +V with resistors and using the common switch contact to pull one of them at a time down.

In either case, the active state is wherever the common switch contacts is. If it pulls a pin up/high voltage, that is "positive logic" where a true or one state is represented by a high voltage. If it pulls a pin down to select, that is "negative logic", where a true or one state is represented by a low voltage. They are both logically consistent, and in fact are commonly translated between in logic design.

If you only need to select one of your transmission gates, whether that is to select one of the eight to be closed ( = equals transmitting! ), or all but the selected one transmitting, then all you need to do is to pick whether you want the switch position to pull the selected control down to ground (equals 4066 NOT transmitting for that one) or to have all the 4066 control pins pulled down to ground, but have the switch connection pull the selected one UP to +V (equals that one and only that one 4066 transmitting).

Did that help?
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Earthscum

I've got an idea...

When I read the OP, first thing I thought of was LED driver as well. How about you try a hex schmitt instead of the 4049? Make a resistive divider between each input. Now each stage is going to get voltage at a different rate. Now you should be able to wire up another resitive divider on your rotary switch to change between the particular switching levels. Seems doo-able to me, but is most likely harder done than I think. I kinda forgot about overcoming hysteresis on the switch back.
Give a man Fuzz, and he'll jam for a day... teach a man how to make a Fuzz and he'll never jam again!

http://www.facebook.com/Earthscum

Processaurus

Quote from: slacker on September 04, 2010, 08:10:16 AM
I think the simplest way would be to use an LM3914 LED driver. If you set this to bar mode that will give you outputs that follow the exact pattern you want, you might need to add inverters to the outputs, or you might be able to hook them straight up to your CD4066 depending on what you want.
To control it you just need a pot wired as a voltage divider hooked up to the signal input.

Using a bargraph divider to control a series of analog switches is a really neat idea, Ian!

caress

i need to reread over all of these again to digest everything and draw up some of the ideas...
also, i mistyped there in my original post - i'm using a CD4053 as an SPDT and each input will be thrown to either ground or the output.  i remember THATS why it was a little more complex than just connecting ins to outs...   ::)

i do really like the idea of the bar display though as it can do easily do double duty.
i thought of the simple, brute concept of a rotary and many diodes, but it's just too many parts.  i'd rather spend the time laying something out than soldering in more than 30 diodes at a time...

R.G.

Quote from: caress on September 04, 2010, 06:06:29 PM
i need to reread over all of these again to digest everything and draw up some of the ideas...
also, i mistyped there in my original post - i'm using a CD4053 as an SPDT and each input will be thrown to either ground or the output.  i remember THATS why it was a little more complex than just connecting ins to outs... 
Try separating the logic of selecting a switch from what the switch does. You're generating a one-of-eight (or, more generally, a one-of-N) signal with the rotary switch. Whether it's a pull up for the selection or a pull down (and the rotary switch can select either way depending on how you wire it up) in all cases the position selected is different from the other N-1 positions.

Now think of what you want the logic signals to do. You have eight (...or N) things that can be switched. It makes no difference to the selection signals whether that's turning on a transmission gate (which is an SPST switch) or flipping an SPDT switch like the three SPDTs in a CD4053. All the selector logic knows is that one and only one of the signals to the controlled stuff is active at a time. To the limited view of the rotary switch selector logic, the controlled stuff could be CD4066s, CD4053s, or launch orders for nuclear missiles - it's just a "go" or "don't go" signal. What you choose to have the switch modules do is completely separate from what logic you have to tell them the only thing they understand, which is either "switch" or "don't switch".
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.