[sdiy] Idea - Triangle wave DCO core
Olivier Gillet
ol.gillet at gmail.com
Wed Mar 14 11:58:39 CET 2012
To me the appeal of the classic ramp DCO design is that the emission
of the reset pulse is a pretty trivial task that can be left to the
timer peripheral of a MCU (or to a dedicated external PIT circuit). On
a MCU, just use a timer in waveform generation mode to generate a
square wave at the target frequency + some simple pulse shaping
circuit to extract the reset pulse on the raising edge. With a 16-bit
timer and a clock scaled at 1.5 MHz, you can cover a fairly large
frequency range with a very good resolution and cycle-accurate timing,
and from a programming and CPU load point of view it's brain dead.
Setup timer, write 1500000 / f to a register and that's it. Some MCUs
have plenty of those timers (thinking of the AVR XMega here: 2 16-bit
timer per 8-bit port) so it can be dead cheap to control a bunch of
DCOs for a polysynth from a single chip (otherwise use external PITs).
Your design would be a different story in terms of CPU use - you
couldn't rely on a MCU peripheral to do all the work "in the
background", you'd need to code your own timer interrupt to toggle the
DAC output. Fairly easy when driving only one DCO, but think about the
case when you want to drive many from a single MCU... One option would
be to have a single timer interrupt at a predefined rate (say 100kHz)
and do all your toggling from there. The risk is that this will have
the same aliasing problems as a digital oscillator, since transitions
would be aligned to this fairly coarse grid. Another option would be
to use a timer interrupt per DCO, with the timer counter set to do the
right spacing between pulses. The problem here: what would happen if
two DCOs need to be toggled at exactly the same time? How would you
prioritize them? This would leave you with a crappy temporal
resolution - again, prone to aliasing problems. Also, not sure how
accurate DACs will be timing-wise...
Olivier
More information about the Synth-diy
mailing list