Reading from AD9858 using SPI

Hi,
Using the AD9858 evaluation board, I am trying to read back the content of the FTW contained in the register (0x03) through the SDO pin 18 connected to pin 12 on the Arduino Nano. I can write and get the correct frequency equal to the FTW but haven't manage to do a read.

/*
   The circuit:
   * analog evaluation board AD9858 Rev(D)
   * External control pins of board attached to Arduino as follows:
   ** RESET ---------pin D6
   ** RDB (CS)-------pin D4
   ** WRB (SCLK)-----pin D13
   ** A0 (SDIO)------pin D11
   ** A1 (SDO)-------pin D12
   ** A2 (IORESET)---pin D2 
   ** FUD -----------pin D7
  */
   
  #include <SPI.h>
  const int RESET = 6;
  const int RDBcs = 4;
  const int WRBsclk = 13;
  const int A2ioreset = 2;
  const int FUD = 7;
  const int timer = 100;
  int iB = 0;
  const byte READ = 0x80;
  const byte WRITE = 0x00;
  char buffer[10];
  byte startPosition=0;
  
 //Output frequency
  byte byte1=0xf6; //LSB
  byte byte2=0x28;
  byte byte3=0x5c;
  byte byte4=0x0f;//MSB

  
  //---------Functions-----------
  void FUD_Toggle()
    {
        digitalWrite (FUD, HIGH);
        delay(timer); // Delay in millisecond
        digitalWrite (FUD, LOW);
    }
 
  void Reset_Com()
    {
        digitalWrite (A2ioreset, HIGH);
        delay(timer);
        digitalWrite (A2ioreset, LOW);
    }
  void Reset_DDS()
    {
        digitalWrite (RESET, HIGH);
        delay(timer);
        digitalWrite (RESET, LOW);
    }
  void setup()
    {
        // Open serial communications and wait for port to open
        SPI.begin();
        Serial.begin(9600);
        // Set pin 10 to output, even if not in use
        pinMode(10, OUTPUT);
        pinMode(RESET, OUTPUT);
        pinMode(FUD, OUTPUT);
        pinMode(A2ioreset,OUTPUT);
        digitalWrite (RDBcs, HIGH);
        Reset_DDS();
        Reset_Com();
        digitalWrite (RDBcs, LOW);
   
      }    
  
  //--------Main Program------------------------ 
  void loop()
    
           { 
        SPI.setDataMode(SPI_MODE0); //Rising edge - added as falling edge added later
        SPI.transfer (WRITE); //CFR Address
        delay(timer);
        FUD_Toggle();
        
         
        //CFR: 4 bytes
        // single mode 0x00 00 00 7A
        SPI.transfer (0x00);
        delay(timer);
        SPI.transfer (0x00);//CFR[23]=1 to enable auto clear accumulator
        delay(timer);
        SPI.transfer (0x00); //CFR[15]=1 sweep mode enabled
        delay(timer);
        SPI.transfer (0x7A); //0x7A with CFR[6]=1 or 0x3A with CFR[6]=0
        delay(timer);
        
        FUD_Toggle();
        
        //Frequency Tuning Word
        SPI.transfer (0x03); //FTW Address
        delay(timer);
         
        FUD_Toggle();
                         
        //FTW: 4 bytes
        SPI.transfer (byte4);
        delay(timer);
        SPI.transfer (byte3);
        delay(timer);
        SPI.transfer (byte2);
        delay(timer);
        SPI.transfer (byte1);
        delay(timer);
        FUD_Toggle();
    /* 
     //---------To Read section----------      
        //Read
        SPI.setDataMode(SPI_MODE2); // As read happens on the falling edge
        SPI.transfer (READ); //Controller to read
        delay(timer);
        FUD_Toggle();
        int bytes=Serial.available();
            *buffer +=startPosition;
  // parse buffer for your string/command
  delay(timer);
  Serial.readBytes(buffer, bytes);
  delay(timer);
  Serial.println(buffer);
    delay(timer); 

   
*/      
       }

This code generate 60MHz

Here is the datasheet of the AD9858: http://www.analog.com/static/imported-files/data_sheets/AD9858.pdf

Thanks

appreciated...me doing same as my final year project

How do you know that your "writes" are actually doing anything ?

The Output is connected to a spectrum analyzer showing the set frequency.

If you are trying to read the FTW from register 0x03, you need to transfer 0x83 as the read command and then do further SPI transfers to read each byte.

Not sure what the Serial.readBytes code is trying to do.

Also, not sure if it matters, but you have digitalWrite(RDBcs, ...) without setting pinMode(RDBcs, OUTPUT).