DAC support

@vdorr

OK, I'm using 1.5.1r2.

The following works as expected here, giving independent control of the two DACs:

        while (true)
        {
            analogWrite(DAC0, 240);
            delayMicroseconds(200);

            for (int i = 0; i < 8; i++)
            {
                analogWrite(DAC1, 240);
                delayMicroseconds(20);
                analogWrite(DAC1, 120);
                delayMicroseconds(80);
            }

            analogWrite(DAC0, 0);
            analogWrite(DAC1, 0);
            delay(9);
        }

Several people in this forum seem to have had trouble and have possibly blown their DAC output(s) by following an Audio example with a loudspeaker (which I haven't tried).

For anyone following with an 'early production' Due like me, please note that the constant 'DAC0' (66) corresponds to pin 'DAC2' on the board header, and 'DAC1' (67) corresponds to pin 'DAC1'.

Attached are screenshots from a Rigol scope. N.B. I'm using x10 probes.

HTH
Jim

aaa.bmp (146 KB)

bbb.bmp (146 KB)