Arduino Forum

Products => Arduino Zero => Topic started by: mantoui on Nov 29, 2015, 07:09 pm

Title: ZERO using timer and DMA to drive DAC
Post by: mantoui on Nov 29, 2015, 07:09 pm
Here is a simple proof of concept of using TCC0 timer to drive DAC from circular DMA buffer.

https://github.com/manitou48/ZERO/blob/master/dacdma.ino (https://github.com/manitou48/ZERO/blob/master/dacdma.ino)

The sketch uses the PWM timer TCC0 on pin 12 (not used), and then overrides the frequency and duty cycle.  A circular buffer of 128 half-words is used by the DMA to fill the DAC on each timer tick.  Example can use sawtooth or sine wave in buffer.
Verified with scope.
Title: Re: ZERO using timer and DMA to drive DAC
Post by: AloyseTech on Nov 29, 2015, 07:54 pm
Great, as always ! Thanks ;)
Title: Re: ZERO using timer and DMA to drive DAC
Post by: electro_95 on Aug 15, 2017, 10:23 am
Thanks as always for these useful examples.  I'm trying to adapt this to use the DMA to copy cc0 each time that the TCC0 MC1 interrupt occurs.