A microcontroller based DDS function generator using an AD9833

First what do we mean by DDS – DDS stands for direct digital synthesis. A DDS chip generates a waveform from an internal ROM with table. The ROM table could contain square, triangular, sawtooth or sine wave forms. A high frequency oscillator is used to drive a DDS chip – the high frequency clock is taken into a large internal divider that in turn would generate clock signals of less than 1Hz. The derived low frequency signal will be used to tell the on-chip digital to analog converter to go to the next value on the ROM table.

A DDS Function Generator

This particular project makes use of the AD9833 DDS sinewave generator from analog devices. A 50MHz clock was used to drive the AD9833 while an ATmega32 was used as the main controller that takes user input though a numeric keypad, displays the current output through a 16×2 liquid crystal display (LCD) and communicates with the AD9833 through 3 wire SPI. The challenge in building the project comes with the fact that high speed waveforms are difficult to amplify and easily gets infested with noise. An LM7171 was used to amplify the 400mV signal to +-15V, the design also includes proper placement of  components such as decoupling capacitors that needs to be very close to the integrated circuits.


[..Source link..]

About Philip

San Francisco, Agusan del Sur
CARAGA Region, Philippines

Bookmark the permalink.

One Comment

  1. Hi,

    i am able to generate frequency in sine,square and triangle waveforms using AD9833 chip and also able to sweep frequency .But problem arised during sweeping frequency with step of 0.001 Hz.i am using freqreg0.

    For Example:
    Formula i used :
    freq reg=(fout freq * 2^28)/25Mhz.

    fout freq freq reg hex val
    10.001 107.384919 6B
    10.002 107.395657 6B

    wave.MSB =(int)( 0x4000 | (int)((freq_reg & 0xFFFC000) >> 14)); //Only lower 14 bits are used for data
    wave.LSB =(int)( 0x4000 | (int)(freq_reg & 0x3FFF));

    GPIOB_OFF_BIT(12); //chip select bit is OFF
    AD9833_write((wave.LSB )); // Write lower 16 bits to AD9833 registers
    AD9833_write((wave.MSB )); // Write upper 16 bits to AD9833 registers.
    AD9833_write(0xC000); // Phase register
    AD9833_write(wave.waveform); // Exit & Reset to SINE, SQUARE or TRIANGLE

    By seeing example hope it understand .Problem is while freq reg value is converting to hex its considering only integer part but fraction part is ignoring.
    so in this case 0.001 hz step frequency is difficult.how do i send frequency with 0.001hz step fre

    so, i need solution to overcome with issue.please help me its urgent.

    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *