Post Go back to editing

AD9914 External SPI Control – Write Works but Readback Issue

Category: Software
Product Number: AD9914
Software Version: Vitis 2023.2

Hello ADI Team,

I am trying to control an AD9914 Evaluation Board (EVAL-AD9914) externally using a ZCU102 FPGA board (Zynq UltraScale+ ZU9EG).

My objective is initially to verify basic SPI register read/write communication from the ZCU102 before proceeding with DDS frequency/waveform configuration.

Hardware setup

  • AD9914 Evaluation Board: EVAL-AD9914

  • External SPI controller: ZCU102 / Zynq UltraScale+ ZU9EG

  • SPI controller in FPGA: AXI Quad SPI

  • Software: Vitis

  • SPI driver: XSpi

  • External signals connected:

    • CSB

    • SCLK

    • SDIO

    • I/O_UPDATE

    • RESET

    • SYNCIO as required

  • The USB control path on the evaluation board has been disabled for external control according to the evaluation-board guidance.

  • The AD9914 function pins are configured for serial programming: F0 = HIGH, F1 = F2 = F3 = LOW.

The AD9914 datasheet indicates that the serial interface can operate either as a bidirectional single SDIO interface or using separate SDIO and SDO signals. I am currently trying to understand the correct readback behavior for my external-control setup.

Write test

I am able to perform an SPI write transaction from the ZCU102.

For example, I am writing CFR1 (address 0x00) with:

u8 TxBuffer[5] = {
    0x00,    // Instruction/address
    0x00,
    0x01,
    0x00,
    0x0A
};

u8 RxBuffer[5] = {0};

Status = XSpi_Transfer(&SpiInstance,
                       TxBuffer,
                       RxBuffer,
                       5);

This sends:

0x0001000A

to CFR1.

I can observe the expected CSB, SCLK and SDIO activity on the oscilloscope/logic analyzer.

Read test

I am then trying to read back CFR1.

My understanding is that the read operation should consist of:

  1. CSB LOW

  2. Send the read instruction/address

  3. Complete the instruction phase

  4. Release the bidirectional SDIO line from the FPGA

  5. Generate the required additional SCLK cycles

  6. AD9914 drives the register data on SDIO

  7. FPGA samples the returned 32-bit data

  8. CSB HIGH

The part I am currently having difficulty with is the SDIO direction change during the read transaction.

I am using the Xilinx/AMD XSpi_Transfer() API, which performs a full-duplex SPI transfer. I am not sure whether the AXI Quad SPI + XSpi_Transfer() configuration I am using can correctly perform the required SDIO turnaround/high-impedance period for the AD9914 2-wire read operation.

Questions

  1. For external control of the EVAL-AD9914, what is the recommended procedure for performing a register read using the bidirectional SDIO/2-wire SPI interface?

  2. After sending the read instruction/address, exactly when should the external controller release SDIO and allow the AD9914 to drive the line?

  3. Is there any required turnaround clock or delay between the instruction phase and the 32-bit read-data phase?

  4. Can the AXI Quad SPI + Xilinx XSpi_Transfer() driver be used directly for the AD9914 2-wire read operation, or does the SDIO direction need to be controlled separately?

  5. If using the 3-wire configuration (SDIO input + SDO output), what is the recommended register/configuration sequence to switch the AD9914 from the default bidirectional SDIO configuration to separate SDIO/SDO operation?

  6. Is there any additional requirement involving SYNCIO/ResetSPI that must be performed before the first external SPI transaction after power-up/reset?

  7. For basic register read/write verification, is a valid REF_CLK required, or can the serial register interface be tested without the DDS reference clock?

My immediate goal is only to verify reliable SPI register read/write communication with the AD9914 evaluation board. Once this is working, I will proceed with REF_CLK/PLL configuration and DDS waveform generation.

Any guidance on the correct external SPI read sequence and the expected SDIO/SDO waveform would be greatly appreciated.

Thank you.

  • Hi  ada533 ,

    Let me answer your questions below:

    1. In 2 wire mode, SDIO is bidirectional and SDO is high impedance. Data is always written on SDIO, but for a readback operation the AD9914 drives SDIO during the readback phase and tri-states it otherwise. 

    2‑wire SDIO register read sequence. Assuming default 2‑wire mode (CFR1 bit 1 = 0):

    1. Idle/setup
      • CSB high (inactive).
      • SCLK at its idle level per your SPI mode.
      • SDIO configured as output from your controller.
    2. Instruction phase
      • Drive CSB low.
      • Clock out the 8‑bit instruction/address byte on SDIO with SCLK:
        • MSB‑first by default (CFR1 bit 0 = 0). 
        • Instruction encodes a READ of the target register.
    3. Turnaround at end of instruction
      • After the last instruction bit is clocked.
        • Keep CSB low.
        • Immediately reconfigure SDIO as input/high‑Z (stop driving it)
      • The datasheet notes that any SCLK stall between instruction and data phases is not required; you can proceed directly to data clocks. 
    4. Data phase (32‑bit readback for CFR1)
      • Continue generating SCLK edges within the specified read‑cycle frequency limit. 
      • The AD9914 now drives SDIO with the register contents during the read operation; otherwise SDIO is tri‑state. 
      • Sample SDIO on the appropriate edge per your SPI mode for 32 bits of data.
    5. End of transaction
      • After all data bits are received, deassert CSB high.
      • SDIO returns to tri‑state once CSB is high.

    2. Release SDIO after the falling/rising edge (per your SPI mode) that clocks out the last instruction/address bit and before the next clock edge used for data readback. The controller must not continue driving SDIO once the instruction phase is complete.

    3. No. The AD9914 does not require any extra turnaround clock and delay between the instruction phase and the 32-bit read data phase. The datasheet explicitly states that the SCLK stall shown between the instruction byte and data transfer in the timing diagrams is not required. You can begin clocking the data phase immediately on the next SCLK edges after the instruction byte, with SDIO released to input (2-wire) or data appearing on SDO (3-wire).

    4. I am not knowledgeable how AXI Quad SPI + Xilinx XSpi_Transfer() works or have never used it anyway. I cannot share anything with regards to the mentioned component. 

    5. For the AD9914, the device powers up in the default 2-wire (bidirectional SDIO) serial mode. To move to 3-wire mode (separate SDIO input and SDO output), the usual approach is:

    1. Communicate initially using the default 2-wire SDIO interface.
    2. Write CFR1 and set the SDO active bit (CFR1[1] = 1).
    3. Pulse IO_UPDATE so the new CFR1 value becomes active.
    4. After the update, use:
      • SDIO (Pin 20) as input-only to the AD9914.
      • SDO (Pin 19) as the dedicated readback output.

    6. No, neither SYNCIO nor a special ResetSPI operation is normally required before the first external SPI transaction. A hardware RESET after power-up, a valid reference clock, and proper serial-mode pin configuration are the key requirements.

    7. Yes, a valid REF_CLK is required, 

    All the best,

    Jules

  • My aim: 2 wire mode should be changed to 3 wire mode so that i could use separate data lines for writing and reading data. 

    Q1: I have given Ref Clk of 500 MHz with input power of 0 dBm from Signal Generator but how to check whether SYNC CLK is produced or not?

    Q2: And i have connected the SYNC_IO-Buf Pin to GND pin(P101A header) present in AD9914 Eval board. Is this correct or i should toggle it? 

    Q3:Currently i am doing Toggling of Master reset,then doing write data,then toggling IO Update Pin and then Read data,is this correct or not?

    Q4: are there any additional jumper settings or default data in the any register to be changed or checked for the SPI write/Read to work?

    Regards.

    ada533

  • Hi  ,

    1. You can check J100 if you're seeing signals in SYNC_CLK. There's also a bit that you can enable/disable on CFR2[11].

    2. SYNC_IO tied to GND: Acceptable. SYNC_IO is an optional synchronous-reset for the serial port state machine; it's active-high and only needed to recover from a desynchronized SPI frame. Holding it low permanently is fine. If you ever lose sync, pulse it high (≥1 SYNC_CLK cycle) rather than leaving it floating.

    3. Sequence: Correct, with two additions:

    • Master Reset: pulse high then low, and wait ≥ a few SYNC_CLK cycles before the first SPI access
    •  A read does not require IO_UPDATE — IO_UPDATE only transfers the serial-port buffer into the active internal registers. Reads come from the buffer, so read-back verifies the write even before IO_UPDATE. So: MRESET → write → read back (verify SPI) → IO_UPDATE (apply).
    • Make sure CS is deasserted between each instruction/data frame; the frame is instruction byte (bit7 = R/W, bits[6:0] = address) followed by the data bytes, MSB-first, on SDIO sampled on rising SCLK.

    4. Jumpers / register defaults to check:
    • Set the board to external/serial control, not the on-board USB controller — if the EVB's microcontroller is driving SCLK/SDIO/CS, it will contend with your host. Remove/disable those jumpers (or don't power the USB interface).

    All the best,

    Jules

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.