FX Loop Switcher and Loud Pops

Started by mjlee, January 23, 2012, 11:06:45 PM

Previous topic - Next topic

tysonlt

Could someone please comment on the schematic itself? Do I have the 4053 wiring correct?

R.G.

Quote from: tysonlt on January 30, 2012, 07:45:48 AM
Could someone please comment on the schematic itself? Do I have the 4053 wiring correct?
I did a quick look. It looks OK. The 4053 needs its I/O pins biased to half its supply by bias resistors, then capacitors to block that DC from the 'outside' levels, and a pull down to the 'outside' DC levels. However, I believe the capacitor polarity is incorrect for X0 and X1 pins.

You may also have problems with logic levels. The PIC is running from +5 and the 4053 from +9, but you're tying the control pins (CMOSA/B/C) between the two. The PIC can't raise the control pins to a valid logic level for the 4053. It only goes up to a bit over half way, which will probably drive the 4053 nuts for some values of 4053. This really needs a logic level translator. ...er, ask me how I found this particular issue out.  :icon_lol:  :icon_redface:

There is a yet more complicated way to hook up the 4053 that would avoid the logic level translation problem. That is to run the 4053 on +5 and ground, and supply -5V to the 'VEE' pin. The datasheets talk about this in some detail. I tried this once, didn't like the complexity of a second power supply, and just used logic level translators.
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.

tysonlt

Hi RG,

Thanks for your comments, they are appreciated.

I think I *FINALLY* understand how that biasing circuit works! In terms of water pressure, the bias resistors raise the pipe pressure around the cmos to 4.5, but the cap is like a pressure valve that the stops that 4.5v from flowing back through the circuit. The pull-down resistor then drains all the water on the other side of the capacitor away to ground. Then whatever water pistol guitar signals that come through will hit the charged cap and create little tremors in the 4.5v pipe, resulting in a nice waveform centered around the 4.5v mark. If I am correct then please tell me and put me out of my misery! :)

(I will of course use the geo article as a cookbook, but I would like to understand everything I put in my looper design, or at least know why it's there.)

Ha, about the logic levels, it sounds like you have a fun war story! Please share! I had read that modern cmos chips could automatically translate their logic levels. I know the MAX chips do, but not sure about the generic ones. To do translation, would I create two voltage divider networks, one for each logic state, and then tie these references to the cmos pins via a PIC controlled transistor? (If so, that would be my first ever independent circuit design!)

I am interested in using bipolar power actually. I have another thread asking how to get bipolar 5v from either a 12vdc adapter or a 9vdc 1spot. I note there that some on this forum feel that running the guitar signal at 0v is somehow friendlier to pedals. But... Doesn't the dc blocking cap and pulldown resistor on the input/output lines bias the signal back down to around 0VDC anyway??? Have I understood that correctly?

Thanks

tysonlt


tysonlt

Quote from: R.G. on January 30, 2012, 08:11:55 AM
I believe the capacitor polarity is incorrect for X0 and X1 pins.

Ah, and I think I understand why. They have to hold the 4.5v pressure on the cmos side. I think I get it! ;D

tysonlt

LOL, fourth reply to myself...  :icon_redface:

I checked the datasheet for the TI CD4053 and it says: "Logic-Level Conversion for Digital Addressing Signals of 3V to 20V (VDD-VSS = 3V to 20V) to Switch Analog Signals to 20VP-P (VDD-VEE = 20V)". The block diagrams show an internal logic-level conversion stage.

So does that mean the PIC can directly drive the 4053?

PRR

#26
> does that mean the PIC can directly drive the 4053?

Depends what "heights" the three pins of 4053 are at.

You are the draw-bridge man, I am the harbor-master. We have a simple command scheme: I kick your foot to open the bridge, head-butt you to close the bridge. But if I'm 5 foot and you are 9 foot, I can never give the order to close the bridge. And if you are 18 foot and standing  9 feet below deck, I can't even open the bridge unless we re-define "open" as a kick in your belt. (Aren't you glad we don't work together?)

As R.G. says, you can run 4053 with -5V, zero, +5V, and it will understand a CPU on zero and 5V.

This means a small negative supply just for the self-leakage of 4053 internal drivers.

If your main power is delivered as 5V DC, then finding a -5V supply probably means a vibrator. Even if supersonic, this tends to get mixed into the audio and cause audible beats.

Another way is to power 4053 on zero and +5V. CPU interface is fine. However audio can not exceed 5V peak to peak. While gitar isn't over 2V p-p, as you note we live in a world of 9V boosters. We would like at least 7V p-p headroom in the 4053 audio path.

If you drop the too-smart CPU/PIC and wire raw CMOS logic, it can all run on 9V (even 15V) and interface fine.

And another way is 5V logic, 9V analog-switch supply, and a level converter which will throw logic over 2.5V all the way to 8V or 9V to reliably slam the 9V switch control inputs. If logic inversion is acceptable (flip your code), a Darlingtor or MOSFET with 2 resistors (or simple BJT with 3 resistors {2 if you're really cheap}) will do. There is a CMOS chip with separate power feeds for input threshold and output levels, give it 5V and 9V. 4504 is one, though far more complicated than I remember.
  • SUPPORTER

tysonlt

I like the sound of the Darlington etc. level conversion. Time to Google... Is there a recipe name for this technique?

A uC may seem excessive here, but this project is a practice run for a midi footswitch that also controls ten cmos loops. So I want to get the pic/cmos interface right.

R.G.

Logic level conversion is an old, old problem, from back in the day when logic came in many flavors. Any time you used chips from more than one logic family, you were in for doing logic level conversion between chips.

I dug through the description of the 4053 in some detail just to be sure. Paul is right - any conversion the chip does only allows you lattitude for varying voltages on Vee, not on Vdd and Vss. So with a PIC on 5V, you can only get 0 and 5V outputs, and you have to somehow arrange the 4053 so it thinks that is the full swing between Vss and Vdd.

The way I nearly always use is Paul's cheapo bipolar and two resistors. I use a 100K pullup on the control pins to Vdd (9V in this case) and an NPN to ground. This is nearly always a 3904 or - yep! - a 5088. These are working at nearly full DC gain pulling down a 100K, and in any case you can run them at a forced gain of under ten with a 100K resistor in series with their base from the PIC. The PIC itself pulls the base down to 0V when it's trying to turn the transistor off, so I dispense with the third resistor. This inverts the output logic - when the PIC signal is down, the transistor collector is up, and vice versa, so it requires you to mentally invert when doing your programming. You can also use a small signal MOSFET like the BS170 or 2N7000 directly with only one resistor, the pullup on the control pin of the 4053. It's a bit more expensive way to save one resistor.

There is some advantage to running an all-0V signal ground level. However, there's a hidden problem too. Opamps with their + input held to ground by a biasing resistor and a DC gain of unity do not put out really, truly 0V on their output. It's off by as much as the input offset and any biasing offset errors. Usually for the TL072 family, this can amount to as much as 15mV or so. That's probably not an issue by itself, but when switched by a CMOS switch, it's not constant. They'll switch between the opamp's offset and another DC voltage, usually really, no-fooling, their bias voltage. That puts a 15mV step in the signal path when you switch. When this is then coupled into a mega-gain distortion pedal, it can become huge.

In that case, using a capacitor after the opamp, even when it's nominally running at "ground" prevents this switching transient.
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.

tysonlt

#29
Thanks so much for your reply R.G. I have learnt a lot from this already!

Quote from: R.G. on January 31, 2012, 11:25:57 AM
This is nearly always a 3904 or - yep! - a 5088

At this stage I am not familiar with transistor models, but I have some 2N5089 NPNs coming from Tayda. Will these do? I really like the simplicity of this solution.

Quote from: R.G. on January 31, 2012, 11:25:57 AM
...it requires you to mentally invert when doing your programming

No problem. Code must always change to mimic reality, never the other way around. That's why it's called soft! :D Using defines makes this a non-issue. If we abstract the actual switching code into a function (ie, cmos_on(), cmos_off(), etc) then we don't have to worry about flipping pin directions.

Quote from: R.G. on January 31, 2012, 11:25:57 AM
There is some advantage to running an all-0V signal ground level. However, there's a hidden problem too.

I am interested in those advantages. Would I still use the biasing solution as shown in the geo 4053 article? I am happy to do the biasing, I'm not trying to reduce that complexity so much as trying to find the optimal way to power a uC and the CMOS switches. The question is: do the advantages outweigh the 'hidden problems'?

Here are some 'virtual ground' circuits I found: http://tangentsoft.net/elec/vgrounds.html. I am getting a bit out of my depth there!

Quote from: R.G. on January 31, 2012, 11:25:57 AM
In that case, using a capacitor after the opamp, even when it's nominally running at "ground" prevents this switching transient.

In my design here I am not using any opamps, but I guess I have to account for opamps in the various pedals... In my design, there is a 2.2uF cap on guitar in and out, as well as on the send and return of each loop. Would it *hurt* if I left these in, even for a bipolar power setup? Do you think this would mitigate any problems of running at 0V signal?

At this stage I am leaning towards using +9v for the CMOS with biasing to 4.5v, and using the 'cheapo bipolar' for level conversion. R.G., could you please elaborate on what the advantages of running at 0V ground signal are, for a simple switching circuit?

Thank you all so much for your input. I'm starting to feel like a 'real'... something :)

tysonlt

Latest schematic:

1) DC blocking caps on X0,X1 reversed as per R.G's recommendation

2) Logic-level translation added as per R.G, Paul's recommendations



and a url of the full-sized image: http://www.edieandbup.com.au/mjlee-fx-amp-AB-switch.jpg

Question: if I stick with +9v for the CMOS, is there any need for a regulator when using a regulated 9vdc wall-wart? Would I maybe just use a 9v zener?

R.G.

I notice one other thing. Although it may work OK, putting lots of current through the 4053 is something I don't like to do, on grounds that it may have side effects inside the chip. If I were doing this, I'd do the LED switching outside the 4053, not with section Z. You have unused pins on the PIC, which can drive LEDs directly. I'd put D1 and D2  on PIC pins with current limiting resistors (N.B. Yeah, I know they say PICs can drive LEDs without resistors) and not on the 4053.]
Quote
Question: if I stick with +9v for the CMOS, is there any need for a regulator when using a regulated 9vdc wall-wart? Would I maybe just use a 9v zener?
If you have a regulated +9V output to drive this, you don't then need a second regulator nor a 9V zener.

However, good design practice extends beyond just getting things to work. I includes providing for the forseeable misuses and failures too. The CMOS chip is good for higher voltages than 9V, regulated or not, and so is the 5V regulator. That's good. It will live under the conditions of some junior genius having read on the internet that supplying 18V to your 9V pedal will make it sound like flying saucers or incoming asteroids or something. We get this all the time and preemptively design against (... not for... ) it. But you're pretty certain to get the wrong polarity voltage connected to it too. If it were me, I'd put polarity protection on the power in. I'd also put a BFC on the incoming 9V, maybe 100uF/25V, and a 0.1uF ceramic to help eat some of the RF coming from economy/random switching wall warts.

I would also worry about RF rejection on all the signal ins and outs as well, and about RFI generated in the PIC. The solutions to those will be highly layout-specific.
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.

tysonlt

Good call re the LEDs. I was wondering about that actually :) I would be controlling the LEDs with a shift register in the full midi project.

OK, so I just put those two caps across the incoming 9v? Before or after the 7805? I will be putting 0.01uF caps across the power pins of all chips as well.

RFI is not something I have thought about. I always thought you just used a metal case, or if you're cheap, line a plastic case with tin foil! ;) I remember I had a DOD FX7 that picked up the local radio station. You could also hear the distortion effect in the background of all the clean effects - I hope I don't have that issue with the 4053's, since I will be putting pre-amped signals through them.
I will hit up Uncle Google for some rfi info.

Thanks so much R.G! :)

mjlee

Can anyone out there build this box for me, given the schematic and discussion above? I would pay of course , so hopefully it could be a win-win!