[sdiy] Idea - Triangle wave DCO core

Tom Wiltshire tom at electricdruid.net
Wed Mar 14 13:55:02 CET 2012


On 14 Mar 2012, at 12:06, Olivier Gillet wrote:

>> 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.
> 
> Why is it so? I haven't built DCOs so I cannot tell, but my impression
> is that you can really refresh the timer interval at any time rather
> than systematically at each reset. Might depend on which MCU you use,
> but double buffering techniques (interval register is latched on timer
> reset) or increment/decrement schemes (page 160 here:
> http://www.atmel.com/Images/doc8077.pdf) allow that. So you don't
> really need to have an interrupt at each timer cycle ; you just need a
> 2kHz interrupt (or whatever is your modulations rate) to refresh the
> counters, and more importantly you don't really have to be super
> precise with the timing of those refreshes.

Ok, agreed. There are ways you could do it that eliminate the need for an interrupt at the end of the cycle. As you say, some timers are double-buffered and you could just chuck a new value at them at whatever your modulation rate is. That would certainly be convenient.

The DCO I wrote didn't generate a squarewave and then derive the reset pulse from it as you suggest though. Instead I used a 32-bit timer generating an interrupt and that interrupt triggers a reset pulse for the DCO integrator, as well as toggling a IO pin for a sub-octave square.

Which of these is easier depends a bit what peripherals you've got available on your favourite flavour of uP.

Tom







More information about the Synth-diy mailing list