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
| Item | Detail |
|---|---|
| MCU | Arduino Uno (ATmega328) |
| DDS | AD9850 module (125 MHz reference clock) |
| Display | 16×2 LCD (EONE-1602a1 wiring in sketch comments) |
| Tuning | Rotary encoder + push button |
AD9850 module wiring
| Module pin | Arduino pin | Signal |
|---|---|---|
| +5 V | +5 V | Power |
| GND | GND | Ground |
| CLK (W_CLK) | D8 | Word load clock |
| FQ (FQ_UD) | D9 | Frequency update |
| DATA | D10 | Serial data |
| RST (RESET) | D11 | Reset |
Rotary encoder
| Encoder pin | Arduino pin |
|---|---|
| GND | GND |
| +5 V | +5 V |
| Switch | A0 (active low to GND) |
| DT | D2 (interrupt) |
| CLK | D3 (interrupt) |
16×2 LCD (4-bit mode)
| LCD pin | Arduino pin |
|---|---|
| RS | D12 |
| E | D13 |
| D4 | D7 |
| D5 | D6 |
| D6 | D5 |
| D7 | D4 |
| VSS, R/W, LED K | GND |
| 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
- LiquidCrystal (Arduino IDE library manager)
- Rotary by buxtronix (encoder on interrupt pins)
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
- Clone or download DDS-AD9850 from GitHub.
- Install the LiquidCrystal and Rotary libraries.
- Open the sketch file
dds_ad9850in the Arduino IDE (rename or place in a matching folder if your IDE requires a.inoextension). - Select board Arduino Uno and upload.
- 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).