AD9850 Module and Arduinoesque Library

AD9850 DDS Module

I'm a little late to the party, but I recently purchased a handful of the AD9850 Direct Digital Synthesis chip modules that are now readily available from various sources on the Internet. The modules as supplied will generate a signal up to 40MHz with either serial or parallel data control. Coupled with a microcontroller they make the basis of a number of amateur radio projects and my first project will be to use one as the local oscillator for an HF direct conversion receiver.

Software

I've never used an Arduino, but I am a fan of the Teensy3. The Teensy3 has an Arduino-like development tool chain. Ron NR8O published an Arduino sketch that I've taken and refactored into the form of an Arduino library. It works for the Teensy3 and will probably work for Arduino too, but I've not tested it. You can obtain it here: AD9850.zip. The library allows you to drive an arbitrary number of AD9850 modules in serial mode from a single microcontroller, limited only by the number of digital i/o pins you have available.

Install the library just like any other Arduino library. To use the library you include the AD9850.h header file, create an AD9850 object and call its setFrequency method.

Circuit

The AD9850 module requires only seven pins to get it working in serial mode. All of the other pins can be left unconnected. The pins used are listed in the following table:

Example: Sweep Generator

The following code is include as an example in the library. It generates a frequency sweeping oscillator that ranges from 10.000 MHz to 10.001 MHz in 10Hz steps at a rate of about 10 times per second.

There are really only three critical lines here, marked in yellow. 

#include <AD9850.h>

// Define the AD9850 pins

// These are the only pins, other than VCC and GND that need to be connected

// get the module working.

//

// Change to whatever pins you are using.

#define DS_PIN_WCLK     1

#define DS_PIN_DATA     2

#define DS_PIN_FQUD     3

#define DS_PIN_RESET    4


// Define our frequency ranges in Hz

#define DDS_LOW_FREQ    10000000

#define DDS_HIGH_FREQ   10001000

double frequency;


// Create an AD9850

AD9850 dds(DS_PIN_WCLK, DS_PIN_DATA, DS_PIN_FQUD, DS_PIN_RESET);

void setup(void)

{

        // Set DDS1 frequency

        frequency = DDS_LOW_FREQ;

        dds.setFrequency(frequency);

}


// Loop the sweep

void loop(void)

{

        frequency = frequency + 10;

        if (frequency >= DDS_HIGH_FREQ)

                frequency = DDS_LOW_FREQ;

        dds.setFrequency(frequency);

        delay(1);

}