Hello!
I am trying to program AD5686R Evaluation Board (EVAL-AD5686RSDZ) using arduino mega 2560. Does the SPI also needs to be in sports mode? How do i do that in arduino mega 2560? there are 4 SPI modes in arduino.
External V logic and external VDD connected to arduino 5V and AGND & DGND connected to GND of arduino
LDAC is set low(GND)
jumper setting LK1 -LK6
B, B, C, B, B, B respectively
1. does not reset when reset pin J5-7 pulled/pulsed low
2. DAC output cannot be controlled using SPI and stays at 1.25V or 2.5V for AD5686R & 0V for AD5686 on the board
3. reset pin voltage drop from 5V to 2.8V when connected to evaluation board
4. SYNC1 & SYNC2 voltage drop from 5V to 1.3V when connected to evaluation board
5. SPICLOCK & DATAIN voltages also drops to about 1V from 5V
6. When LK3 is at posistion D. The Vref of AD5686 is 5V at(TP2) but external reference is not connected
My codes are as follows;
#include <SPI.h> // necessary library
#define DATAOUT 51//MOSI
#define DATAIN 50//MISO
#define SPICLOCK 52//sck
#define SYNC1 53//ss
#define SYNC2 49//ss2
void setup()
{
pinMode(DATAOUT, OUTPUT);
pinMode(DATAIN, INPUT);
pinMode(SPICLOCK,OUTPUT);
pinMode(SYNC1,OUTPUT);
pinMode(SYNC2,OUTPUT);
digitalWrite(SYNC1,HIGH); //disable device
digitalWrite(SYNC2,HIGH); //disable device
SPI.begin(); // wake up the SPI bus.
SPI.setBitOrder(MSBFIRST); // sent MSB (most significant byte) first
SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(SPI_CLOCK_DIV4);
}
void loop()
{
digitalWrite(SYNC1, LOW);//select device
digitalWrite(SYNC2, LOW);//select device
SPI.transfer(48); // send value (0~255)
SPI.transfer(0); // DAC
SPI.transfer(0); //
digitalWrite(SYNC1, HIGH);//disable device
digitalWrite(SYNC2, HIGH);//disable device
delay(10000); // wait for 10second
}