AD9833 Waveform Generator FeatherWing

A frequency-precise sine/square/triangle waveform generator on a FeatherWing-compatible board.

Similar projects worth following
The AD9833 Waveform Generator FeatherWing is an Adafruit Feather-compatible module. The Waveform Generator produces an op-amp buffered sine, triangle, or square wave output with a practical frequency range of approximately 0 to 300KHz with 0.1Hz resolution.
Frequency accuracy and stability is determined by the on-board 25MHz +/- 100ppm crystal oscillator. Output signal peak-to-peak amplitude is adjustable with a maximum unipolar output of slightly less than 3.3 volts.
Waveform Generator control is via the Feather SPI bus and a custom CircuitPython AD9833 driver. The wing derives its power from the host Feather's 3.3V power.

GitHub repository with schematics, PCB design, CircuitPython driver, and example CircuitPython code: AD9833 Feather Wing repo

OSH Park project: OSH Park PCB Project

View all 15 components

  • Objective, Build, Test, Next Steps

    Cedar11/03/2019 at 01:40 0 comments

    The initial objective was to be able to create arbitrary waveforms for music synthesis using a microcontroller. I experimented with interrupt-driven Arduino code on various vendor boards, created some useable waveforms, but wasn't completely satisfied. With most boards tried, it was difficult to create a waveform precise enough in quality (sample resolution) and frequency accuracy/stability due to limitations in the MCU speed/architecture and my programming skills. 

    It became apparent that a more hardware-centric approach using some sort of off-board waveform generator or co-processor might be the ticket. If the waveform generation was off-loaded to a separate module, it should be easier to abstract the synth control software using CircuitPython, which would be more compatible with my software development skills.

    I found a family of Analog Devices' direct digital synthesis (DDS) programmable waveform generator chips that looked pretty promising. The AD9102 with its internal waveform pattern memory was almost perfect, but more complex than I was ready to attack at that time given my inexperience with device drivers and supporting code. I settled on the AD9833 chip with its simpler hard-coded sine, square, and triangle waveforms as a place to start.

    The AD9833 FeatherWing

    This is the first version of the AD9833 board and accompanying CircuitPython driver code. Coupled with a Feather M4 Express board, the first successful test was to sweep a sine waveform from 20Hz to 20KHz. (A waveform generator that could do that would be very useful in the field for testing room acoustics. Hmmm. Can't stop there, however.) By attaching a MIDI interface FeatherWing, the system was able to listen for a MIDI note on/off message and output a waveform of the correct frequency and duration.  Adding portamento functionality gave it an almost Theremin-like sound. Another test was to evaluate its response to Eurorack Control Voltage/Gate (CV/Gate) signals using an analog and a digital input on the Feather M4. It worked nicely.

    Adding some ADSR

    The on/off nature of the resultant tone was accurate in terms of note frequency, but didn't sound very musical. Adding an external AD5245 digital potentiometer to control the waveform's amplitude created a more musical-sounding note. The digital potentiometer was controlled by the code to adjust the note envelope's attack, decay, sustain, and release (ADSR) stages.

    Adding the Digital Potentiometer for ADSR Control
    The ADSR Envelope of the Note Waveform

    Next Steps

    The next version of the board (currently being assembled) will incorporate the digital potentiometer on the FeatherWing rather than on an external breakout board. With the coding experience gained with the AD9833, I hope to eventually build an AD9102 Arbitrary Waveform Generator FeatherWing for more complex, programmable musical voices.

    Meanwhile, the AD9833 Waveform Generator FeatherWing will be incorporated into two projects, 1) Eurorack-compatible CV+MIDI VCO module and 2) a programmable signal/sweep generator for the workbench or in the field. I've always needed one of those.

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates