News:

SMF for DIYStompboxes.com!

Main Menu

4040/4024 vs 4017

Started by parmalee, December 13, 2015, 12:33:53 AM

Previous topic - Next topic

parmalee

Hello all,

I'm designing an add-on for my faux Farfisa Compact bass pedal module--outlined here http://www.diystompboxes.com/smfforum/index.php?topic=108686.msg991399#msg991399 (the short of it:  I've added a switchable octave/octave-and-a-half set of bass pedal notes at the lower end of the keyboard scale on my pedal harmonium.  Actual bass pedals aren't really an option, as I use one foot to operate the bellows and the other to switch in effects and such.)

The add-on is essentially a slight mod of merlin's excellent U-Boat sub-octave effect*, with an added harmony generator.  I'm going the 4046 pll route, multiplying by 3 (to achieve 5ths) and 4 (to achieve an octave or two up, depending upon the division), and dividing accordingly.  Kinda like R.G. does here with the Anderton sub-octave (or as encountered in the Schumann PLL and a number of other projects):



(from this thread: http://www.diystompboxes.com/smfforum/index.php?topic=105622.20)

The 4046 and 4024 portions at the bottom are the only relevant bits here.

What I've found is that I can achieve the feedback muliplication (as R.G. does with Q5--or the divide (multiply) by 32) AND tap the remaining outputs (Q1, Q2, Q3, etc.) for division purposes with a 4024.  Likewise, this works with a CD4040, or any of the binary counters for that matter.  However, I cannot do the same with a decade counter, like the CD 4017.  With the 4017, I can only use one of the divisors and draw from the clock input.

I would like to be able to, say, send Q6 from the 4017 to the comparator in (pin 3) of the 4046--effectively multiplying the fundamental by 6--and then tap Q3 and Q4, to achieve my octave and 5th, respectively.  But I can't.

Why?

Sure, I could achieve this with the addition of just one or two more chips, but I'm trying to keep my parts count to a minimum.  But, perhaps more  importantly (as far as satiating my curiosity), I would simply like to know why this seems to work with binary counters, but not with decade counters.

*  My faux Farfisa unit is fully polyphonic, which suits my frequent legato style of playing; whereas the octave unit is analogue, hence mono, and glitches a bit as I glide over the keys--the combo is kinda cool sounding

anotherjim

I have experimented with 4017 as divider in a PLL -  and got other pitches than octaves - so it is possible. There are a few things to consider.

The divisor achieved depends on the number of counts before reset. All Q outs run at the same frequency, they only differ in timing relative to the clock. So if you want 1/7, then feed reset from Q7 and use any of Q0 thru Q6 for output.

Unlike the binary counter, output is not a 50% duty cycle unless the count is only 2 (reset from Q2) or you logical OR consecutive counts (diodes simplest). So for 1/6 use Q0 (OR) Q1 (OR) Q2 and reset from Q6. You cannot have a perfect 50% unless the count is even numbered.


slacker

#2
You can do it with a binary counter because it's doing division each output is half the frequency of the previous one.

A CD4017 is counting so if you use Q6 then it's going 123456123456123456123456 so Q6 pulses once every 6 input clock cycles, and you get divide/multiply by 6. Your problem is all the other outputs only pulse once every 6 clock cycles as well, they're all going the same speed. Eg: Q6 pulses on the 6th input clock and then on the 12th, then on the 18th etc
Q3 pulses on the 3rd input clock and then on the 9th, then on the 15th etc

If it helps this is what the outputs of a CD4017 do
compared to a CD4024

Look at the LEDs on the right hand side, each output goes half the speed of the previous one.

Hope that makes sense.

This might be worth looking at, it gives a decent range of harmonies http://electro-music.com/wiki/pmwiki.php?n=Schematics.PLLFREQUENCYMULTIPLIERMODULE

EDIT: Jim beat me to it but as I'd written it anyway :)

parmalee

#3
Thank you both for the responses, it makes perfect sense now.

QuoteI have experimented with 4017 as divider in a PLL -  and got other pitches than octaves - so it is possible. There are a few things to consider.

Yeah, I was certainly able to achieve multiple divisions (or multiples, rather)--but only a single one at a time.  And I did notice the curious various in duty cycles and was wondering about that.

I know that achieving multiple octave ups and downs is possible, whilst using the single chip (a binary counter, that is); but it appears that I am going to have to use at least two counters--and two 4046s--to achieve both the 5th and the octave.

Unless, of course, there's some obscure base 6 counter out there--which I am absolutely certain there is not.  ;)

parmalee

QuoteThis might be worth looking at, it gives a decent range of harmonies http://electro-music.com/wiki/pmwiki.php?n=Schematics.PLLFREQUENCYMULTIPLIERMODULE

I've looked over that one before, and considered it for other projects.  Although, thinking on it now, I realize I can achieve what I'm aiming for with a single 4046; however, I would be adding flip-flops to the design, instead of just another 4046.  I've got a bunch of 4046s lying around, for some reason, so I might as well just go that route.

anotherjim

I was only thinking about pll multiplying above, but did achieve complex wave shaping from a 4017, but it needs a lot of components. The aim was to produce combinations of frequencies from the one counter.

It's quite difficult to explain, but essentially you combine outputs to make a particular ratio of the frequency set by the total division (the maximum count).
Actually, I forgot to mention above that combining the outputs by OR'ing consecutive ones is the key to obtaining other frequencies as well as controlling duty cycle.

If we let the 4017 count all the way thru Q9 (no reset) and 10 counts=1/10...
I'll write (+) to mean logical OR
Then Q0 alone=1/10
and Q0 (+) Q1=1/5
and Q0 (+) Q1 (+) Q2=3/10
... you see where this going?

There's more to it though...
What if we skip some outputs?
Q0(+)Q1(+)Q4
You get 3 separate frequencies combined believe it or not, owing to the number of separate periods there now are in the cycle.

The problem remains of thin duty cycles. You can reduce this by using combinations that always have at least 2 consecutive Q's or reduce the overall division below 10. Actually, 1/5 (reset from Q5) gives plenty to go at.
If you feed each required Q out via forward diodes to a common wire, you can have several combinations from a rotary switch - but you need separate diodes for each combination. The diodes are your OR gates. The common of the switch is the output, but must have a pull down resistor to bias the diodes.



anotherjim

Ooops! The above isn't quite right.
To really get different frequencies, you have to OR together the outputs in a fashion that is relative to the total count. The unused outputs are very important.
To keep it simple, lets use just one output, Q0, and connect Q3 to the reset. Q0 with be high once every 3 clocks. It will have 33/66% duty cycle and is 1/3rd of the clock frequency.
If we use Q0 and Q3 or'd together and reset from Q6, the result is the same. You will have 2 cycles before the counter resets, but it's still 1/3 of the clock.

So..
Q0,Q2,Q4,Q6,Q8 or'd and no reset  is half the counter clock frequency. The outputs are making 5 cycles per full count of 10 at 50% duty cycle. The total Or'd output is low during the unused counts.

If you're prepared to have non equal duty cycle, and/or have a rotary switch to modify the counter reset length, different combinations lead to other, including odd, divisions of the clock.
Q0,Q1,Q2 with reset on Q6 is 1 cycle in 6 clocks, so you have 1/6th.
Q0,Q1,Q2,Q3 or'd...
With reset from Q9 is 1 cycle in 9 clocks or 1/9th. Reset on Q8 is 1/8th. On Q7 it's 1/7th.
To get 1/5th... Can you work it out?