Tuesday, June 17, 2014

6-stage CD4013 clock divider

So, following on from my last post demonstrating an Arduino-based clock divider, I made another one with just dual-flipflop (CD4013) logic chips. This design divides into powers of two, from /1 to /32, using six flipflop units. Nothing fancy or ground-breaking - just implementing something I found on Wikipedia.

It seems that it needs the input clock pulse voltage to be reasonably close to the IC supply voltage. When I ran it at 12V supply with 5V input pulses it didn't seem to work very well at all. 6V supply with 5V pulses seems to work quite reliably. This can be improved by feeding the input clock line with a MOSFET.

Essentially this is an implementation of the cascading arrangement depicted here. The only parts not noted in that diagram are:

  • The additional flipflops, which are wired in exactly the same way
  • RESET and SET lines on each CD4013 must be tied low
  • The usual power supply rails

Sunday, June 15, 2014

Arduino clock generator + divider experiment

Lately I've been learning about modular synths. One of the common things modular folks use to control things is a pulsed clock. This afternoon Tiina and I wandered down to Redfern to check out a meeting of the New Sound Waves modular synth group. The guys there had synced up their modulars and assorted other equipment with a shared clock source and were collaboratively making music. Pretty cool stuff.

Anyway, I decided to try to make my own clock divider. Didn't take long to get something working, and you can see the results in the video above. The genuine Arduino Uno is generating a simple square wave on pin 13, which you can observe with the built-in LED. The Freetronics clone is triggering on the rising edge of the square wave and operating a clock divider with /1 through /8 outputs. The /1 through /4 divider outputs are attached to a little test-LED board I made a while back. You can see that it has a bug caused by my forgetting to reset the tick counter.

To actually use this in a modular synth it would need to tolerate inputs in the range -12V to +12V, maybe via a bunch of MOSFETs. It might be easier to just ditch the AVR and use flip-flops