Home | Projects | Posts | Reading List | About

Controlling the AD9834 DDS with the Zynq-SoC EBAZ4205 using ARTIQ

In this post, I’ll introduce you to my project where I used the EBAZ4205 Zynq-SoC board to control an AD9834 DDS module by ZonRi Technology Co., Ltd. The AD9834 is a versatile, low-power Direct Digital Synthesis (DDS) chip capable of generating a variety of waveforms, including sine, triangular, and square waves. Additionally, the AD9834 supports both phase and frequency modulation (FM), making it a powerful tool for waveform generation and signal processing.

By leveraging ARTIQ (Advanced Real-Time Infrastructure for Quantum physics), a cutting-edge control and data acquisition system designed for quantum experiments, we can precisely manage the AD9834’s waveform output and modulation capabilities.

I’ve contributed to the ARTIQ and ARTIQ-Zynq repositories by adding support for the EBAZ4205. Originally part of the Ebit E9+ BTC miner, the EBAZ4205 Zynq-SoC board is a low-cost development board (typically around \$20-\$30 USD), making it an ideal option for ARTIQ-based projects. The AD9834 module from ZonRi Technology is also highly affordable, often available for under $10 USD, making this combination a cost-effective solution for waveform generation and modulation experiments.

I also added the core device driver for the AD9834 to ARTIQ, which allows for seamless control of the DDS board. Below, I’ll guide you through the hardware setup, share example waveforms generated by the AD9834, and demonstrate how phase modulation can be achieved with this configuration. While I won’t be showcasing frequency modulation in this post, the AD9834’s ability to perform FM adds further flexibility to its functionality.

For more details on how to use ARTIQ to create your own waveforms with this board, refer to the ARTIQ manual.

Quick Build Guide

Build SZL Bootloader

$ git clone https://git.m-labs.hk/M-Labs/zynq-rs

$ cd zynq-rs

$ nix develop

If you don’t have nix see ARTIQ manual - nix development environment.

$ cargo xbuild --release -p szl --no-default-features --features=target_ebaz4205

This will create a target directoy and szl file will be located at ./target/armv7-none-eabihf/release/szl

Build Gateware and Firmware

Open a separate terminal from the one above and:

$ git clone https://git.m-labs.hk/M-Labs/artiq-zynq

$ cd artiq-zynq

$ nix develop

$ cd src

Build gateware:

$ python3 ./gateware/ebaz4205.py -g ../build/gateware

This will create ../build/gateware/top.bit

Build firmware:

$ make TARGET="ebaz4205" GWARGS="" runtime

This will create ../build/firmware/armv7-none-eabihf/release/runtime

Build BOOT.BIn

Now that you have the bootloader, gateware, and firmware built, you can create your BOOT.BIN file as mentioned in the README.md of:

https://git.m-labs.hk/M-Labs/artiq-zynq

e.g.

echo "the_ROM_image:
    {
        [bootloader]result/szl.elf
        gateware/top.bit
        firmware/armv7-none-eabihf/release/<runtime/satman>
    }
    EOF" >> boot.bif
mkbootimage boot.bif boot.bin

Note that if [bootloader]result/szl.elf causes issues, you can use the szl file mentioned above (just make sure the names and paths match in the boot.bif file).

EBAZ4205 Booting from SD Card

Now that BOOT.BIN or boot.bin is built from the section above, save it to the SD card you are using with your EBAZ4205 and go ahead and power on the board and open a serial console of your choice (I use tio) to watch the boot process:

$ tio --map ICRNL,INLCRNL /dev/ttyUSB1

replace /dev/ttyUSB1 with what your system gives you.

The UART pins on the EBAZ4205 are located on pin header J7.

Here’s a screenshot of the console output when the EBAZ4205 boots up its firmware from the SD card. This demonstrates the successful initialization of the board and loading of the ARTIQ framework:

BootUp

AD9834 Module Pinout and Connections

Here’s a photo of my setup on the electronics bench. You’ll see the EBAZ4205 Zynq-SoC board connected to the AD9834 module and the power supplies I used to drive them.

DSC03050

The EBAZ4205 is powered from 5V - 12V, with GND and VCC of the power supply connected to pins DATA1-1 and DATA1-3 of the EBAZ4205, respectively.

Here’s a photo of the bottom of the AD9834 module, showing the header pinout for easy reference:

BottomOfBoard

Below is a table that outlines how I connected the AD9834 module to the EBAZ4205 Zynq-SoC board:

Pin on AD9834 Module AD9834 DATASHEET Connection on EBAZ4205
SCLK SCLK CLK: DATA3-19 (Pin V20)
DATA SDATA MOSI: DATA3-17 (Pin U20)
SYNC FSYNC CS_N: DATA3-15 (Pin P19)
FSE (Tied to GND) FSELECT N/A: Bit Controlled
PSE (Tied to GND) PSELECT N/A: Bit Controlled
GND Ground GND: J8-1, J8-3
VIN AVDD/DVDD 3.3V: J8-2
RESET (Unused) RESET N/A: Bit Controlled

NOTE: Both VIN Pins and both GND Pins of the AD9834 Module are tied together.

DSC03048

DSC03049

DSC03053

Waveforms Generated by the AD9834

The AD9834 is capable of generating a range of waveforms. Below are examples of the sine, triangular, and square waves that I captured during my experiments:

Sine Wave

Here’s a screenshot of the sine wave generated by the DDS:

SDS1202X-E3

Triangular Wave

This triangular wave is also produced by the AD9834:

SDS1202X-E5

Square Wave

The square wave output shows how the AD9834 can handle different waveform outputs.

SDS1202X-E6

Frequency and Phase Modulation Capability

Frequency and Phase modulation allows you to change the frequency and phase of a signal relative to another. Below is an example of phase modulation where I switch between quadrature waves (90 degrees phase difference) of the same frequency, switching at a rate of 10 µs:

SDS1202X-E1

Conclusion

By integrating the EBAZ4205 Zynq-SoC board with the AD9834 module through ARTIQ, I’ve been able to generate precise waveforms and experiment with phase modulation. The combination of the low-cost Zynq board and the flexibility of ARTIQ provides a powerful platform for waveform generation and signal processing.