I’m using Arduino DUE (Sam3X8E) for data acquisition trough ADC converter, I need set two voltages values in DAC0 and DAC1 outputs.
When I try this code yesterday:
it worked fine (I measure analog output DAC0 and DAC1 with voltmeter, these were well), but now suddenly DAC0 always put values around 0 to the output (-0.007V ~ 0.026V) however DAC1 works fine.
I'm using arduino-1.5.6-r2 and I read this interesting post about similar error: DAC support - Arduino Due - Arduino Forum therefore I test top code wit arduino-1.5.7 version with same result, DAC0 doesn’t work fine.
Remember the Due pins cannot drive nearly as much current as the Uno/Mega pins,
some are limited to 3mA absolute maximum(*). Perhaps you overloaded the DAC0
pin somehow?
(*) The datasheet lists the limits in detail if you can find the right section.
If you read the thread you'll see that DAC0 in particular is shared with other functions
on the chip, notable WKUP12, one of the wake-up pins, it is conjectured this is something
to do with the apparent fragility of the DAC0 pin (compared to any of the others).
Anti-static precautions are necessary with all CMOS devices, the Due will be much less
robust than the Uno since the process used has thinner gate oxide and handles smaller
currents and all the transistors are far smaller than in ATmega chips. Its not emphasized
enough on these forums that these devices are delicate to static even with the built-in
protection diodes.
My anti-static precautions are wear cotton only, live in a damp climate... Seriously
avoid nylon carpets and clothing!
Note that the WKUP pins may not have all the protection diodes of other pins as they have
to be able to go HIGH while some internal circuitry is powered down - hence likely to be more fragile. Well, that's the theory.
In general handling electronics you want to place your body at the same potential as the
board before touching any input/output lines. So pick up a board carefully, touching the
grounded USB connectors first if you have any suspicion you might have some static charge.
Having a conducive grounded work surface is great because you ground yourself
to it as soon as you rest your arms. Conducive does not mean conductive, it needs to
leak away static charge without shorting out circuitry. Wood is a fine material for
this use.
I'm not sure if the SAM3X even has protection diodes. I think there's only on die termination of 39 ohm to reduce ringing and EMI. Note the 3.6V DC maximum input voltage ... a tight limit to follow during experimentation and testing, however I don't think there's any code you could use that would damage DAC0.