The AD9833 is a low power, programmable waveform generator capable of producing sine, triangular, and square wave outputs. Waveform generation is required in various types of sensing, actuation, and time domain reflectometry (TDR) applications. The output frequency and phase are software programmable, allowing easy tuning. No external components are needed. The frequency registers are 28 bits; with a 25 MHz clock rate, resolution of 0.1 Hz can be achieved. Similarly, with a 1 MHz clock rate, the AD9833 can be tuned to 0.004 Hz resolution.
The goal of this project (Microcontroller No-OS) is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. Here you can find a generic driver which can be used as a base for any microcontroller platform and also specific drivers for Renesas platforms.
The driver contains two parts:
The Communication Driver has a standard interface, so the AD9833 driver can be used exactly as it is provided. There are three functions which are called by the AD9833 driver:
The implementation of these three functions depends on the used microcontroller.
The following functions are implemented in this version of AD7792 driver:
|unsigned char AD9833_Init(void)||Initializes the SPI communication peripheral and resets the part.|
|void AD9833_Reset(void)||Sets the Reset bit of the AD9833.|
|void AD9833_ClearReset(void)||Clears the Reset bit of the AD9833.|
|void AD9833_SetRegisterValue(unsigned short regValue)||Writes the value to a register.|
|void AD9833_SetFrequency(unsigned short reg, unsigned long val)||Writes to the frequency registers.|
|void AD9833_SetPhase(unsigned short reg, unsigned short val)||Writes to the phase registers.|
|void AD9833_Setup(unsigned short freq, unsigned short phase, unsigned short type)||Selects the Frequency,Phase and Waveform type.|
This section contains a description of the steps required to run the AD9833 demonstration project on a Renesas RX62N platform.
An EVAL-AD9833SDZ board has to be interfaced with the Renesas Demonstration Kit (RDK) for RX62N:
EVAL-AD9833SDZ test point SDATA → YRDKRX62N J8 connector Pin 19 EVAL-AD9833SDZ test point SCLK → YRDKRX62N J8 connector Pin 20 EVAL-AD9833SDZ test point FSYNC → YRDKRX62N J8 connector Pin 15 EVAL-AD9833SDZ J4 connector Pin AVDD → YRDKRX62N J8 connector Pin 3 EVAL-AD9833SDZ J3 connector Pin DVDD → YRDKRX62N J8 connector Pin 3 EVAL-AD9833SDZ J4 connector Pin AGND → YRDKRX62N J8 connector Pin 4 EVAL-AD9833SDZ J3 connector Pin DGND → YRDKRX62N J8 connector Pin 4
The demo program sets up the AD9833 part to output sinusoidal, triangle and square waves. The frequency and the type of the wave are displayed on the LCD.
This section presents the steps for developing a software application that will run on the Renesas Demo Kit for RX62N for controlling and monitoring the operation of the ADI part.