Show Posts
Pages: [1]
1  Products / Arduino Due / Re: DAC support on: November 03, 2012, 06:48:13 am
I made a bug report here: http://code.google.com/p/arduino/issues/detail?id=1092

Please use the patch attached to the ticket. There is also a bugfix regarding corruption of the data register, when writing too fast.
2  Products / Arduino Due / Re: DAC support on: November 01, 2012, 01:20:19 pm
Fix was trivial. Please find attached the patch for wiring_analog.c. Should I make bug report?

mfg, Stefan.
3  Products / Arduino Due / DAC support on: October 29, 2012, 02:59:42 pm
Hey there,

I tried the DACC on the Arduino Due, but it doesn't work as expected. I used the function analogWrite() for setting a new DAC value. The following code will work as expected:

Code:
byte value;
void loop() {
  analogWrite(DAC0, value++);
}

Same applies if you replace DAC0 with DAC1. For some unknown reason, I couldn't get both DACs to work simultaneously. The following code does not work:

Code:
byte value;
void loop() {
  analogWrite(DAC0, value++);
  analogWrite(DAC1, value * 2);
}

I think it has something to do with the code in hardware/arduino/sam/cores/arduino/wiring_analog.c. In the function analogWrite() there is the following lines:

Code:
// Write user value
 ulValue = mapResolution(ulValue, _writeResolution, DACC_RESOLUTION);
 dacc_write_conversion_data(DACC_INTERFACE, ulValue);

I'm missing the channel selection before writing conversion data. Did someone else use the DACs before with analogWrite()? Is the reported behaviour bug or feature?

mfg, Stefan.
Pages: [1]