はっくはっくキッチン
Hack Hack Kitchen

AD9833 Controller using AVR

 2021/05/24

AD9833 (Programmable Waveform Generator)1 controller using AVR

AD9833 Controller board with USB interface converter
AD9833 Controller board with USB interface converter

Introduction

These are so many projects to use AD9833. This is one of such project. Compared to other projects, this is much smaller and much cheaper, because I used an AVR (instead of Arduino etc.). You control the AD9833 via a serial interface. This is both an advantage and a disadvantage. At least it is a great benefit for people like me—who want to do almost everything on a terminal. Of course I know: such people are in the minority ;-)

AD9833 Controller board
AD9833 Controller board

If you are looking for a standalone controller, see for example:

(and many other projects.)

Requirements

  • AD9833 board (see photo)

  • AVR with 4 KB or more flash.

  • USB-Serial board

Schematic

./ad9833ctrl-sch-thumb.png
Schematic of AD9833 Controller (click to enlarge)

Tested AVRs

  • ATtiny85

  • ATmega8

  • ATmega328P

How to compile

How to use

You can control AD9833 via a serial console. Try h or ? to see help messages (if you compiled the program with USE_HELP).

Basic commands

All commands are case insensitive.

[number]

frequency (in Hz). To specify a frequency, you can use the following notations:

  • 100

  • 10k

  • 1.5k

  • 1k5 (= 1.5k)

  • 2M

S

sine wave

T

triangle wave

Q

square wave

RESET

send reset to AD9833

H, ?

show help message

EEPROM (need to compile with USE_EEPROM)

SAVE

save current registers to EEPROM. AVR loads the saved values at reset (if saved data in EEPROM exists). In other words, once you save the registers, you don't need to connect the USB-serial board as long as you use the AD9833 at the frequency and waveform.

LOAD

load the saved values.

ERASE

erase the saved values.

Example

$ dterm /dev/ttyUSB0 4800
AD9833 CONTROLLER VERSION 1.0

h			# <--- help
Usage (case insensitive):
  [freq]: set frequency
    e.g.: 100 10k 1.5k 1k5 (= 1.5k) 2M
  S: sine wave
  T: triangle wave
  Q: square wave

  RESET: send reset to AD9833

  SAVE: save current registers
  LOAD: restore saved registers
  ERASE: erase saved registers

  H, ?: help
t			# <--- select a triangle wave
25k			# <--- set frequency (25 kHz)

Example: output of AD9833

Example: output of AD9833 (triangle wave, 25 kHz)