Waveform output on Due

Just use analogWrite...

  pinMode(DAC0, OUTPUT);
  analogWriteResolution(12);
  analogWrite(DAC0, a);[/a]
If it's complaining that DAC0 isn't defined then double-check you have the correct board selected on the Tools menu.

Note the pinMode isn't strictly necessary as analogWrite checks that anyway.