[sdiy] Idea - Triangle wave DCO core
Tom Wiltshire
tom at electricdruid.net
Wed Mar 14 12:30:16 CET 2012
On 14 Mar 2012, at 10:58, Olivier Gillet wrote:
> 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
I don't agree that this is a *lot* more work for the MCU, Olivier. Perhaps it's more work than leaving a timer running in the background on it's own, but a practical DCO needs a interrupt at the end of the wavecycle anyway. This is because that's the point at which you change the frequency and any modulations are applied. In the triangle wave case the interrupt rate doubles, since I need one going up and one going down, but all the interrupt does is check for modulations, modify the frequency if required, and flip the DAC output polarity. The doubling of interrupt rate is a plus as well as a minus since the modulation resolution is also doubled. You've still got the "no FM" limitation of DCOs, but it'll be better than the Ramp DCO case.
Ultimately, I guess the only way to know for sure how practical it is is to try it.
Tom
More information about the Synth-diy
mailing list