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 23, 2020 10:08 am

Studioalethea wrote:
Thu Apr 23, 2020 12:27 am

You do all the datasheet stuff? Pin 3 @ -5V, polysty timing cap, correct current at Pin14? Are you running at Eurorack voltages with adjusted resistors?

I hear you on the breadboard frustrations. That was my entire week last week just trying to troubleshoot my Moog ladder.
Ya, I'm using +/- 12 off a solid bench PSU. -5V and +5V coming thru 7805 and 7905 regulators with filtering caps. Using -5V on pin 3 and using +/-5 for the CVs with adjusted resistors. Though I tried using 12V for that with different values and still the same.

The only thing I don't have is a PS cap at that value. I don't think they make them that small actually. Mica should be good but I had to order it. I did try the lower film cap I had, which was a PP 150p and it did the same thing.

It must be a connection thing. Because, I swear it was pretty solid on the other little breadboard, even up at ~200 kHz.

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 Apr 25, 2020 6:09 pm

So, good news and bad news.

Good news is I've got the 3340 working fine again. I tore everything off the breadboard and rebuilt it and now it's totally fine without the frequency instabilities, all the way up to the needed 200Khz. Using a 100pF mica for the integrating cap.

The bad news is I keep frying 4017 counter ICs! Well 2 of them, because now I need to order more. I have a new design which requires me to run the 4017 dual supply and am using +/-8V off my bench supply. Everything will be working just fine, and then I'll go to turn on the PSU and both rails will be kicked to the current limit like they are shorted to ground. Unplug the 4017 and back to normal. It's only been on power-up so I'm guessing my bench PSU is spiking or something (probably on the negative rail)? Or some inrush situation? There aren't any open inputs. I've pulled the unused ones (Clock inhibit and reset) down to V-, so I'm thinking that's not the problem.

Maybe I need to put some protection Zeners on the power pins of it?

User avatar
SphericalSound
Common Wiggler
Posts: 238
Joined: Thu Feb 01, 2018 9:23 am
Location: Spain

Re: Something new I built - fun with decade counters

Post by SphericalSound » Sat Apr 25, 2020 7:25 pm

devinw1 wrote:
Sun Apr 19, 2020 9:00 pm
Thanks guys. Any and all discussion is always appreciated!

Looks like there actually are some 10 channel switch ICs but non in thru hole. MUX idea is interesting too but again the 10 channel thing. I could trim it to 8 but 10 is better!

Re: R254 I think it's ok. Just a ref current for a standard white bread PNP expo converter
There´s the 4067 MUX with 16 channels in thru hole too costing peanuts

https://es.aliexpress.com/item/40000265 ... lsrc=aw.ds

Project seeming fantastic :party:ç

Yeah, try that zeners

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 » Sat Apr 25, 2020 9:09 pm

it could be an issue of the rails coming up in the wrong order, or a pulse from the VCO or other chip being at the wrong level at startup. you could try some protection on its inputs and/or outputs to see whats causing it. also, you could try single supply on the 4017 and then level shift the ins/outs as needed. i find the 4000 series logic to be pretty sensitive.
openmusiclabs.com

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

Re: Something new I built - fun with decade counters

Post by KSS » Sat Apr 25, 2020 9:42 pm

IME, 4017 has always seemed overly 'picky' in comparison to other 4xxx. Definitely one where the mfr matters.

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 Apr 26, 2020 1:02 pm

guest wrote:
Sat Apr 25, 2020 9:09 pm
it could be an issue of the rails coming up in the wrong order, or a pulse from the VCO or other chip being at the wrong level at startup. you could try some protection on its inputs and/or outputs to see whats causing it. also, you could try single supply on the 4017 and then level shift the ins/outs as needed. i find the 4000 series logic to be pretty sensitive.
This was when I still had my clock being fed from my external function generator (which was powered off when turning on the breadboard), so for sure I have it narrowed down to the power rails themselves I think.

I didn't fry any while running single supply, so I think it is happier that way. The only thing is I have been playing with my original VCA version, which I have greatly simplified and works quite well (better than the switch version), but with split supply I can directly feed Iabc through a resistor to each LM13700 and they will be able to shut off completely. I could level shift, or add a PNP transistor but whatever I do I have to do 10 times (one for each channel :( ).

I wonder if just having a large-ish electroltyic cap at each supply pin would help any?

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 Apr 26, 2020 1:04 pm

SphericalSound wrote:
Sat Apr 25, 2020 7:25 pm
devinw1 wrote:
Sun Apr 19, 2020 9:00 pm
Thanks guys. Any and all discussion is always appreciated!

Looks like there actually are some 10 channel switch ICs but non in thru hole. MUX idea is interesting too but again the 10 channel thing. I could trim it to 8 but 10 is better!

Re: R254 I think it's ok. Just a ref current for a standard white bread PNP expo converter
There´s the 4067 MUX with 16 channels in thru hole too costing peanuts

https://es.aliexpress.com/item/40000265 ... lsrc=aw.ds

Project seeming fantastic :party:ç

Yeah, try that zeners
Ah yes, didn't see that one. Thanks. That could work. I guess with the adapter board it kinda counts as THT :D.

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 Apr 26, 2020 9:32 pm

Damn, I just read this in an article about CMOS devices:

"All low-impedance equipment (pulse generators, etc) should be connected to CMOS inputs only after the device is energized. Similarly, this type of equipment should be disconnected before power is switched off."

That's exactly what I have not been doing. I've been powering up the bread board with the function generator connected, but turned off. The more ya know!

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 » Sun Apr 26, 2020 10:34 pm

yeah, that will do it. i still dont fully understand the mechanism of failure in that mode, though. i ran a bunch of tests a few months back, and could consistently destroy some CMOS with a signal connected to it with power off. i even had a 1k resistors in series with the source to limit the current. ive seen chips get powered up from I/O signals through the protection diodes, so maybe its getting into some wierd state as a result.
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 » Mon Apr 27, 2020 10:10 am

That is odd. I wonder what is going on there.

Another thing I read in this article (which is pretty good btw) (https://www.analog.com/media/en/technic ... 2AN311.pdf) is that TSS diodes are best for protecting CMOS because they are much faster than regular zeners. I'm not sure how much this matters for some of the older "slower" stuff that we commonly use here (regular CD series etc..), but a variety of TSS diodes can be had for similar price to regular zeners, so it seems worth using them.

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 Apr 27, 2020 12:46 pm

If PSU current limit kicks in, it could be a sign that your CD4017 has latched up. Most CMOS circuits have internal parasitic pnpn structures between the supplies and behaves like a thyristor and will short the supplies if triggered and will only turn off by removing the supply voltage. A common way to trigger the thyristor is to apply too much current to a pin by biasing an input (or output) outside the supply voltages. The CD4017 datasheet says max 10mA input current. It may also be possible to trigger it by applying too high voltage to the supply pin.
https://en.wikipedia.org/wiki/Latch-up

In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.

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 Apr 27, 2020 1:00 pm

Synthiq wrote:
Mon Apr 27, 2020 12:46 pm
If PSU current limit kicks in, it could be a sign that your CD4017 has latched up. Most CMOS circuits have internal parasitic pnpn structures between the supplies and behaves like a thyristor and will short the supplies if triggered and will only turn off by removing the supply voltage. A common way to trigger the thyristor is to apply too much current to a pin by biasing an input (or output) outside the supply voltages. The CD4017 datasheet says max 10mA input current. It may also be possible to trigger it by applying too high voltage to the supply pin.
https://en.wikipedia.org/wiki/Latch-up

In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.
Both chips though, trigger the PSU limit even with all the other stuff disconnected - so just power, and pulling inputs all low - so I think both chips are fried, not just in a state of latchup.

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

Re: Something new I built - fun with decade counters

Post by KSS » Mon Apr 27, 2020 2:19 pm

Synthiq wrote:
Mon Apr 27, 2020 12:46 pm
In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.
Ah, the old John Simonton trick.

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 Apr 27, 2020 2:45 pm

devinw1 wrote:
Mon Apr 27, 2020 1:00 pm
Both chips though, trigger the PSU limit even with all the other stuff disconnected - so just power, and pulling inputs all low - so I think both chips are fried, not just in a state of latchup.
A latchup can be very local so there is always the risk that all that energy is concentrated to a small spot on the chip causing it to melt there and create a permanent short. If it originally happened with all inputs grounded it would be harder to explain unless there were a high voltage spike on the power supply when turned on. If this is the case, a RC lowpass filter on the supply together with a zener diode might help. I replace the resistor with a RXEF005-2 polyfuse to limit the current in case the chip latches up anyway.

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 Apr 27, 2020 3:26 pm

KSS wrote:
Mon Apr 27, 2020 2:19 pm
Synthiq wrote:
Mon Apr 27, 2020 12:46 pm
In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.
Ah, the old John Simonton trick.
That is interesting. I hadn't even thought of that. I believe this would totally work. Very tricky.

Then the clock would just need to go from 0 to about 80% or V- then 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 » Mon Apr 27, 2020 6:58 pm

devinw1 wrote:
Mon Apr 27, 2020 3:26 pm
KSS wrote:
Mon Apr 27, 2020 2:19 pm
Synthiq wrote:
Mon Apr 27, 2020 12:46 pm
In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.
Ah, the old John Simonton trick.
That is interesting. I hadn't even thought of that. I believe this would totally work. Very tricky.

Then the clock would just need to go from 0 to about 80% or V- then right?
If you just want to meet the spec the clock can toggle between 30% and 70% of the supply voltage but that will still result in static current consumption in the clock input stage so I would suggest to not deviate more than 1.5V from each supply voltage.
Below is a simple level shifter whose output swings between 0% and 100% of the supply. The upper limit of R2 is set by the rise/fall times with the capacitance at the output. R1 must be low enough to generate more current than is needed to get full swing across R2 and will depends on amplitude of the clock signal. D1 prevents the output from going one Vbe-Vcesat above ground and D2 prevents breakdown in the Q1 base-emtter diode for large negative input signals. The clock input is a schmitt-trigger input so the slow rise/fall time isn't really a concern.
Level_shifter.gif
You do not have the required permissions to view the files attached to this post.

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 Apr 28, 2020 10:22 am

Synthiq wrote:
Mon Apr 27, 2020 6:58 pm
devinw1 wrote:
Mon Apr 27, 2020 3:26 pm
KSS wrote:
Mon Apr 27, 2020 2:19 pm
Synthiq wrote:
Mon Apr 27, 2020 12:46 pm
In the case of the VCA version, is there anything preventing the CMOS circuit from being powered between ground and negative supply so the Iabc can be driven directly via a resistor and only level shift a single clock signal. A level shifter would also help isolating the CD4107 from the outside world which might even be a good thing.
Ah, the old John Simonton trick.
That is interesting. I hadn't even thought of that. I believe this would totally work. Very tricky.

Then the clock would just need to go from 0 to about 80% or V- then right?
If you just want to meet the spec the clock can toggle between 30% and 70% of the supply voltage but that will still result in static current consumption in the clock input stage so I would suggest to not deviate more than 1.5V from each supply voltage.
Below is a simple level shifter whose output swings between 0% and 100% of the supply. The upper limit of R2 is set by the rise/fall times with the capacitance at the output. R1 must be low enough to generate more current than is needed to get full swing across R2 and will depends on amplitude of the clock signal. D1 prevents the output from going one Vbe-Vcesat above ground and D2 prevents breakdown in the Q1 base-emtter diode for large negative input signals. The clock input is a schmitt-trigger input so the slow rise/fall time isn't really a concern.
Level_shifter.gif
Thank you, sir! I will give this a shot! :tu: :tu:

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 Apr 29, 2020 10:02 am

Synthiq, thanks again for that 0/V- trick! Got some more 4017s in and it works great, and saves parts! I built the basic level shifter and had to lower the impedance some to get it to respond up into 200Khz which I require, but it works great. To keep it simple and minimize any extra parts around the 3340, I'm using the sawtooth, level shifted, for the clock.

Studioalethea
Common Wiggler
Posts: 231
Joined: Mon Dec 23, 2019 2:20 am
Location: Seattle

Re: Something new I built - fun with decade counters

Post by Studioalethea » Wed Apr 29, 2020 11:59 am

devinw1 wrote:
Wed Apr 29, 2020 10:02 am
Synthiq, thanks again for that 0/V- trick! Got some more 4017s in and it works great, and saves parts! I built the basic level shifter and had to lower the impedance some to get it to respond up into 200Khz which I require, but it works great. To keep it simple and minimize any extra parts around the 3340, I'm using the sawtooth, level shifted, for the clock.
Now that it seems like you got your circuit working, I don't feel as bad about hijacking your thread: might I ask about the need for 200kHz range?

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 Apr 29, 2020 12:08 pm

Studioalethea wrote:
Wed Apr 29, 2020 11:59 am
devinw1 wrote:
Wed Apr 29, 2020 10:02 am
Synthiq, thanks again for that 0/V- trick! Got some more 4017s in and it works great, and saves parts! I built the basic level shifter and had to lower the impedance some to get it to respond up into 200Khz which I require, but it works great. To keep it simple and minimize any extra parts around the 3340, I'm using the sawtooth, level shifted, for the clock.
Now that it seems like you got your circuit working, I don't feel as bad about hijacking your thread: might I ask about the need for 200kHz range?
Haha! Not a problem!

The 3340 is clocking the decade counter, so 10 steps per period of wave generated. So to get 20Khz output, you clock at 200Khz.

Studioalethea
Common Wiggler
Posts: 231
Joined: Mon Dec 23, 2019 2:20 am
Location: Seattle

Re: Something new I built - fun with decade counters

Post by Studioalethea » Wed Apr 29, 2020 12:49 pm

devinw1 wrote:
Wed Apr 29, 2020 12:08 pm
Studioalethea wrote:
Wed Apr 29, 2020 11:59 am
devinw1 wrote:
Wed Apr 29, 2020 10:02 am
Synthiq, thanks again for that 0/V- trick! Got some more 4017s in and it works great, and saves parts! I built the basic level shifter and had to lower the impedance some to get it to respond up into 200Khz which I require, but it works great. To keep it simple and minimize any extra parts around the 3340, I'm using the sawtooth, level shifted, for the clock.
Now that it seems like you got your circuit working, I don't feel as bad about hijacking your thread: might I ask about the need for 200kHz range?
Haha! Not a problem!

The 3340 is clocking the decade counter, so 10 steps per period of wave generated. So to get 20Khz output, you clock at 200Khz.
Intriguing! Math(s)!

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 Apr 29, 2020 4:20 pm

devinw1 wrote:
Wed Apr 29, 2020 10:02 am
Synthiq, thanks again for that 0/V- trick! Got some more 4017s in and it works great, and saves parts! I built the basic level shifter and had to lower the impedance some to get it to respond up into 200Khz which I require, but it works great. To keep it simple and minimize any extra parts around the 3340, I'm using the sawtooth, level shifted, for the clock.
Good to hear it works and I'm not surprised to had to adjust the resistors. With a ramp input, the level shifter must work as a linear amplifier so the resistors had to be adjusted accordingly to prevent clipping. With pulse inputs it only has to swing between -12V and 0V and some clipping doesn't matter too much. But would it really be that more complex to drive the level shifter with the pulse output? Only 2 resistors would be needed to set the PWM input to the appropriate level. Since the timing problem is mostly related to longer fall time at the level shifter output, the PWM control input could be reduced to compensate for that. Also, I forgot to mention that capacitor C1 in my simulation schematic represented the load of the CD4017 clock input and shouldn't be added as a actual component, but hope that was clear anyway.

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 10:31 am

Synthiq wrote:
Wed Apr 29, 2020 4:20 pm
Good to hear it works and I'm not surprised to had to adjust the resistors. With a ramp input, the level shifter must work as a linear amplifier so the resistors had to be adjusted accordingly to prevent clipping. With pulse inputs it only has to swing between -12V and 0V and some clipping doesn't matter too much. But would it really be that more complex to drive the level shifter with the pulse output? Only 2 resistors would be needed to set the PWM input to the appropriate level. Since the timing problem is mostly related to longer fall time at the level shifter output, the PWM control input could be reduced to compensate for that. Also, I forgot to mention that capacitor C1 in my simulation schematic represented the load of the CD4017 clock input and shouldn't be added as a actual component, but hope that was clear anyway.
Yes, clear on the capacitance! The clipping at 0 doesn't matter at all though since the clock input is a schmitt trigger like you mentioned. With the larger resistors, the circuit was just rounding off the edge of the ramp and only getting down to like -5 or -6 Volts at high freqencies. Adjusting them as I did allows a nice ramp (though clipped off at 0) down to -12ish all the way from 0 to 200Khz, which makes the 4017 happy.

Do you think there is an advantage to using the pulse instead?

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 » 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.

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 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:

Post Reply

Return to “Music Tech DIY”