Projects · AD9850

AD9850

Updated Arduino sketch for bench testing an AD9850 DDS module - tune from 10 Hz to 30 MHz in 0.1 Hz steps with a rotary encoder, 16×2 LCD, and leading-zero suppression. Intended for lab use, not ham-radio VFO duty.

Full write-up (hardware, wiring, controls)

Overview

This project is an updated test program for the AD9850 direct digital synthesizer. It builds on work by m0xpd (original Arduino DDS examples). James changed the display formatting, added leading-zero suppression on the LCD, and extended tuning from 10 Hz to 30 MHz in 0.1 Hz steps.

Status: work in progress - usable on the bench, but not finished polish.

Hardware

ItemDetail
MCUArduino Uno (ATmega328)
DDSAD9850 module (125 MHz reference clock)
Display16×2 LCD (EONE-1602a1 wiring in sketch comments)
TuningRotary encoder + push button

AD9850 module wiring

Module pinArduino pinSignal
+5 V+5 VPower
GNDGNDGround
CLK (W_CLK)D8Word load clock
FQ (FQ_UD)D9Frequency update
DATAD10Serial data
RST (RESET)D11Reset

Rotary encoder

Encoder pinArduino pin
GNDGND
+5 V+5 V
SwitchA0 (active low to GND)
DTD2 (interrupt)
CLKD3 (interrupt)

16×2 LCD (4-bit mode)

LCD pinArduino pin
RSD12
ED13
D4D7
D5D6
D6D5
D7D4
VSS, R/W, LED KGND
VDD, LED A+5 V
V0 (contrast)Pot wiper / GND

LCD pins D0-D3 are not used (4-bit mode). D2 and D3 stay free for the encoder interrupts.

Controls

  • Rotate encoder - increase or decrease output frequency by the current step size.
  • Press encoder switch - cycle step size: 0.1 Hz, 1 Hz, 10 Hz, 100 Hz, 1 kHz, 10 kHz, 100 kHz, 1 MHz, 10 MHz (then back to 0.1 Hz). The active step is shown on row 2 of the LCD.
  • Frequency limits - firmware clamps tuning between 10 Hz and 30 MHz.

Row 1 shows the current frequency with leading zeros suppressed (e.g. 12,345,678.9 Hz instead of padding unused digit positions).

Software

Frequency words are computed per the AD9850 datasheet and sent LSB-first over the serial DATA line. The sketch assumes a 125 MHz module clock (124998900 in code allows slight tuning trim).

Build and upload

  1. Clone or download DDS-AD9850 from GitHub.
  2. Install the LiquidCrystal and Rotary libraries.
  3. Open the sketch file dds_ad9850 in the Arduino IDE (rename or place in a matching folder if your IDE requires a .ino extension).
  4. Select board Arduino Uno and upload.
  5. Wire the AD9850 module, encoder, and LCD as above; tune with the encoder and change step size with the switch.

GitHub Actions compiles this sketch on every push to master (compile check only; does not upload to the board).