interfacing AD5752 with Arduino

For the discussion of Arduino related topics.

Moderator: phalanx

Post Reply
saadabd
Posts: 2
Joined: Tue Dec 26, 2017 2:17 pm

interfacing AD5752 with Arduino

Post by saadabd » Wed Dec 27, 2017 2:08 am

Hello Everyone, I am new in programming and i have to implement one project in which i am suppose to use a bi-polar DAC to generate +- 0 -> 5V triangular wave output at the frequency of 50mHz (milihertz). I tried going through the datasheet of DAC but i am not very confident in writing the code for. can anyone please help or share some sample code.

paulvha
Posts: 197
Joined: Sat Nov 11, 2017 2:39 am

Re: interfacing AD5752 with Arduino

Post by paulvha » Thu Dec 28, 2017 4:55 am

you could start with github https://github.com/kasskas/AD5752_lib

saadabd
Posts: 2
Joined: Tue Dec 26, 2017 2:17 pm

Re: interfacing AD5752 with Arduino

Post by saadabd » Sat Dec 30, 2017 2:24 pm

Thanks for your help, as i mentioned i am new in interfacing hardware.

I tried implementing this library with following configurations,

#include <AD5752.h>
#include<SPI.h>
//char slave_pin_DAC = 9; //it is already declared in .cpp file as pin 9
void setup() {
init_DAC(DAC_A, pn5V);
}

void loop() {
set_DAC_value(0XFF, 0xFF); //+5v
delay(1000);
set_DAC_value(0X00, 0x00); //-5v
delay(1000);
}

and i made the following pin configurations for mega
2scomp = gnd
sync = 9
sclk = sck
sdin = MOSI
Ddout = MISO
Ldac = gnd
Clr = gnd

DAC still not working, i looked at the data sheet but unable to use set_DAC_value( , ); command, i am hoping to see +5 -5v output.

paulvha
Posts: 197
Joined: Sat Nov 11, 2017 2:39 am

Re: interfacing AD5752 with Arduino

Post by paulvha » Sun Dec 31, 2017 10:02 am

Need to understand a bit more about your connections. Vdd, Rfin, AVdd etc. Is Ddout is SDO.

I have not studied the datasheet & code enough but one thing jumped out: You have CLR connected to ground. According to the datasheet : The outputs cannot be updated with a new value while the CLR pin is low. A clear operation can also be performed via the clear command in the control register. can you check that ?

paulvha
Posts: 197
Joined: Sat Nov 11, 2017 2:39 am

Re: interfacing AD5752 with Arduino

Post by paulvha » Tue Jan 02, 2018 11:22 am

As I find this an interesting project, I have created a library to connect an AD5752 / AD5732 or AD5722 to an Arduino based on the data-sheet from scratch. The library has not been tested as I do not have an AD57xx. I have ordered one AD5722 for testing that should arrive later this week.. but it might help you already. I have posted the first on https://github.com/paulvha/AD57xx. A zip file version has been added there as well (the installation of the has not been tested either yet )

lyndon
Support Volunteer
Posts: 1562
Joined: Thu Jul 17, 2008 6:37 pm
Location: Minnesota, USA

Re: interfacing AD5752 with Arduino

Post by lyndon » Tue Jan 02, 2018 12:04 pm

Unless there is something particularly special about the AD5722, I'd suggest using a DAC that already has Arduino libraries and using an op-amp subtractor on the output to get the +/- signals. You'll need the op amp anyway, for just about any bipolar DAC.

This is pretty easy to use: https://www.sparkfun.com/products/12918

Post Reply