The Arduino Due supports analogWrite() on pins 2 through 13, plus pins DAC0 and DAC1. Unlike the PWM pins, DAC0 and DAC1 are Digital to Analog converters, and act as true analog outputs.
DAC1 and DAC2 These pins provides true analog outputs with 12-bits resolution (4096 levels) with the analogWrite() function. These pins can be used to create an audio output using the Audio library.
Hi,I also wonder how to write to the second DAC and I agree that it is incredibly difficult to find anything about it.However, for me the reason is not that I have blown out my first DAC, but I want to experiment addressing both DACs at the same time. Like for true stereo output for example. Unfortunately that means that mcleung's method won't help.Does anyone have an idea on how to directly address the individual DACs using dacc_write_conversion_data? Or is there any other way without using slow analogWrite()?Thanks a lot,dodgerts
/* write to DAC0 */ dacc_set_channel_selection(DACC_INTERFACE, 0); dacc_write_conversion_data(DACC_INTERFACE, some_value); /* write to DAC1 */ dacc_set_channel_selection(DACC_INTERFACE, 1); dacc_write_conversion_data(DACC_INTERFACE, some_other_value);
analogWrite(DAC0, some_value);analogWrite(DAC1, some_other_value);