CD4053 issues: pops, crackles, transition delay

Started by plex, March 22, 2015, 08:58:06 AM

Previous topic - Next topic

plex

Hi DIYstompboxes,

I'm trying to utilize the cd4053 (controlled by a cd4013) to perform audio bypass on my guitar signal. I'm using the schematic from RG's page http://www.geofex.com/article_folders/cd4053/cd4053.htm

The effect circuit is taken from fuzzcentral (ts808) http://fuzzcentral.ssguitar.com/schematics/TS808.gif

Everything sounds great when no switching is occurring but when I press the momentary switch it not only cracks/pops, there is also a noticeable delay in transitioning effects. I looked at the electrical waveform on an oscilloscope and the transition looks like the waveform (being switched to) is slowly falling into place from above (like someone dropped the waveform from the sky and it was translating downward...weird). I've googled the issue a bunch and none of suggestions online have helped in my case...I also tried a buffer at the input and then at the output, nothing changed. I've triple checked my circuit many times, but can't figure out the issue. I know you can't remove the popping entirely, but this is way too audible and it would be great to fix this.

I'm trying to make an effect board for my friend (ts808, c5505 dsp) who is in a wheelchair and has trouble using 3pdt switches, a momentary switch with the cd4053 would be great.

Please let me know any further info needed, all the help is appreciated.

Thanks,
plex

R.G.

First off, it is possible that there are failing parts. That is the least likely thing to be happening, but let's dispose of that first by noting that it's possible, then going on to things that are much more likely.

The "pops, crackles" issue and the "falling into position from above" indicates that there is a DC voltage offset in the "off" position and that's being replaced by the properly-biased signal voltage when it's switched to. Get out your meter and check the DC voltage on each of the signal pins - 1,2,3,4,5,12,13,14,15 - in both effect and bypassed condition. These all have to be biased at 1/2 of the power supply to not click when the switch changes. If all is well, remove power and use your meter as an ohmmeter to look for shorts between power and signal pins, and also check the state of the status pins - 6, 7, 8, and 9.

The CD4053 is *amazingly* fast, switching in well under 1uS when told to do so. Did you look at the control signals on your oscilloscope as well as the signal? If you have a dual-trace scope, trigger from the control signal on pins 10 or 11 and watch both the control signal there and the effects signal.

I suspect that there is something odd about the 4013 setup. I know the 4013 T-flop setup there works, as I have used it myself and it gets good reviews, but I've never liked it. It's much touchier about setting up correctly than the hex-inverter version. I'm sure that I've had a hex-invert T-flop not work in the past, but I can't remember when.
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.

plex

#2
Quote from: R.G. on March 22, 2015, 09:23:26 AM
First off, it is possible that there are failing parts. That is the least likely thing to be happening, but let's dispose of that first by noting that it's possible, then going on to things that are much more likely.

The "pops, crackles" issue and the "falling into position from above" indicates that there is a DC voltage offset in the "off" position and that's being replaced by the properly-biased signal voltage when it's switched to. Get out your meter and check the DC voltage on each of the signal pins - 1,2,3,4,5,12,13,14,15 - in both effect and bypassed condition. These all have to be biased at 1/2 of the power supply to not click when the switch changes. If all is well, remove power and use your meter as an ohmmeter to look for shorts between power and signal pins, and also check the state of the status pins - 6, 7, 8, and 9.

The CD4053 is *amazingly* fast, switching in well under 1uS when told to do so. Did you look at the control signals on your oscilloscope as well as the signal? If you have a dual-trace scope, trigger from the control signal on pins 10 or 11 and watch both the control signal there and the effects signal.

I suspect that there is something odd about the 4013 setup. I know the 4013 T-flop setup there works, as I have used it myself and it gets good reviews, but I've never liked it. It's much touchier about setting up correctly than the hex-inverter version. I'm sure that I've had a hex-invert T-flop not work in the past, but I can't remember when.

Thanks for the fast response, results from the DMM test are, in volts (my source is only putting out 8v...battery is getting a little drained, but all of this occured with a new battery too. I have an 11v DC power supply, but I'm not sure if my circuits would like that):
Bypass:
v1=0.03
v2=2.99
v3=0
v4=0
v5=0
v12=2.99
v13=1.32
v14=2.99
v15=2.99

Overdrive:
v1=0.07
v2=1.99
v3=0
v4=0
v5=0
v12=1.99
v13=1.99
v14=1.99
*v15=0.07

I'm guessing it's the big shift in DC levels that's being shown above, right?

Another issue is when the overdrive volume pot is at full volume when I strum hard the analog switch reverts back to bypass mode...if I turn down the overdrive volume knob a little bit then this doesn't occur. But one thing at a time, in the final device the user won't have potentiometer access (using fixed resistors) since he's in a wheelchair and couldn't use them anyway...so I can use a fixed resistor for volume that doesn't give this issue.

Unfortunately I won't have time to visit the scope until around Friday this week (have a lot of projects/exams this week and my current 'prototype' takes a bit of effort to transfer locations).

I would really like to use the flip-flop as I can utilize the extra FF on the IC to create sequenced effects I think. I drew up a scheme to use the third spdt on the CD4053 to route the signal through both the analog overdrive and digital board...plus I already have tons of cd4013s. I initially had a little bit of bounce on the switch, I changed the base capacitor to a larger one and it went away (not sure if some weird fluke). What else typically gives issues?


I should have stated this from the beginning, my intentions are to use 2 CD4053's cascaded so I can have 3 total sounds: clean, overdrive, and digital (can be reprogrammed in device through USB).

R.G.

Quote from: plex on March 22, 2015, 10:33:24 AM
Bypass:
v1=0.03
v2=2.99
v3=0
v4=0
v5=0
v12=2.99
v13=1.32
v14=2.99
v15=2.99

Overdrive:
v1=0.07
v2=1.99
v3=0
v4=0
v5=0
v12=1.99
v13=1.99
v14=1.99
*v15=0.07

I'm guessing it's the big shift in DC levels that's being shown above, right?
Yep. That's what's making your [pop].

The DC voltages on those pins should be half the power supply voltage, whatever that is. That's what the "Vr" circuit is - a resistor splitter on the power supply. The capacitors  on the input and output pins to the 4053 switches block DC levels from the outside, and the Vr circuit holds the pins at the right DC voltage for minimum pop from the 4053. The minimum pop is substantially inaudible when this is all working right.

So there are three questions to answer. (1) does your Vr creation circuit actually make half the power supply voltage? (2) If it does, does that Vr get to the pins in good order?  (3) Are your input caps leaky, reversed, or shorted, or is there some other leakage path that pulls the pins or Vr away from the right voltage?

QuoteAnother issue is when the overdrive volume pot is at full volume when I strum hard the analog switch reverts back to bypass mode...if I turn down the overdrive volume knob a little bit then this doesn't occur. But one thing at a time, in the final device the user won't have potentiometer access (using fixed resistors) since he's in a wheelchair and couldn't use them anyway...so I can use a fixed resistor for volume that doesn't give this issue.
]
Actually, what that says is that the signal line is leaking into the switch controls somehow. You need to track that down.

QuoteI would really like to use the flip-flop as I can utilize the extra FF on the IC to create sequenced effects I think. I drew up a scheme to use the third spdt on the CD4053 to route the signal through both the analog overdrive and digital board...plus I already have tons of cd4013s. I initially had a little bit of bounce on the switch, I changed the base capacitor to a larger one and it went away (not sure if some weird fluke). What else typically gives issues?
The CD4013 is a D-type flipflop with set and preset inputs. When the clock changes, the logic level on the D input, whatever that is, is transferred to the Q output. The funny stuff is contained in that phrase "when the clock changes". The 4013 internal circuit expects a clean, unambiguous clock with certain maximum rise and fall times - that is, the vertical-ness of the clock edges. All of the miscellaneous resistors, caps, transistors and switches in the circuit you're using are there to (1) debounce the mechanical switch's inherent "make/break many times" when it's activated and (2) fake the 4013 into believing the clock pulse it gets is good enough to flip.

Tinkering with analog parts added to CMOS logic to make it kind of work differently is (was, I guess) referred to as MML - Mickey Mouse Logic. Since all circuits are analog at some level of understanding, this can be made to work, but it often requires critical tinkering with values and such to get it to work once or twice, and then to work every time. These are, by the way, two different things, as you're finding.

The inverter circuit works differently. Two inverters in series with feedback from the second to the first will always latch up one way or the other. The resistor in series with a capacitor to ground stores the high or low state of that output. This state is the opposite of what is on that inverter's input. If you take a momentary switch and connect the capacitor back to that inverter's input, it forces the input to the opposite condition, as long as the capacitor can overwhelm the drive coming from the second inverter. That "overwhelm" is ensured by the resistor from the second inverter's output to the first inverter's input.

The capacitor also holds enough charge that it tells the inverter input to "be the opposite" for long enough for the first inverter to change state, and also for the second inverter to change state, as told to do by the first inverter. So in two inverter flip-times, the second inverter is changed an it's now HELPING the capacitor hold the new state. Once the second inverter flips, the action is all over and the switch bouncing or opening doesn't matter at all. Bounces just reinforce what has already happened.

And an interesting thing happens: the capacitor charges up slowly to the new "opposite" to get ready for the next switch operation. So the switch bounce doesn't matter in the very short term, and can't cause errors in the medium term. It's effectively locked out.

I'm only going on and on about this so you appreciate that you're going to have to tinker with the 4013 circuit to make it reliable, and why. But having 4013's already there, and free, is a powerful inducement. I, obviously, have lots of CD4049s and CD4069 hex inverters.   :icon_biggrin:

On the other hand, one $0.50 hex inverter gives you as many as three debounced flipflop actions. Just saying...

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.

plex

QuoteYep. That's what's making your [pop].

The DC voltages on those pins should be half the power supply voltage, whatever that is. That's what the "Vr" circuit is - a resistor splitter on the power supply. The capacitors  on the input and output pins to the 4053 switches block DC levels from the outside, and the Vr circuit holds the pins at the right DC voltage for minimum pop from the 4053. The minimum pop is substantially inaudible when this is all working right.

So there are three questions to answer. (1) does your Vr creation circuit actually make half the power supply voltage? (2) If it does, does that Vr get to the pins in good order?  (3) Are your input caps leaky, reversed, or shorted, or is there some other leakage path that pulls the pins or Vr away from the right voltage?

(1)The voltage divider is giving 4v from the 8v supply, I think it's working properly.
(2)It doesn't seem to be, it's either dropping 1 volt in bypass...or 2 volts in overdrive.
(3)How would I test the caps for leakiness? I don't see any shorts or reversed caps. Though for leakage: the cd4053 is on my breadboard while the ts808 is on a perfboard already soldered. I'm using alligator clip wires for some connections, could that be the issue?


Quote
Actually, what that says is that the signal line is leaking into the switch controls somehow. You need to track that down.
Will do.

QuoteI'm only going on and on about this so you appreciate that you're going to have to tinker with the 4013 circuit to make it reliable, and why. But having 4013's already there, and free, is a powerful inducement. I, obviously, have lots of CD4049s and CD4069 hex inverters.   icon_biggrin

On the other hand, one $0.50 hex inverter gives you as many as three debounced flipflop actions. Just saying...
I do appreciate the explanation, I didn't consider rise and fall times. I actually have a tube of cd4049UBE in my parts box, would those work? (not sure if the UBE suffix is an issue, also forgot I had them).


As a side note. All the fine details of analog circuits are very fascinating. I'm in my first VLSI course...purely digital CMOS but we still do transient analysis,  a lot happens between that '1' and '0'  . So I think I understand what you mean how circuits are all analog at some level.

R.G.

Quote from: plex on March 22, 2015, 12:00:51 PM
(2)It doesn't seem to be, it's either dropping 1 volt in bypass...or 2 volts in overdrive.
(3)How would I test the caps for leakiness? I don't see any shorts or reversed caps.
Pull the caps out and test the voltages with them completely open circuited. If the voltages change, the caps were leaky.

QuoteThough for leakage: the cd4053 is on my breadboard while the ts808 is on a perfboard already soldered. I'm using alligator clip wires for some connections, could that be the issue?
Alligator clips and breadboards can be problems, or can work fine. I quit using them because some contacts in an otherwise good breadboard got worn and unreliable, and because I mostly don't need to proto at that level any more. It's possible.

QuoteI do appreciate the explanation, I didn't consider rise and fall times. I actually have a tube of cd4049UBE in my parts box, would those work? (not sure if the UBE suffix is an issue, also forgot I had them).
Those will probably be fine. The "UBE" suffix means unbuffered, which means a lower gain in each inverter. Try it out on your breadboard. The only things I can think of that would not work for the UBEs is some condition where you're loading them too heavily to switch in time. You might have to use extra gates to drive LEDs instead of driving LEDs directly from the two inverters making the flipflop, for instance.

QuoteAs a side note. All the fine details of analog circuits are very fascinating. I'm in my first VLSI course...purely digital CMOS but we still do transient analysis,  a lot happens between that '1' and '0'  . So I think I understand what you mean how circuits are all analog at some level.
Keep a good eye on that transient analysis. Your level of understanding already surpasses many "logic-only" designers I've known. These are the guys you DON'T want with you while you try to figure out why it simulated perfectly and then in a real-world prototype throws an error every once in a billion clock cycles. Most logic analyzer pretrigger buffers are less than a billion long.   :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.

plex

#6
QuotePull the caps out and test the voltages with them completely open circuited. If the voltages change, the caps were leaky.
Just tested them, no voltage change.

QuoteAlligator clips and breadboards can be problems, or can work fine. I quit using them because some contacts in an otherwise good breadboard got worn and unreliable, and because I mostly don't need to proto at that level any more. It's possible.
If I can get up the courage to learn Eagle, then I'm planning on making a pcb...but you know how plans go. I've etched a board at home before and it wasn't too bad, though it was a small circuit.

Quote
Those will probably be fine. The "UBE" suffix means unbuffered, which means a lower gain in each inverter. Try it out on your breadboard. The only things I can think of that would not work for the UBEs is some condition where you're loading them too heavily to switch in time. You might have to use extra gates to drive LEDs instead of driving LEDs directly from the two inverters making the flipflop, for instance.
The control lines for the CD4053 (from the inverter) are also going to be inputs to an msp430g2553 which will itself control a small LCD to display the state of the device...I can't feed the msp430 9v so I was thinking to either use a voltage regulator or try to use a bjt. Would those be considered too heavy of a load?

I thought my friend might get a kick out of the LCD, plus I already have the code done to control the LCD based on the control lines (2 in my case for the 2 cd4053 I intend to use) (it displays: bypass mode, overdrive mode, or digital mode).

QuoteKeep a good eye on that transient analysis. Your level of understanding already surpasses many "logic-only" designers I've known. These are the guys you DON'T want with you while you try to figure out why it simulated perfectly and then in a real-world prototype throws an error every once in a billion clock cycles. Most logic analyzer pretrigger buffers are less than a billion long.  
I credit my awesome professors and google  :)


Question, I have a single 9v, 4.5v, and gnd line which is used for all components in the device. Is this fine?

R.G.

Quote from: plex on March 22, 2015, 12:43:28 PM
Just tested them, no voltage change.
Then there is something wrong with how the signal pins are being fed Vr. Pulling out the caps eliminates everything outside the caps.

Quote
The control lines for the CD4053 (from the inverter) are also going to be inputs to an msp430g2553 which will itself control a small LCD to display the state of the device...I can't feed the msp430 9v so I was thinking to either use a voltage regulator or try to use a bjt. Would those be considered too heavy of a load?
(1) Read the data sheet.  (2) Read up on logic level conversions.
The data sheet tells you what voltages and currents the inverters can drive successfully. There are many, many ways to convert logic levels from the 9V you have to the 5V or less that you want. A simple way is to put a series resistor from the 9V logic to the 5V input, with a 5V zener to ground. The zener clamps the logic signal at the driven input to no more than the zener voltage, and a current flows that is the "9V" logic output voltage minus the zener clamping voltage, divided by the resistance - yep, we're back at ohm's law. Never forget ohm's law. I have known engineers that knew little more than Ohm's law and had successful careers. The resistance can be changed to tune the amount of current flowing out.

At the risk of kibitzing too much, if you have a microcontroller there already, why not feed the momentary switches into inputs of the uC, debounce in software in the uC, then use uC outputs to drive the CD4053 through a logic level converter which ups the uC output levels to 9V for the 4053 control pins, and forget this nonsense of tweak-diddling 4013s to do debounce and flip-flopping? You have a Main Battle Tank there in the uC, and you're trying to use it to read out the aiming accuracy of a hand-held slingshot.   :icon_lol:

Sorry. I'm calmer now.    :icon_lol:

QuoteQuestion, I have a single 9v, 4.5v, and gnd line which is used for all components in the device. Is this fine?
Knowing that there is a uC in there, makes that question tricky. Not knowing all of the parts, including a uC and an LCD display makes me have to guess from a long distance. It might make more sense to use 9V, a 78L05 for a 5v supply to the uC and LCD, and also use the 5V as Vr. Or not. There are several layers of details in there.
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.

PRR

> v12=2.99
> v13=1.32
> v14=2.99
> v15=2.99


What is your voltmeter's resistance?
  • SUPPORTER

R.G.

I worried about that, but it wasn't the same for each, and would not account for the pops and "falling from the sky" signal.
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.

plex

#10
QuoteAt the risk of kibitzing too much, if you have a microcontroller there already, why not feed the momentary switches into inputs of the uC, debounce in software in the uC, then use uC outputs to drive the CD4053 through a logic level converter which ups the uC output levels to 9V for the 4053 control pins, and forget this nonsense of tweak-diddling 4013s to do debounce and flip-flopping? You have a Main Battle Tank there in the uC, and you're trying to use it to read out the aiming accuracy of a hand-held slingshot

Well I feel silly :p I'll use the msp430 uC to handle *ahem* the control. Thanks for the explanation of using a zener diode, that's something I'll keep in the back of my head. It's so true about ohm's law...in my BJT/mosfet course just knowing how to apply ohm's law, kvl, and kcl was 90% of the battle.

QuoteKnowing that there is a uC in there, makes that question tricky. Not knowing all of the parts, including a uC and an LCD display makes me have to guess from a long distance. It might make more sense to use 9V, a 78L05 for a 5v supply to the uC and LCD, and also use the 5V as Vr. Or not. There are several layers of details in there.
I have some lm317 ICs and some TLE2426 rail splitters that I can use for lowering voltages, unless the 78L05 is better for the task. The uC likes ~3.3v and can output about 3v at that level (Vcc -0.3v I think). From 9v I think I would need (1) a biasing voltage for the AC signal, hopefully one that can be double-duty like 5v for the LCD (2) ~1.8-3v for the uC. If I use the lower end of the voltage I think I can share that rail with the DSP.

That wouldn't be terrible, 9v, 5v, 2v. Unless I'm forgetting something.

Do you think 5v be used in place of 4.5v in the ts808 schematic that I posted?

@PRR: I'm not sure the rating on my DMM. It's a cheapo from Home Depot.

I'm gonna sleep on all this (and read up on logic level conversions) and try to come back with a more concise layout of what's in the design, to remove the guess work. I'll also try to clean up the build and post some pictures if that will help. Let me know anything else I can do to help you all help me :)

PRR

> ohm's law, kvl, and kcl was 90%
> my DMM. It's a cheapo from Home Depot.


If you can spell kvl, you know why it matters.

While Home Depot does not give specs on their $25 meter, Googling the brand/model found its specs in about 75 seconds. Today's $25 job seems to be a Triplett 2030 which (looking-up) is 10Meg on all normal DC ranges. Ah, H-D sells two pliers and a DMM for $20 (so the DMM must be $10). They do not tell the meter model, but a squint says it is a MAS830B, which turns out to be Mastech, but their info does not give the meter impedance. Of course you could meter a 9V battery with and without a 1Meg series resistor and derive that information.

If your switching has 1Meg resistors, and your meter is 10Meg (now common even on "cheapos"), then your readings are about 10% off. If they all agree, you may shrug it off. I was seeing some different readings, but R.G. says that's likely not the problem.

EDIT--- dang H-D "search". I just found their $10 digital meter Model # 648349. That IS cheap. And no info found, even after I traced the PowerBuilt brand to AllTrade tools' website.

OTOH, H-D will still sell you a needle-meter (50 cents more than the DMM). "Analogue{sic} Multimeter Model # M1015B $10.48". A blow-up of the scale shows "10K/V", so on the 2.5V range it is 25K input. Ha-- they still have dB marks on the scale.
  • SUPPORTER