Building Blocks: 28-bit sine/triangle wave generator

A project log for A Versatile Labtool

A cost effective, multi-pronged data acquisition tool to turn your computer into a workbench for science and electronics experiments.

JithinJithin 08/01/2015 at 12:010 Comments

A waveform generator is a must for studying a variety of electronic phenomena such as resonant frequencies, filter characteristics, etc. , and the vLabtool includes a 28-bit DDS( 0.03 Hz resolution at 16MHz clock.) with manual amplitude control from +/-20mV to +/-4V.

The DDS(Direct Digital Synthesis) Approach to waveform generation involves a pre-programmed lookup table containing the amplitudes of the waveform to be generated. The processor then loops continuously through this table, and feeds each amplitude to a DAC, resulting in an analog waveform being generated at the output.

Initially, I ordered a couple these breakout boards for the AD9833 DDS. Once the communication protocols and usability were confirmed, it was added to the base board. The output of this breakout is 0.6v p2p (DC blocked with a capacitor).

Additional circuitry required to make a usable output.

Frequency control

This is the portion of the schematic that deals with the AD9833. The gain control slider is a 50K dial potentiometer.

Choosing an appropriate DC blocking capacitor is essential for achieving constant amplitude throughout the frequency range. I actually experienced this when I accidentally used 0.1uF instead of the 10uF. Since the vLabtool also has an oscilloscope, it was used to record the output for frequencies spanning the intended range. The output curves were fitted using Scipy, and the extracted amplitudes were plotted against the corresponding frequency.

Figure: ERRONEOUS frequency response curve of the DDS resulting from a misplaced capacitor! . Ignore the blue trace, it's not relevant here.

Replacing the 0.1u with the right value(10uF) gave an extremely flat amplitude response at 4V starting from 5Hz.

The SPI input of the AD9833 is very picky when it comes to modes. Both CKE, and CKP must be set to 1. Accidentally pushing values with wrong mode settings causes the IC to not respond until a hard reset. All this has been taken care of in the firmware. In case you're not familiar with CKE, CKP terminology, here's a map (taken from here).