I'm trying to connect the AD5754 DAC to the Arduino Uno. I'm using a library and sketch I found [u]here[/u]. The datasheet for the DAC is [u]here[/u].
I made only two changes to the Arduino Sketch code, changing the lines:
DAC.SetDAC(2.2,1); DAC.SetDAC(1.8,2);
to
**DAC.SetDAC(5,1); ** DAC.SetDAC(5,2);
My wiring for the DAC is as follows:
Pin #
Mnemonic
Connected to
1
AVss
GND
1, 6, 12, 13
NC
Not Connected
3
VoutA
LED +
4
VoutB
LED +
5
BIN/2sCOMP
GND
7
SYNC
Not Connected
8
SCLK
Arduino Pin 13
9
SDIN
Arduino Pin 11
10
LDAC
GND
11
CLR
GND
14
DVcc
Arduino 5V
15
GND
GND
16
SDO
Arduino Pin 12
17
REFIN
2.5V (via voltage divider on Arduino 5V)
18, 19
DAC_GND
GND
20, 21
SIG_GND
GND
22
VoutD
LED +
23
VoutC
LED +
24
AVdd
Arduino 5V
Exposed Paddle
AVss
GND
Below, I attached the unaltered Arduino sketch, library files, and datasheet for the DAC. Let me know if you need any other information or have any suggestions.
Hello mfsoler! I am glad that someone else is getting some use from this library.
I see some problems with your connections, as follows:
SYNC should be connected to pin 10 of the Uno as this is the Slave Select pin. If this is not connected then then chip will never be selected, thus the registers will never update
CLR needs to be connected to a pullup resistor. This means that you connect one side of a resistor to the CLR pin and connect the other side of the resistor to the +5V. I suggest a 4k7-ohm resistor, but you could probably also use a 10K resistor if you have this instead. If this CLR pin is tied to GND then the DACs will constantly clear and no voltage will be present.
[Somebody didn't read the important notes in the example sketch ;)]
As for your Refin. This DAC is a precision DAC, and as such, works best with a precision reference voltage. As the resistors in your divider heat up, the resistance will change, thus causing the DAC output voltage to change. I use a ADR421BRZ, also from Analog Devices, voltage reference in my shield and there is very little drift. If you do not need precision, then you can probably use a much cheaper DAC to get the results that you need.
Finally, while I haven't tried it--and I haven't looked at the datasheet in a while--I would suspect that the outputs of the DAC could not directly drive an LED. I would advise using some sort of buffer in this case.
Of all the people that could have responded, you're the best I could have hoped for. I made the changes you suggested, and everything works perfectly now. Thank you so much for the code and the help.