Something new I built - fun with decade counters

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Joe., lisa, luketeaford, Kent

Post Reply
User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Thu Apr 30, 2020 8:57 pm

So, I also, for fun, got a 16 channel multiplexer version of this working. It works pretty great except right now I'm using the CD4067 that somebody mentioned (thanks!), which is dirt cheap, but the bummer is while it can work off dual supplies but the analog signals can only be from 0 to V+. Sure I can just have each segment go from 0 to 10 and level shift the whole thing but I also have to level shift the modulating signals.

I will also try a MAX306 which can do full swing signals, but it's kind of expensive at 8 bucks and getting to the cost of the VCA version, albeit less passives for sure.

KSS
Super Deluxe Wiggler
Posts: 2039
Joined: Mon Jan 25, 2016 7:28 am

Re: Something new I built - fun with decade counters

Post by KSS » Thu Apr 30, 2020 10:22 pm

Two options.
Power the 4067 from -5 snd 5+ for same IO range. See Lancaster's CMOS Cookbook.
Utilize the virtual GND of an OPA on 4067 outputs to pass full scale signals. See CGS analog switch modules for details.

Swedish DIY guy with the ultra fancy VCO -can't remember name right now- also does full range analog switching with 4xxx. Using -1V for Vss. edit: remembered. Jorgen Bergfors. May have pronouns incorrect. No disrespect intended.

User avatar
guest
Super Deluxe Wiggler
Posts: 4171
Joined: Mon Aug 19, 2013 11:49 am

Re: Something new I built - fun with decade counters

Post by guest » Fri May 01, 2020 3:57 am

the DG408 is pretty cheap, although its just 1x8, so youll need two. still cheaper than the 1x16 version (DG406). there are also the MUX506 and DG506 which might be worth looking at.
openmusiclabs.com

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Fri May 01, 2020 10:07 am

KSS wrote:
Thu Apr 30, 2020 10:22 pm
Two options.
Power the 4067 from -5 snd 5+ for same IO range. See Lancaster's CMOS Cookbook.
Utilize the virtual GND of an OPA on 4067 outputs to pass full scale signals. See CGS analog switch modules for details.

Swedish DIY guy with the ultra fancy VCO -can't remember name right now- also does full range analog switching with 4xxx. Using -1V for Vss. edit: remembered. Jorgen Bergfors. May have pronouns incorrect. No disrespect intended.
Interesting. I tried +/- 8 and it did not like negative input signals. It seemed to just brick at like -1 or so. Is there something special about +/-5? I need to see this cookbook, thanks!

Also, I already have a MUX506 on the way. :tu: :tu:

User avatar
guest
Super Deluxe Wiggler
Posts: 4171
Joined: Mon Aug 19, 2013 11:49 am

Re: Something new I built - fun with decade counters

Post by guest » Fri May 01, 2020 10:23 am

were your logic signals the full +/-8V as well? ive used this trick with the 4066, and it worked well.
openmusiclabs.com

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Fri May 01, 2020 10:26 am

guest wrote:
Fri May 01, 2020 10:23 am
were your logic signals the full +/-8V as well? ive used this trick with the 4066, and it worked well.
Shit, that's probably the problem. I think I still had the Binary counter hooked up single supply... Doh!

Also just looked up how CGS used the 4066 with the diodes and virtual ground trick. Very tricky! Thanks for that.

OK, I've got some more breadboardin' to do! :sb:

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Fri May 01, 2020 1:56 pm

That was the problem haha! Back in business with the mighty 68 cent MUX!

Now I'm thinking I might expand this to 12 segments instead of 10. 16 can be done obviously, but it starts getting huge. I did a layout in Solidworks and using the 15mm travel Alpha sliders that Tayda has, I was able to lay everything out on a 20HP euro panel, which doesn't seem ridiculous, but it is getting kind of big.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Sat May 02, 2020 7:32 pm

devinw1 wrote:
Thu Apr 30, 2020 2:19 pm
Synthiq wrote:
Thu Apr 30, 2020 2:07 pm
devinw1 wrote:
Thu Apr 30, 2020 10:31 am
Do you think there is an advantage to using the pulse instead?
The pulse will give a cleaner signal to the clock input and save some current but that might not be significant compared to the total current consumption. So the question is more if the saw waveform is good enough for this application. The main concern would be that the level shifted sawtooth will move up or down if there is a mismatch between the positive and negative supply so just test to see that you still have a solid clock with +13V/-11V and +11V/-13V supplies.

Gotcha, makes sense. I will test that out. :tu:
So good news on the pulse output on the 3340. I found out it is open-emitter output so you can put the pull-down resistor to a negative voltage instead of ground and it will pull down to close to whatever V- on the 3340 is.

My question is, how do the levels shift for clock requirements when running one of these counters (that doesn't have a schmitt input) (right now using the CD4520) when running dual supplies. I have it set up on +/-8V now and it seems to not even care even if the clock level from my function generator is turned down really really low. I assume now as long as it reliably crosses zero then it is good?

I was thinking to run a 10k pull down to -8 so then my pulse output will go from +8 to -5, which should be more than adequate for the 4520 if I am getting this right. Then I don't need any level shifter circuit at all for my clock.

BTW, one last thing, I noticed the pulse comparator in the 3340 at lower frequencies likes to oscillate a lot on the low-high transitions, creating a wave of high frequency ripples before settling to low. Not good. I put a 1M resistor from the PWM input to the Pulse output to add a little hysteresis and it cleaned it up perfectly while only changing the duty cycle by like 1%. :tu:

Synthiq
Veteran Wiggler
Posts: 551
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: Something new I built - fun with decade counters

Post by Synthiq » Sun May 03, 2020 12:11 am

The input spec for CD4520 and the CD4000 series in general is a low below 30% of Vdd and a high above 70%. With +/-8V supplies that would be 4.8V from either supply so the 3V you see above the negative supply is within spec but you will see somewhat increased current consumption due to this. The design goal is normally to have the input threshold voltage at 50% of Vdd so many times you can get away with a smaller signal around 50% but this isn't guaranteed. For normal production I would still recommend sticking to the 30%/70% levels since I think this is the logic levels used to test the device during manufacturing. If you are concerned about the 3V above the negative supply, you can always add a diode or two between the pulse output and the pulldown resistor to shift the signal down a little bit.

The rise and fall times for the clock is specified to <5us (10% to 90%) so that is also a parameter to keep an eye on.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Sun May 03, 2020 2:55 pm

OK, so for +/-8 V then an acceptable high is 5.6V to 8V and an acceptable low is -5.6V to -8V right?

Synthiq
Veteran Wiggler
Posts: 551
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: Something new I built - fun with decade counters

Post by Synthiq » Sun May 03, 2020 4:05 pm

devinw1 wrote:
Sun May 03, 2020 2:55 pm
OK, so for +/-8 V then an acceptable high is 5.6V to 8V and an acceptable low is -5.6V to -8V right?
The CD4520 is blissfully ignorant about the existence of ground so you shouldn't use it for your calculations. It only care about the input voltage relative to VSS and VDD and we can define the maximum low input voltage as VSS + 0.3 * (VDD - VSS) which in this case is -8V + 0.3 * (+8V - -8V) = -3,2V. Likewise the minimum high voltage is VSS + 0.7 * (VDD - VSS) or +3.2V. So if you pull down the clock to -5V you are functionally fine as long as the signal transitions between -3.2V and +3.2V is less than 5us. Or maybe it is between 10% and 90% of those 6.4V, I'm not quite sure.

KSS
Super Deluxe Wiggler
Posts: 2039
Joined: Mon Jan 25, 2016 7:28 am

Re: Something new I built - fun with decade counters

Post by KSS » Sun May 03, 2020 8:50 pm

Think rail potential divided by three to get lo and hi transition points. 30 and 70 are used to ensure you're safely below 33.33% and above 66.66%.

Consider the <5uS transition time Synthiq listed for CMOS clocking as worst case. Faster is better, clean is important.

Don Lancaster's CMOS Cookbook, 2nd Ed. The link is from Don's own website so you don't have to worry about an 'improper' download.
https://www.tinaja.com/ebooks/cmoscb.pdf

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Sun May 03, 2020 9:03 pm

Thank you Synthig and KSS! This makes sense.

With a diode before the pull down resistor it's almost right at even -6.4 to 6.4 V now, which would seem to cover all the bases. I will check the transition time though, to be sure.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Mon May 04, 2020 1:19 pm

Just checked and my transition time is about 300ns so we are good to go on that. !

Synthiq
Veteran Wiggler
Posts: 551
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: Something new I built - fun with decade counters

Post by Synthiq » Mon May 04, 2020 3:51 pm

This looks good. With only 300ns rise/fall times, you might be able to increase the pulldown resistor to reduce the current in it when clocked.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Tue May 05, 2020 12:43 pm

Another quick question for you guys before I spin these proto boards: Right now I have each summing amp going into each of the 12 MUX inputs, and the common output goes to one summing resistor at the output op-amp. It works fine, and I assume the 4067 is like other MUXs and switches in that it has a break-before-make and all is well, but I'm wondering if it's safer to use use one summing resistor on the output of each individual channel's amp?

Obviously the former saves me 11 resistors, but in the event for some reason that 2 MUX channels where on at the same time for some amount of time, you are effectively shorting the output of one amp to another which may be low or negative compared to the other.

Synthiq
Veteran Wiggler
Posts: 551
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: Something new I built - fun with decade counters

Post by Synthiq » Tue May 05, 2020 7:40 pm

devinw1 wrote:
Tue May 05, 2020 12:43 pm
Another quick question for you guys before I spin these proto boards: Right now I have each summing amp going into each of the 12 MUX inputs, and the common output goes to one summing resistor at the output op-amp. It works fine, and I assume the 4067 is like other MUXs and switches in that it has a break-before-make and all is well, but I'm wondering if it's safer to use use one summing resistor on the output of each individual channel's amp?

Obviously the former saves me 11 resistors, but in the event for some reason that 2 MUX channels where on at the same time for some amount of time, you are effectively shorting the output of one amp to another which may be low or negative compared to the other.
The Texas Instrument datasheet for their CD4069 doesn't explicitly state that the switches are break-before-make but the typical turn-off time at 15V is 65ns while the turn-on time is 95ns so there may be a 30ns non-overlap. The same applies for worst case (130ns vs. 190ns) but the question is always if the turn-on and turn-off times tracks or if one can be typical while the other is the worst case. Different manufacturers also have slightly different designs so just because two products have the same name it doesn't mean they are identical.

The other question is if it matter if two amplifiers are shorted together for a few tens of nanoseconds. Amplifiers like TL074 have builtin current limiters at the outputs making them short circuit proof and can be shorted indefinitely. If you run your circuit at maximum frequency for an hour or so without anything breaking, things are most likely fine.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Tue May 05, 2020 10:40 pm

Yeah I noticed that while perusing the datasheet today. It actually says in a little note that switches might have a tiny overlap with address change.

In any case, I have now tried both scenerios, and the wave output is much nicer with the design of 1 summing resistor at the common output. With individual Rs at the inputs, there are some noticable little high frequency blips at the transitions of each segment. I'm guessing this has to do with the charge injection and the difference in how it behaves in the 2 scenerios. Maybe.

Since I already have the board laid out for the individual Rs, so I'll just leave them as is and throw 1kOhms in there a safety measure which can probably be deleted and put the one summing resistor at the output and let it rip.

KSS
Super Deluxe Wiggler
Posts: 2039
Joined: Mon Jan 25, 2016 7:28 am

Re: Something new I built - fun with decade counters

Post by KSS » Tue May 05, 2020 10:43 pm

You'll want to read pg 119 of the CMOS cookbook link I posted. It confirmed what I planned to say befoire re-reading it.

If there's an -inhibit- INH pin, it's often a clue that chnnel crosstalk is possible and expected.

Short answer for most CMOS MUX and AnaSW is that if there's an INH pin, you'd best use it. 4051 implementations in vintage gear often got this wrong with the result that blown 4051's are an expected repair item.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Wed May 06, 2020 10:43 am

Thanks KSS for that link BTW, what a great book!

I did see that page and also the "Special Considerations" page of the 4067 datasheet. But this really only talks about how the overlap will dump some charge from any caps connected to inputs, which is not a conern here at all.

The other issue that I can think of is what I mentioned with 2 summing amps momentarily shorted together, but say I have a 2k resistor on each input as now, any currents aboslute worst case would be 7.5mA. The 4067 can do 25mA switching current max, and as Synthig mentioned, the TL074 is not going to be damaged by this. So, I'm not really seeing any potential for damage here.

Using the INH pin would be a solution for sure, but without thinking about the details too much, initially my thought is any circuitry added to make this happen will be more complex than is worth it. At that point, instead using a different MUX might be the way to go (MUX506 has break-before-make and is only 3.50$) ? What do you think?

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Wed May 06, 2020 12:40 pm

Ordered these proto boards (below) yesterday BTW! Not worrying about panel graphics right now, as I might change things a little. But, this is the general idea. I have ditched the "smoothing" function entirely as I needed to manage space and honestly, everyone has a million filters anyway. There are 2 seperate "segment modulation" inputs on the bottom, and each segment can individually select from signal A, nothing, or signal B. Additionally, the top knob and switch allow a triangle or saw wave at the clock frequency to be mixed back into each segment. Also, I had an extra half of the 4520 counter and used it for a sub-octave square output (next to the main output lower right):
TS0 Proto 1.png
TS0 Proto 2.png
TS0 Proto 3.png
You do not have the required permissions to view the files attached to this post.

Synthiq
Veteran Wiggler
Posts: 551
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: Something new I built - fun with decade counters

Post by Synthiq » Wed May 06, 2020 3:16 pm

devinw1 wrote:
Wed May 06, 2020 10:43 am
Thanks KSS for that link BTW, what a great book!

I did see that page and also the "Special Considerations" page of the 4067 datasheet. But this really only talks about how the overlap will dump some charge from any caps connected to inputs, which is not a conern here at all.

The other issue that I can think of is what I mentioned with 2 summing amps momentarily shorted together, but say I have a 2k resistor on each input as now, any currents aboslute worst case would be 7.5mA. The 4067 can do 25mA switching current max, and as Synthig mentioned, the TL074 is not going to be damaged by this. So, I'm not really seeing any potential for damage here.

Using the INH pin would be a solution for sure, but without thinking about the details too much, initially my thought is any circuitry added to make this happen will be more complex than is worth it. At that point, instead using a different MUX might be the way to go (MUX506 has break-before-make and is only 3.50$) ? What do you think?
Besides the charge dump when turning the switch on or off, the Special Considerations section also mention the maximum 0.8V drop across the switch. When the switch is on, there is a parasitic NPN with the emitter to the common output, base to the input and the collector to VDD. The voltage drop across the switch will therefore also be the Vbe of that NPN so it is possible that current will flow if the output is pulled low by another output if they overlap. A TL074 can sink or source around 10mA so if the switch resistance is 125ohm, the voltage drop across the switch can easily exceed 0.8V. This by itself may not be a big issue if the NPN supplies some of the output current. If the current is high enough it is however conceivable that it could trigger a latchup that could destroy the chip as KSS mentioned but I'm not sure that the 10mA a TL074 can sink is high enough for that. My guess is that you would have experienced it by now it this was a real issue.

The MUX506 (or the similar DG406) looks like a good option even if it is more expensive. On the other hand, it can be driven directly by +/-12V so the 8V regulators can be eliminated and the digital control inputs responds to TTL levels so the 4520 can be supplied from +12V and be driven directly from the 3340 without a level shifter so that would also simplify things as well. So technically it looks like a better solution if cost isn't an issue.
KSS wrote:If there's an -inhibit- INH pin, it's often a clue that chnnel crosstalk is possible and expected.

Short answer for most CMOS MUX and AnaSW is that if there's an INH pin, you'd best use it. 4051 implementations in vintage gear often got this wrong with the result that blown 4051's are an expected repair item.
The INH pin is useful when a multiplexer is expanded beyond a single mux chip so only one at a time is enabled. So I don't think it can be assumed that the purpose is mainly to disable the switch during changes.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Wed May 06, 2020 3:33 pm

Synthiq wrote:
Wed May 06, 2020 3:16 pm

Besides the charge dump when turning the switch on or off, the Special Considerations section also mention the maximum 0.8V drop across the switch. When the switch is on, there is a parasitic NPN with the emitter to the common output, base to the input and the collector to VDD. The voltage drop across the switch will therefore also be the Vbe of that NPN so it is possible that current will flow if the output is pulled low by another output if they overlap. A TL074 can sink or source around 10mA so if the switch resistance is 125ohm, the voltage drop across the switch can easily exceed 0.8V. This by itself may not be a big issue if the NPN supplies some of the output current. If the current is high enough it is however conceivable that it could trigger a latchup that could destroy the chip as KSS mentioned but I'm not sure that the 10mA a TL074 can sink is high enough for that. My guess is that you would have experienced it by now it this was a real issue.

The MUX506 (or the similar DG406) looks like a good option even if it is more expensive. On the other hand, it can be driven directly by +/-12V so the 8V regulators can be eliminated and the digital control inputs responds to TTL levels so the 4520 can be supplied from +12V and be driven directly from the 3340 without a level shifter so that would also simplify things as well. So technically it looks like a better solution if cost isn't an issue.


Thanks for that explaination. If I do include the individual input resistors at 2k as mentinoed, the Vdrop across the switch issue is taken care of as well though. Worst case in this situation should be about 470mV (I calculate).

But yes, I do agree the MUX506 looks like a better option at this point. It is not much more expensive, can be purchased in the same larger SOIC package as the CD4067, and also as you mentined allows the ditching of the +/-8V supplies. :tu:

KSS
Super Deluxe Wiggler
Posts: 2039
Joined: Mon Jan 25, 2016 7:28 am

Re: Something new I built - fun with decade counters

Post by KSS » Thu May 07, 2020 12:38 am

Will again point out that 4051's regularly fail in vintage synths where the inhibit pin's difficulty of use -or belief it was not needed- meant relying on simpler circuits with a prayer and a hope. As you've both surmised and supported, failure won't necessarily be immediate, and it *may* not manifest at all. Historically it did become an issue. Over time. There is some belief that one or another brand is better or worse when used w/o INH, but this does not seem to be an agreed upon conclusion.

User avatar
devinw1
Super Deluxe Wiggler
Posts: 1366
Joined: Tue Aug 07, 2018 11:20 am
Location: Portland, OR
Contact:

Re: Something new I built - fun with decade counters

Post by devinw1 » Thu May 07, 2020 10:10 am

Point defintiely taken, KSS! Thank ya!

I have a MUX506 in the same package (actually a couple more pins I believe) on the way to test.

Post Reply

Return to “Music Tech DIY”