Arduino Due / AD9959 / Arduino Due SPI sommunication problems

Arduino Due / AD9959 / Arduino Due SPI Communication problems

Hi,

I have a problem to write and read bytes to the registers of the AD9959. I use the Evaluation Board 'AD 9958 / 59 Evaluationboard Z’ and on the other side the Arduino Due. It seems there is no bits/byte’s written on the AD9959 or the reading is not possible!

I have studied the Manual al lot and all example in this Forum an on other places in the internet, but I don’t understand what is going wrong!
The Signals of CLK, CS/SS and SDIO_0, IO_Update are clear and fine, but i get no proper reaction from the AD9959 on the SDIO_2 line. And if I write the corresponding register values to get a sine signal on one output I also get no signal!
The jumpers on the Evaluation Board at set as follows:

W9 closed
W1, W2, W3, W10 open
PC_CTRL set to manual
RURD_0, RURD_1, RURD_2 open

Here some Data of my Setup:
Connections between Arduino Du and AD9959:
MISO (SPI-1) <<>> SDIO_2
SCK (SPI-3) <<>> SCLK
MOSI (SPI-4) <<>> SDIO_0
GND (SPI-6) <<>> GND
SPI CS2 (52) <<>> CS //Due to the fact that the Arduino pulls the signal on Out Pin 4 not completely to LOW

updatePin = 3 <<>> IO_Update
spiResetPin = 2 <<>> RESET
spiSyncIOPin = 5 <<>> SDIO_3
GND <<>> SDIO_1

Here my Code (the parts for SPI Communication:

#include <Wire.h>
#include <SPI.h>

// Pins for SPI
int CS = 52; //CSB
int updatePin = 3; //IO_Update
int spiResetPin = 2;
int spiSyncIOPin = 5;

void SPI_IO_Update()
{
//I/O Update
digitalWrite(updatePin, HIGH);

digitalWrite(spiSyncIOPin, LOW);
digitalWrite(spiSyncIOPin, HIGH);
digitalWrite(spiSyncIOPin, LOW);
digitalWrite(spiSyncIOPin, HIGH);

digitalWrite(updatePin, LOW);
}

void sendAD9959Setup()
{
byte byte1 = B10101010;
byte byte2 = B01010101;

// AD9959 Reset
digitalWrite(spiResetPin, HIGH);
delay(10);
digitalWrite(spiResetPin, LOW);
delay(10);

// Write- Read- Test
while(1)
{
//Write
digitalWrite(spiSyncIOPin, LOW);
SPI.transfer(CS, B00000000, SPI_CONTINUE); //ChannelAdresse (Instruction Write : 0x00 B00000000
SPI.transfer(CS, B01000010); //Schreiben Single-Bit Serial 3-Wire Mode ? aktvieren Channel 1
digitalWrite(spiSyncIOPin, HIGH);
SPI_IO_Update();

//Read
digitalWrite(spiSyncIOPin,LOW);
byte1 = SPI.transfer(CS, B10000000, SPI_CONTINUE); //ChannelAdresse (Instruction Read : 0x80 B10000000
byte2 = SPI.transfer(CS,0x00); //Next 8 Bit cycle to read
digitalWrite(spiSyncIOPin,HIGH);

Serial.println();
Serial.println(byte1,BIN);
Serial.println(byte2,BIN);
Serial.println();

delay(1000);
}
}

void setup() {
// SPI
pinMode(spiSyncIOPin, OUTPUT);
pinMode(spiResetPin, OUTPUT);
pinMode(updatePin, OUTPUT);
pinMode(CS, OUTPUT);
digitalWrite(spiSyncIOPin, HIGH);
digitalWrite(spiResetPin, LOW);
digitalWrite(updatePin, LOW);
digitalWrite(CS, HIGH);

SPI.begin(CS);
//SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
SPI.setDataMode(CS, SPI_MODE0);
SPI.setBitOrder(CS, MSBFIRST);
SPI.setClockDivider(CS, 160); //Divider is set to 80 to get 1MHz transfer clocck

sendAD9959Setup();
}

Is there somebody out there who could help me?
I say thank you in advance
SILASNT

I' sorry, I have postet this topic by mistake two times. Please Admin delete ist one times Thanks

These 2 topics should help you out:

https://ez.analog.com/dds/f/q-a/28032/ad9959-freq-sweep-with-arduino-due

Edit: http://perso.utinam.cnrs.fr/~emeyer/CAN/doku.php?id=en:example_of_development_around_the_ad9959_dds

Hi ard_newbie,
thanks for your advice.
I have studied and tried out the informations of the first link before, but with no success!
The second link ist broken, I’m sorry!

Hi,
now I have found the informations of the second link. I have seen this site before. There are some common informations about the DDS library. Due to the fact, that there are some failures in the DDS.cpp (I could’t compile my Arduino code), I want to work without this library.
But thanks anyway
silasnt

Hello, I am working with the similarAD9958. I can't read or write either. I saw your other thread at https://forum.arduino.cc/index.php?topic=713400.new#new I posted some notes there. Did you make any progress? Frank

Hello, I managed to write and see the effects at the sine wave outputs. My problem was that I did not deal with the SyncIO. I left it to logic low for my whole code. You change the level to it, so that is one difference between you and me.

I did this programming on my own custom board with the AD9958 mounted on it. I also have a AD9958 eval board but did not attach the Arduino to it. The oscillator at AD9958 pins 22 and 23 must be operational. If that is not the case, the SPI writes will not do anything. You should check pin 54 for a clock of 1/4 of the system clock that is produced by the AD9958.

I wrote to 4 channels one at a time in CSR register 0 because that is what the eval board does. The AD9958 is only equipped with two (bit 7 and bit 6 on the CSR).

I used SPI bitbanged in software as MODE3. I ran the SPI in the 100kHz rate.

Be sure that you disconnect the appropriate power to be sure that the Cypress chip is not driving anything. There was a person on the Analog Devices forum that was struggling and after made it work after doing that.

I did not get the read to work yet. Frank