AD9834 DDS Function Generator
(updated Jan. 29, 2010)

 Many years ago, I noted that my home made function generator build in 1984 around a XR2206 chip was obviously not well suited to my currently designed projects. I came to the conclusion that a new one, with better characteristics (frequency stability, signal purity...) was needed.
The AD9834, a low-power DDS chip, was selected to be the heart of such a generator.

1. Specifications

Frequency range : 0.01 Hz  to 4 MHz
Signal waveform : sinus, triangle, square
Output level : 0 to 20 Volts peak to peak (no load)
Offset level : - 10 to + 10 Volts (no load)
Build in switchable 20 dB attenuator
Output impedance : 50 ohms
Frequency display : backlighted LCD
Frequency resolution : 0.01 Hz to 1 Hz
2 frequencies can be stored and recalled
Frequency stability : around 50. 10 -6 (related to the main time base stability)

2. Block diagram

  Click inside the picture for a better resolution diagram.


 

3. Description

  The DDS as well as the interfaces (RS232, LCD, filters...) are controlled by a PIC 16F876 microcontroler. As the control register of the AD9834 has a 28 bit length, it is thus not possible to achieve a 10 -5 accuracy for the planned full-frequency range 0.01 Hz to 4 MHz : I decided to use a switchable DDS clock obtained by a 74LS390 divider and a 74LS151 multiplexer controlled by the PIC. The signals driving the LS390 and the PIC are derived from a 40 MHz crystal oscillator.
Three low pass Bessel filters controlled by the PIC do suitable filtering according to the selected DDS clock.
An output amplifier build around AD844 and LT1206 chips allows level and offset controls as well as a switchable 20 dB attenuation.
The frequency in use is defined by  a digital encoder and displayed on a classical LCD unit driven by the PIC.

The function generator can be controlled by a PC through the RS232 interface, thus allowing frequency sweep between low and high user-selected frequencies.

4. Results

  The pictures below present waveforms of the sine, triangle and square signals.
 
                       

 

A typical spectral plot of a sinusoidal signal is presented below (the spurious on the left are not due to the generator) :
 


 

Conclusion

  This generator fulfills the specifications I need as far as frequency stability and spectral purity are concerned. With some modifications of the Bessel low pass filters it could be used as a low-cost RF generator up to 10 MHz or more.

If you want to learn how to use the AD9834 chip have a look at my Web page devoted to this circuit.

Acknowledgments :
  I want to thank C. Bruand who developed the first version of the PIC program.
  The 2 wires interface between the 16F876 and the LCD was inspired by the work of Mike Predko .
 
 
 

 Home