AnsweredAssumed Answered

Controlling AD9834 with Arduino Nano

Question asked by Jcowsky on Nov 28, 2017
Latest reply on Jan 2, 2018 by musach

I'm trying to control an AD9834 eval board with an Arduino Nano, but I can't seem to get any of the commands I try to give it to go through. I've got pin 10 (SS) connected to FSYNC, pin 11 (MOSI) connected to SDATA, and pin 13 (SCK) connected to SCLK. 

 

I've used the evaluation software to load values into the frequency register and I'm able to measure the output successfully using an oscilloscope. So far I'm just trying to apply a reset to get the board to turn off its output, and here's the code I'm using for that:

  Serial.begin(9600);
  const int SS = 10;
 
  pinMode(SS, OUTPUT);
  SPI.begin(); // SPI setup section:
  SPI.beginTransaction(SPISettings(100000, MSBFIRST, SPI_MODE0));

  digitalWrite(SS, LOW);
  Serial.println("SS LOW");
  //The control word is written in two bytes:
  SPI.transfer(0x21); // Byte 1: 0010 0001
  SPI.transfer(0x00); // Byte 2: 0000 0000
  Serial.println("First control word written");
  digitalWrite(SS, HIGH);

  SPI.endTransaction();

By my understanding, that should set the reset bit high and turn off the output, but nothing happens when I actually run the code. Can anyone figure out where I'm going wrong?

Outcomes