My 40106 VCO with a tuner

Hi there,
Finally got to built 3 units of my VCO design. I had the front panel and PCBs made at JLCPCB.
All project and Gerber files are available here: GitHub - DeMarco/DMH-VCO-40106: VCO module based on the CD40106 Hex Inverter chip

I like the philosophy of using general purpose, readily available components only, so I’m drawing heavily from the circuits teached by Moritz Klein in his YT channel. This VCO is built around a CD40106 chip and a pair of BC558/548 as linear-to-exponential CV converter. I’ve put together a lot more extra features, like a Sync input and trimpots to adjust the range and centering of the Fine Tune knob (inspired by LMNC). But of course the most prominent addition is the tuner, another LMNC idea I stole. I never got around to learning Arduino, but I have experience with programming PIC and AVR microcontrollers in pure C with the help from the datasheet, and I wanted to challenge myself to come up with a simple tuner design of my own. Main difference is that I wanted to use 5 LEDs to display the note accuracy, and a separate LED to signal sharp (#) notes. I also have a switch to turn the tuner off in case I don’t want to be bothered by the flickering lights. Unfortunately I learned the internal RC oscillator of the microcontroller I used (ATtiny4313) is of course not extremely precise, so there will always be a tiny offset if I compare the central frequency with the one measured by a tuner in Ableton, for example. I have ideas to make it better, but I’ll focus on something else for now.

Here’s a demo. The LFO signal on VCO #2 comes from a Behringer Neutron offscreen.





17 Likes

Incredible work. Thanks for posting!

2 Likes

This looks like a gem! I love that Sam has inspired a bunch of builders to have self-tuning oscillators :slight_smile:

1 Like

just came back to this after having some time to take a look at the files. What’s the process for programming the attiny chip it uses?
I programmed some attiny chips in the past and it was an absolute nightmare for me, I ended up programming a bunch more than I needed because I never thought i’d get the set up correct again.

Hi there,

ATtiny are microcontrollers from the AVR family. There’s a bunch of AVR programmers around, but I stick to the one I now, the USBasp: USBasp - USB programmer for Atmel AVR controllers - fischl.de

I bought mine from my local electronics stockist: https://www.tinytronics.nl/en/communication-and-signals/serial/usb/usbasp-usb-avr-programmer-with-flatcable, but you can probably source it somewhere else.

The USBasp needs a driver if you use Windows, which you can install with Zadig, see the USBasp page for a link.

You’ll also need a piece of software called “AVRDUDE” to make use of the USBasp: AVRDUDE - AVR Downloader/UploaDEr

If you clone my VCO repo to your PC, the AVRDUDE is already included in folder DMH_VCO_40106_Firmware, along with some batch scripts. If the USB driver installation with Zadig went well, all you need to do is:

  1. plug the USBasp to an USB port
  2. plug the other end on the small 6 pin connector on the VCO
  3. run the “flash_fuses.bat” script
  4. run the “flash_firmware.bat” script

If the AVRDUDE did not return errors, just unplug everything and the VCO is ready to be calibrated.

There is the possibility that the tuner will not be very accurate out of the box, since the ATtiny’s internal RC oscillator is not perfectly calibrated to produce a 8MHz clock at 5V. I’ll post here later how to compensate for that.

1 Like

Here’s a couple pictures of how to connect things. You’ll also need an adapter to convert from ISP 10-pin pinout to the 6-pin pinout (or make one yourself), like this: https://www.tinytronics.nl/en/communication-and-signals/serial/usb/6-pin-to-10-pin-adapter-for-avr-programmer

And be sure to align the red strip of the flat cable with the triangle mark on the VCO, otherwise the 5V/GND will be reversed. It won’t fry anything the VCO thanks to the protective diodes, but it won’t work either. :stuck_out_tongue:


By the way, the flatcable that normally ships together with the USBasp is very short. I preferred to make a longer one.

1 Like

ahh, i totally overlooked that header on the actual module. nice!
Looking at the schem and the layout again with that in mind, it looks like the header is just going straight to the pins on the IC, so could I prog it with the IC in a bit of breadboard? I wanna make sure I can successfully program the IC before I build the module.

For sure!
If you make connections highlighted below on a breadboard, it’s enough to program the chip and to check that it’s working:

As soon as the programming is finished (you’ll see a “progress bar” on the terminal window when you run the .bat script), the chip is reset and immediately starts functioning, so you’ll see the 6 LEDs light up in a quick succession and then go out. This is what the tuner does as soon as you power the module as a way to tell the user “I’ve been powered and I’m ready!” :stuck_out_tongue:

The 5V and GND are provided by the USBasp itself, by the way. It will draw power from your USB port.

thats fantastic, thanks!
Moving this one up the build queue then, will probable get to it within a couple of years :smiley:

2 Likes

Good luck, hope you make it there soon :stuck_out_tongue_winking_eye:

2 Likes