Doing a DP3T with logic chips

Started by David, September 26, 2006, 09:57:15 AM

Previous topic - Next topic

David

First off, I confess!  I have sinned!  In a moment of weakness, I bought a Be)^#(&*r GDI21 - which we all know is a clone of a certain well-loved analog amp simulator.  OK, I admit it.  I like the thing.  A lot.  It does what it says it does.  Something like this is going to make my life a lot easier - especially with the storm clouds that are brewing on the church band horizon.

All right.  First off, there's a movement afoot at my church to ban amplifiers from the stage.  Never mind what an amp contributes to an electric guitar's overall sound.  These idiots are only interested in bringing down SPL on the stage, and it appears they're going to win.  You know what?  I don't care anymore.  Besides, with this new toy, I don't have to.

The second issue is -- get this -- I'm being TOLD by some of the musicians to dump my digital rig and go back to analog!  Well, HALLELUJAH!!!!!   :icon_mrgreen: :icon_mrgreen: :icon_mrgreen: :icon_mrgreen: :icon_mrgreen:  Somebody give me an AMEN!  A REASON to build some pedals!  Don't that just beat all?!?!??!

I say all that to say this:  I've been planning all along to go back to an analog rig controlled with an ASMOP-type thing.  Now I'm going to put in one of the Tonepad Sinamp units.  It's just going to take me a while yet to implement it.  With all the tone potential in this amp emulator thing, it would be the cat's meow to impose some digital control over its switching.  I've been over the documentation at Tonepad enough to know that it's using DP3T switches.  I'd like to "emulate" those electronically with logic chips so that I can rig a way for a uC to drive them.

Does anybody have an idea how to implement a DP3T electronically?

Thanks!

Seljer


David

Not exactly.  And I think I may have confused the issue.  I think I really mean 3PDT, because I'm referring to two selector switches with three independent states each -- like a dual-gang three position selector switch.  What I'm having trouble figuring out is how to definitively put one pole at logic 1 and the others at logic 0.

R.G.

Yes, the issues are confused.

1. Are you routing audio through the 3P selector switches? Or logic signals?

2. did you really mean a two-gang, three-position (selects one of three positions simultaneously on two switched nodes) or a three-gang,  two-position switch? The first connects two independent electrical nodes to one-of-three-positions and the second connects three independent electrical nodes to one-of-two positions.

Any combination of the above is fairly easy to do, but there are different answers depending on what you meant.

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.

David

Quote from: R.G. on September 26, 2006, 11:17:06 AM
Yes, the issues are confused.

1. Are you routing audio through the 3P selector switches? Or logic signals?  I believe it's audio.   I haven't reviewed the schematic in depth yet as it's quite complex and I was stuck dealing with a moody preteen female this morning.  How delightful!  But I digress...

2. did you really mean a two-gang, three-position (selects one of three positions simultaneously on two switched nodes) I mean this. or a three-gang,  two-position switch? The first connects two independent electrical nodes to one-of-three-positions and the second connects three independent electrical nodes to one-of-two positions.

Any combination of the above is fairly easy to do, but there are different answers depending on what you meant.



David

#5
DUUHHHHHHHHH!  Never mind...   :icon_rolleyes:  R.G. already solved it...  of course.  His "Juggler" appears to be just the ticket.   :icon_exclaim:
I'll get me coat...   :icon_lol:

David

Quote from: David on September 26, 2006, 02:43:29 PM
DUUHHHHHHHHH!  Never mind...   :icon_rolleyes:  R.G. already solved it...  of course.  His "Juggler" appears to be just the ticket.   :icon_exclaim:
I'll get me coat...   :icon_lol:

Uhhh....  not so fast.  I keep getting hung up on the one-of-three thing.  That's what makes this so hard to wrap my head around.  If I read the Juggler article correctly, it implements a 3PDT -- like those stomp switches of Aron's.  So it's like 3 switches that select one of two states and do their selecting together.  What I need are two switches that select one of three states and do their selecting together.

R.G.

OK.

Switch terminology is that the lug that is switched to several other contacts is the pole. The places that the pole can contact are the throws.

You want two contacts that can be moved in synchronism to one of three throws. The Juggler is a 3PDT. You want a 2P3T.

Now, how do you want to do the selecting? Can you turn a knob? Do you want it to cycle through positions 1-2-3-1-2-3-... as you punch a footswitch, or do you want to have three pushbuttons, one for each position, and go directly to that one when you punch the corresponding button (i.e. radio button style)?
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.

David

I like the cycling idea.  It only takes three footpresses to rotate through the switch's complete set of states.  Also, I already know how to do this with a PIC.

Oh, man!  I smell something cool coming!

R.G.

If you know how to do the cycling with a PIC, then just make the PIC put out two logic signals that count 0, 1, 2 in binary and put that into the control inputs of a CD4052, which a a dual one-of-four 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.

David

 :icon_exclaim:

DANG!  Why didn't I think of that?!?!  Wow, that would be a sweet way to handle all the 2P3T switches at once!  Great idea, R.G. (as if you could produce anything else) -- thank you!

Now, two questions:  Donald Stringer was playing around with a 4052 and a 4017 around last Christmas and encountered some difficulty with the 4017's outputs.  You helped him diagnose that one and concluded that its outputs were overloaded.  Can a PIC16F628 safely drive three 4052s?  If I were to add CMOS buffers (like 4049s and 4050s) to each 4052 input pin, would I then be able to drive LEDs from the buffers?

toneman

"radio buttons"  INDEED!!!    8)

A PIC can drive another CMOS input easily.
Regular CMOS cannot drive a relay.  A "CMOS driver" can.  That would be a 4049 or similar.
Since a PIC *can* drive an LED, CMOS inputs are no sweat at all.
The 16F628 is a more modern version, and probably recommended for new designs.
I've been using 16F84A's, since i still have a good stash of them.
All U need are enough I/O pins for what U want to do.
AND, of course : A "Simple" Matter of Programming    :o
The newer PICs don't even need a crystal!!!
An excellent book to read is The CMOS Cookbook by Don Lancaster for CMOS interfacing techniques  ;)
U already have THE (Elcheapo) book on PICs and PIC programming   :D
Should help U with your PIC'n & a Grin'n.   :)
T
  • SUPPORTER
TONE to the BONE says:  If youTHINK you got a GOOD deal:  you DID!

R.G.

PICs have very healthy output specs indeed, as toneman pointed out. They will not have problems driving the 4052. Especially since the 4052 is a dual one-of-four and there are only two CMOS input pins that have to be driven. You could indeed drive LEDs from the PIC output.

I recommend driving the LEDs from a different set of three pins on the PIC than you use for driving the 4052, because the 4052 inputs are binary encoded. They will need inputs of 00, 01, and 10 to make the 4052 do what you want. You'll want to make the LEDs be one per footswitch, and not have to convert from binary to switch in your head, yes? If so, then use three other PIC pins to drive three LEDs, corresponding to the three footswitches.

Notice that I'm ignoring the fourth throw in the 4052, which is there for free. you could make a 2P4T switch by merely using that fouth throw and adding a fourth footswitch and LED - plus whatever else you are switching.
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.

David

I was thinking I could handle all the 2P3T switches and their associated LEDs with a single PIC.  However, it occurred to me that what you're actually suggesting is ONE PIC per 2P3T switch.  While this means more building, it does mean that now each switch controller is a self-contained, repeatable functional unit.  Once I get one program and circuit design to work, they all will and I can go on to build the actual pedal.

Thanks for playing oracle, R.G.!

R.G.

Yeah, it costs you one more PIC per 2P3T, but it simplifies the circuitry a lot.

Hmmm... each 2P3T switch needs two signals to activate it; that's six pins. You need three pins for the momentary switches, that's nine. You don't have enough pins in one PIC for independent LED pins, another nine. You could do a shift-out controller for pin expansion, shifting out the control for the 4052's and using PIC pins for the LEDs.

But yeah, it's probably simpler to program and build just to use two more PICs.
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.

David

Thanks, R.G.

I had originally thought to drive indicator LEDs by hooking them to an arrangement of inverting and non-inverting buffers, but I couldn't figure out how to do it easily.  Besides, that would have meant adding at least 2 more chips.  I just cut my losses and decided to use one PIC per 2P3T switch.

I went back and looked over your article on the CD4053 switch and noticed the biasing components.  Since my 4052 application is doing roughly the same thing and is in the same chip "family", should I implement a similar bias scheme as well?

R.G.

QuoteSince my 4052 application is doing roughly the same thing and is in the same chip "family", should I implement a similar bias scheme as well?
Yes, if you want switch popping to be minimal.

Fortunately, the guy who did the design of that circuit was already worried about that for you, so the changes to the existing schematic are minimal. Here's the necessary changes.

S1A: Add 1M to Vb from the two throws that connect to the 0.022uF cap
S1B: Add 1M to Vb from all three throws
S2A: Add 1M to Vb from the throw what is otherwise unconnected
S2B: Add 1M to Vb from the throw that connects to the 0.01uF cap
S3A: Add 1M to Vb from all three throws
S3B: Add 1M to Vb from the throw that is otherwise unconnected

All of the other connections already have DC paths back to Vb or a place that's really close to Vb.

Yell if you run into problems.
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.

David

I am humbled and awed -- and also gratified that I anticipated a nasty problem.  Thanks for the clues.

I'll do a write-up when I have it, but it's going to be a while -- could be as long as 2 months.  I don't get much bench time.
Say, if you're up to it, can I PM you about a PIC circuit issue?

R.G.

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.