

The AD9835 is a low-power, programmable waveform generator manufactured by Analog Devices. It is capable of producing sine, triangle, and square waveforms with a frequency resolution of up to 28 bits. The device is controlled via a serial interface, making it highly versatile and suitable for a wide range of applications.








Below are the key technical details of the AD9835:
| Parameter | Value |
|---|---|
| Supply Voltage (VDD) | 2.3 V to 5.5 V |
| Power Consumption | 20 mW (typical at 3 V) |
| Frequency Resolution | 28 bits |
| Maximum Output Frequency | 25 MHz |
| Output Waveforms | Sine, Triangle, Square |
| Serial Interface | SPI-compatible, 3-wire |
| Operating Temperature Range | -40°C to +85°C |
| Package Type | TSSOP-20 (AD9835BRUZ) |
The AD9835 comes in a 20-pin TSSOP package. Below is the pin configuration and description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VDD | Positive power supply (2.3 V to 5.5 V). |
| 2 | DGND | Digital ground. |
| 3 | MCLK | Master clock input. Determines the frequency of the output waveform. |
| 4 | FSELECT | Frequency select pin. Chooses between two frequency registers. |
| 5 | PSELECT | Phase select pin. Chooses between two phase registers. |
| 6 | RESET | Active high reset pin. Resets internal registers. |
| 7 | SCLK | Serial clock input for SPI communication. |
| 8 | SDATA | Serial data input for SPI communication. |
| 9 | FSYNC | Frame synchronization signal for SPI communication. |
| 10 | AGND | Analog ground. |
| 11 | IOUT | Current output. Connect to a load resistor to generate voltage output. |
| 12 | COMP | Compensation pin. Connect to a capacitor for stability. |
| 13-20 | NC | No connection. Leave these pins unconnected. |
Below is an example of how to interface the AD9835 with an Arduino UNO to generate a sine wave:
#include <SPI.h>
// Pin definitions for AD9835
#define FSYNC 10 // Connect to FSYNC pin of AD9835
#define SCLK 13 // Connect to SCLK pin of AD9835
#define SDATA 11 // Connect to SDATA pin of AD9835
void setup() {
// Initialize SPI
SPI.begin();
pinMode(FSYNC, OUTPUT);
digitalWrite(FSYNC, HIGH); // Set FSYNC high initially
// Reset AD9835
writeRegister(0x2100); // Reset command
delay(10);
// Set frequency to 1 kHz (example value)
setFrequency(1000);
// Exit reset mode
writeRegister(0x2000); // Clear reset bit
}
void loop() {
// The waveform will continue to generate without further code
}
// Function to write a 16-bit value to the AD9835
void writeRegister(uint16_t data) {
digitalWrite(FSYNC, LOW); // Enable communication
SPI.transfer(highByte(data)); // Send high byte
SPI.transfer(lowByte(data)); // Send low byte
digitalWrite(FSYNC, HIGH); // Disable communication
}
// Function to set frequency (example: 1 kHz)
void setFrequency(uint32_t frequency) {
uint32_t freqWord = (frequency * 268435456UL) / 25000000UL; // Calculate frequency word
writeRegister(0x4000 | (freqWord & 0x3FFF)); // Write lower 14 bits
writeRegister(0x4000 | ((freqWord >> 14) & 0x3FFF)); // Write upper 14 bits
}
25000000UL with the actual clock frequency (MCLK) in Hz.No Output Signal:
Distorted Waveform:
Incorrect Frequency Output:
Q: Can the AD9835 generate arbitrary waveforms?
A: No, the AD9835 is limited to sine, triangle, and square waveforms. For arbitrary waveforms, consider using a DAC with waveform memory.
Q: What is the maximum output frequency?
A: The maximum output frequency is 25 MHz, but the actual usable frequency depends on the master clock and application requirements.
Q: How do I improve waveform accuracy?
A: Use a stable clock source, minimize noise in the power supply, and apply proper filtering to the output signal.
Q: Can I use the AD9835 with a 3.3 V microcontroller?
A: Yes, the AD9835 operates with a supply voltage as low as 2.3 V, making it compatible with 3.3 V systems. Ensure proper logic level matching for SPI communication.