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:
const int SS = 10;
SPI.begin(); // SPI setup section:
SPI.beginTransaction(SPISettings(100000, MSBFIRST, SPI_MODE0));
//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");
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?