News:

SMF for DIYStompboxes.com!

Main Menu

CMOS switching

Started by MohiZ, April 30, 2009, 02:40:07 AM

Previous topic - Next topic

MohiZ

I've read the article on the Wicked Switches, and I've also read RG's CMOS switching paper. These show how to make an effect bypass switching with CMOS chips using a momentary switch, inverters and a bilateral gate. I'm wondering if it would be possible to switch between not two, but three different modes like this? Say, if I have two effects in the same box and a DPDT switch. Could I make it so that it would sort of toggle between bypass, effect1 and effect2? It could be so that one position of the DPDT switch would always be bypass, and the other position would be either effect1 or effect2, and the effect in question would change every time you kick through bypass. Sort of like switching gears on a manual gearbox, you always have to move the stick through neutral (bypass) to switch gears  :D. So I presume some kind of flip-flop circuit would be needed, but I can't seem to figure out what kind.

brett

Hi
you should be able to do this by "cascading" flip-flops.
Personally, I think two switches are more flexible (one for bypass/effect and one for effect1/effect2...).
cheers
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

MohiZ

Two switches would be more flexible in a normal enclosure, but this comes inside a wah, so it's easier if I can do it with one switch. And a part of me wants to know if this can be done just out of curiosity  ;)

R.G.

The simplistic answer is yes, you can do pretty much anything whatsoever with switching ...*IF*... you are willing to put together the logic that describes it as either hard logic chips or programming in a micro controller. Any function of two switches, even sequential functions and not simple combinations, are possible if you can do the logic design.

Your description of what you want is a simple state machine, where the next possible state is a function of the previous two states. It's not too complex to work out, but might get messy in actual logic once you did the design. State machines are most simply understood as the combination of a digital latch (set of flipflops) sufficient to contain the total number of states, allowed plus disallowed, and a clot of decoder logic to decode next-state and outputs from the digital latches.

In your case, you want the states (current -> next) to be:
a) Fx1->bypass
b) Fx2->bypass
c) bypass -> Fx1
d) bypass -> Fx2
and it's mildly complicated by the fact that the previous state before bypass must be remembered to make the right jump after bypass. So in logic terms, it will need both the ability to decode to four outputs (that is, two flipflops to hold the possible outcomes) and also an additional flipflop to indicate the last-previous Fx state, so I think three flipflops are needed, plus gating to set the previous state flop and to set the output steering to the right state. I'd do it with a four bit latch and a PROM if I were designing it; actually, I'd program a PIC, as I could do the whole mess in one chip instead of the (guess) four logic packages needed to do this in random logic.

But it's only 7.00AM here and I'm still having my first coffee...  :icon_lol:
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.

MohiZ

#4
Thanks for your suggestions! I came up with this, will it be alright? I tried it on a breadboard and it seemed to work OK. It changes the output state every time the switch is flipped from down to up and down again. The idea is that if I use a DPDT switch, the other pole of the switch can be used to switch bypass on. This inverter thingy would control which effect is in use when the switch is not on bypass. Of course, there would have to be some kind of bilateral gate that's controlled by this circuit. So this is just the control circuit:



I'll explain the idea behind this. It's a bit similar to the momentary switch configuration used in the Wicked Switch. When the switch is down, the state is stable because the two inverters are directly coupled to each other

Let's assume the "out" is high, and thus the input of the rightmost inverter is "low". The cap now charges to "high" voltage thru the 220k resistor. When the switch is flipped up, the cap changes the input of the rightmost inverter to "high", because it's now directly coupled to its input compared to the 100k resistor of the leftmost inverter. Now the "out" changes to low, and the leftmost inverter's output changes to "high", and enforces the rightmost inverter's state via the 100k resistor. Because the 220k resistor is bigger than the 100k resistor, this state is stable.

Then when the switch is flipped down, the state does not change, but the cap begins to charge to "low" potential through the 220k resistor. When the switch is flipped back up, the state changes, etc..

I came to the conclusion that this is not a very flexible way of switching, so I probably won't use this after all  ;D Maybe in a later project.. Or maybe this can be of use to someone.