Arduino Forum

Products => Arduino Due => Topic started by: LargeDogs on Aug 11, 2017, 06:46 pm

Title: Connecting an quad 12-bit DAC (AD5024) to an Arduino
Post by: LargeDogs on Aug 11, 2017, 06:46 pm
Hello forum!

I need to connect an AD5024 to an Arduino Due. Spec sheet here:Link (https://goo.gl/cZGZ6g)

I know the Due has a DAC already but I need a 4 channel one.

This is my first time connecting and using an external DAC on the board.

The connections look like so: Link (https://ez.analog.com/servlet/JiveServlet/showImage/2-90267-13684/DAC.jpg)

I have written a basic setup function, but am not sure where to go from here to transmit voltage signals so that I may see its output on an oscilloscope.

All three outputs (DIN, SCLK, SYNC) are connected to PWM pins on the DUE.

Code: [Select]

//arduino output pins
#define DIN  2
#define SCLK 3
#define SYNC 4

void setup(){
  pinMode(DIN, OUTPUT);
  pinMode(SCLK,OUTPUT);
  pinMode(SYNC,OUTPUT);

  digitalWrite(DIN,LOW);
  digitalWrite(SCLK,LOW);
  digitalWrite(SYNC,LOW);
}


If anyone could tell me where to start, it'd be much appreciated.
Title: Re: Connecting an quad 12-bit DAC (AD5024) to an Arduino
Post by: MorganS on Aug 12, 2017, 01:07 pm
What is the purpose of the DAC? Music? Analog control? Then start writing your program to output those sorts of signals and test for those signals.
Title: Re: Connecting an quad 12-bit DAC (AD5024) to an Arduino
Post by: Microzod_ on Aug 13, 2017, 01:25 am
That DAC requires you to use a SPI bus to talk to it, I assume you are using an Arduino Due since this is the Due part of the site. On the Due the SPI bus is accessed through the separate 6-pin connector towards the back of the board. You need to check out the pin layout map found as a sticky thread in the beginning of this forum to see which pin is which.

When you have connected the DAC to the correct pins on the SPI connector you then need to learn how to use the SPI library provided by Arduino, which is very simple and it consists of calling a SPI.begin() function and then SPI.read()/SPI.write() functions.

If I am not mistaken there are also software SPI that can be implemented on any pins you like.
Title: Re: Connecting an quad 12-bit DAC (AD5024) to an Arduino
Post by: ard_newbie on Aug 13, 2017, 07:27 am
Hi,

Google DUE DAC SPI and you will find a .pdf file from chianorobotics which might interest you to connect your external DAC.