Simple amplifier for AD9850 DDS? - Page 1
Forum section: electronics / projects

author: miceuz
author_rank: Frequent Contributor
timestamp: November 02, 2013, 05:52:47 pm
content: Hi all,I've got a cheap AD9850 module off ebay, of course it's crap - some bits are appearently stuck in it as it has "jumps" in frequency while increasing it's register value. Nevertheless, it does output a sine wave.I want to make a simple amplifier for it, but the module being crap, I don't want to invest into a proper job, just to have something "more than nothing".What could be the most simple amplifier I could build? Discrete transistors? Opamp?I want the output to be 10V peak-to-peak and frequency range of 10Hz to 20MHz. Today I just hooked up a pair of NPN transistors (BC549, just the first one from the junk box) the first one as a common collector buffer and second one as common emitter amplifier. I notice significant decrese in amplitude of amplified signal at 1MHz. How could I improve it by choosing proper transistors or an opamp? What transistor characteristic to look into? Is this frequency range achievable with one amplifier circuit or should I have separate amplifiers for separate frequency ranges and there is no simple way around it?

author: minime72706
author_rank: Frequent Contributor
timestamp: November 02, 2013, 05:56:47 pm
content: You'll need an opamp with a rather high GBW, maybe 100MHz? They also make transistors, basic jellybean ones even, that are meant for RF applications.

author: Bored@Work
author_rank: Super Contributor
timestamp: November 02, 2013, 06:07:41 pm
content: Video OpAmp. E.g. AD818, NE592 or MAX452 (no, I didn't check if they can deliver your Vpp).

author: c4757p
author_rank: Super Contributor
timestamp: November 02, 2013, 06:14:27 pm
content: I'll put in a vote for the LM7171. It fits all of your requirements, is pretty low-maintenance, low cost, and has enough GBW to shareGobs of output current, too, you may be able to use it directly as the output without a buffer (though a simple class-AB amplifier made of a PN2222 and PN2907 and a couple diodes and resistors is cheap and will lighten its load a bit and keep it cool - this ain't no low-power op amp...).Edit - the GBW isn't as high as I thought it was - 200 MHz (I thought 300). Barely enough if you want a gain of 10. Hopefully you don't need that much gain, though, and I did look into the AD9850 and noticed it's sine only, so at least you don't have to bother with harmonics. You could always chain two.It shouldn't be hard to do this with transistors at that bandwidth - I don't know what the output voltage is (it's not quickly visible in the datasheet), but I'll assume a gain of about 10 is required. Up to 20 MHzsine wavegives you a GBW of 200 MHz, which even a PN2222 can manage (though it's not nearly as easy as an audio amplifier). If you have higher-frequency content (i.e. anything but a sine wave) you'll need a better transistor, like BFS17W. The problem with this is that you are going to have DC offset on your output, which you probably don't want, and if you go to the trouble to eliminate it, you're basically implementing your own op amp. Might as well buy one.

author: minime72706
author_rank: Frequent Contributor
timestamp: November 02, 2013, 06:47:59 pm
content: I don't think those basic BJT transistors are fast enough. 'BF' series?I'm not terribly knowledgeable about RF transistors, but I came across the BF199, which is 1.2GHz.

author: miceuz
author_rank: Frequent Contributor
timestamp: November 02, 2013, 10:46:41 pm
content: thanks guys, I'll try some of the options and report back how it goes.

author: rastro
author_rank: Frequent Contributor
timestamp: November 02, 2013, 11:53:03 pm
content: You can get a little more amplitude out of the ebay 9850 DDS modules by changing the resistor that controls R_SET (not to be confused with Reset).There are a few applications notes that provide some insight.http://www.datasheetarchive.com/dl/Datasheet-03/DSA0038818.pdfhttp://www.analog.com/static/imported-files/application_notes/AN-423.pdfMore specifically for there are 2 basic styles of 9850 DDS modules on eBay. The most prevalent one has a large 125Mhz Xtal and no jumpers. On these modules R6 is usually a 392 (3.9K ohm). I've replaced this with a 222 (2.2K ohm) on 2 modules to increase the amplitude across the 30Mhz range with no ill effects. The chip probably does run a little hotter. I was also terminating into 50-ohm so I needed the extra juice. Also I think the lowest you want to go on R6 is 1.8K ohm. It's been a while since I did this so I don't remember the exact increase but it was noticeable over the typical unterminated 1.2 V Pk-Pk on the default boards.This is no way intended to get you close to 10V amplitude but it may help if your amplifier is gain limited and would benefit by a larger input.

author: JackOfVA
author_rank: Unknown
timestamp: November 03, 2013, 12:10:54 am
content: When you say 10V PP, is that into a coaxial cable or a capacitive load? If so, you will likely need to back terminate the op-amp with 50 ohms (or 75 ohms or whatever coax impedance you use) series resistor as most op amps are not happy operating into a capacitive load. The safe fix is a series R.The result will be to cut your PP voltage in half since the back termination resistor and the load resistor will be in series and equal.If you don't need back termination - e.g., operating into a resistive load with little (a few pF) shunt capacitance - then your design becomes easier.

author: rastro
author_rank: Frequent Contributor
timestamp: November 03, 2013, 12:17:40 am
content: Here is a link to someone working on a similar project. This is also where I originally got the R_SET modification.http://www.vk5tm.com/homebrew/dds/dds.php

author: dannyf
author_rank: Super Contributor
timestamp: November 03, 2013, 12:33:18 am
content: QuoteYou will need agc. A simple way to do it is to use a VGA/PGA, like AD603.Of course, you can play with the Rset pin.

author: KJDS
author_rank: Super Contributor
timestamp: November 03, 2013, 11:12:18 am
content: I like the BFS17 for gain at those frequencies.

author: dannyf
author_rank: Super Contributor
timestamp: November 03, 2013, 11:51:00 am
content: A discrete solution may be to use a dual gate mosfet (BF998 for example) and utilize its negative gain on the 2nd gate for agc.

author: miceuz
author_rank: Frequent Contributor
timestamp: November 04, 2013, 10:29:17 am
content: Hm, this idea of variable gain amplifier is totally new to me.So in general, to account for gain-bandwidth product limitations you integrate or peak-detect your amplified signal and adjust gain according to that?This looks a bit too complicated for what I expected to do away with, but nevertheless, interesting and maybe worth investing time just to learn something newAny example circuits for double-gate mosfet solution?

author: KJDS
author_rank: Super Contributor
timestamp: November 04, 2013, 11:28:55 am
content: I wouldn't bother with anything too complex.use a simple common emitter stage to give you some gain, but add some inductance in series with the resistor on the collector so you get more gain at high frequency. Feed that into a common collector stage to give you some output drive

author: G0HZU
author_rank: Super Contributor
timestamp: November 04, 2013, 10:36:53 pm
content: To cover 10Hz to 20MHz with decent linearity up to maybe 10 volts pkpk I would be looking at using a current feedback (CFBK) op amp.The high speed and high performance versions of these are often very expensive but a reasonably priced contender is an AD844AN and I can remember using these up to a couple of MHz in high performance IF circuits designed to drive a DSP back end. This was about 20 years ago but I think this device is still available.Looking at the datasheet the AD844 device will work reasonably well up to 20MHz. It can be run from a +/- 15V supply.The linearity of this device is excellent up to about 1MHz but it won't be so good up at 10MHz or 20MHz and it won't be very linear at 10Vpkpk at any frequency. But I guess it depends on what linearity you can accept.You also have to read the datasheet for the AD844 device very carefully in order to get it to work as intended. It isn't the same as a regular voltage feedback op amplifier. eg you have to choose the feedback resistors to suit your bandwidth requirements as well as for setting the gain.Analog Devices supply SPICE models of the various versions of the AD844 if you want to download the model to try out a basic simulation.You can probably find an AD844 fairly cheaply. eg sub $10 on ebay. However, if the performance isn't quite good enough then you will have to buy a more expensive part or consider an alternative technology for the amplifier. Note that I think you would have to use a couple of them in series to get the amount of (flat?) gain you need across 10Hz to 20MHz.

author: dannyf
author_rank: Super Contributor
timestamp: November 05, 2013, 02:11:31 am
content: Don't have an agc circuit handy for the BF998. But the gist is to buffer the output from the bf998 and then rectify it before feeding it to the 2nd gate - fairly typical for this type of circuit.As for gain blocks, you can look into mmics - they don't have perfectly flat gains like opamp but with an agc in the feedback loop, it doesn't matter.

author: jwm
author_rank: Regular Contributor
timestamp: November 05, 2013, 05:18:58 am
content: Hi, I too am building a similar ad9850 circuit but am ganging up two modules to have more flexibility (such as quadrature). I am looking into an op-amp line driver and to my eyehttp://www.ti.com/product/lmh6672looks like it would be a good fit to give them both strong 50ohm driving outputs through the whole range. Am I missing something?It says 3db loss at 90mhz, so does that mean that the signal will be 70% it's amplitude at 90mhz? Since I am generating sine waves with no higher harmonics that will be cut off, does that mean there will be no distortion only the amplitude change at higher frequencies?Just want a sanity check on what I am planning.When it comes to AGC, I was thinking of taking the idea from thishttp://www.analog.com/static/imported-files/application_notes/AN-423.pdfand driving the gate of the fet from a PWM pin of my controlling uC which knows the frequency generated so can adjust the amplitude accordingly.John

author: G0HZU
author_rank: Super Contributor
timestamp: November 05, 2013, 08:19:39 pm
content: I think the LMH667x series are voltage feedback amplifiers and so you have to be careful because the gain will collapse at high frequencies if you try for a reasonable voltage gain from the device.eg if you want a voltage gain of 10 then you could be looking at 6dB of gain droop by 20MHz!That's why I suggested a current feedback op amplifier because they tend to have better high frequency performance at high gain settingsHowever, you also have to decide what distortion specs you want your amplifier to meet across its range. The AD9850 DDS produces very low harmonics down at AF frequencies so it would be a shame to throw this purity away in a low spec amplifier.So I guess it depends if you ever wanted to use the system to produce 'very' low distortion waveforms at a few kHz. eg something to drive a signal generator MOD input at 1V pkpk or for testing a basic audio amplifier.If you aren't bothered about maintaining very low distortion then maybe a simple design using a few BJTs will suffice. eg something along the lines of the circuit suggested by KJDS. It will certainly be the cheapest

author: dannyf
author_rank: Super Contributor
timestamp: November 05, 2013, 08:37:17 pm
content: My favorite is ad815: wideband, high current capabilities and no problem driving into a 50ohm load.and dirt cheap.

author: Hydrawerk
author_rank: Super Contributor
timestamp: November 06, 2014, 06:10:08 pm
content: Quote from: miceuz on November 02, 2013, 05:52:47 pmI am experiencing the same problem, but maybe there is some problem with my c code in ATmega32.I will try to do some more investigation.

author: Hydrawerk
author_rank: Super Contributor
timestamp: March 19, 2015, 09:51:51 pm
content: What exactly does theD2pin do? It must be set to zero when doingserialcommunication.What does the D2 do when in parallel communication?

author: Hydrawerk
author_rank: Super Contributor
timestamp: March 19, 2015, 10:04:23 pm
content: I am using ATmega32 + LCD to control my AD9850 byparallelcommunication.It works fine but often I have problems withD2pin. Sometimes unwanted voltage 2.5V appears and spoils the communication. The unwanted voltage comes from AD9850,notfrom ATmega32. Has anyone experienced this? Is my AD9850 faulty? Yes, I tried changing the ATmega32. When I remove the AD9850, the unwanted voltage never appears at the ATmega32's pin. Should I try aHCF4010Bbuffer?

author: Marco
author_rank: Super Contributor
timestamp: March 19, 2015, 10:07:27 pm
content: As long as he's driving a high'ish impedance load what's wrong with a common emitter amplifier with an emitter follower for output?

author: poorchava
author_rank: Super Contributor
timestamp: March 19, 2015, 10:24:54 pm
content: LM7171 is nice, I have used it in an Intersil-chip-based DDS. Worked nicely, although I couldn't get it to operate linearily with reasonable noise and distortion over 10-15MHz (G=10).

author: Hydrawerk
author_rank: Super Contributor
timestamp: March 20, 2015, 12:08:13 am
content: Any ideas onD2pin?

author: Unknown
author_rank: Unknown
timestamp: March 20, 2015, 04:49:05 am
content: Quote from: Hydrawerk on March 19, 2015, 10:04:23 pmHow are you measuring that?The datasheet doesn't spell it out, but it looks like the data lines are typical Hi-Z CMOS inputs & so you'd expect to see the inputs floating @ ~1/2 Vdd when undriven.First thing I'd check is that your code isn't tri-stating your MCU output pins. Otherwise, show us your actual circuit.

author: Hydrawerk
author_rank: Super Contributor
timestamp: March 20, 2015, 03:04:07 pm
content: QuoteWith an oscilloscope.QuoteI don't think that there is tri-stating. I use the port like this.Code:DDRD=0xFF;PORTD=0x00;Here is the actual photo.

author: Hydrawerk
author_rank: Super Contributor
timestamp: April 11, 2015, 06:05:52 pm
content: I made some progress. I found out that it is necessary to set the eight data bits to zero after sending the five words (W0, W1, W2, W3, W4).Now it works fine.Here is my code and the whole project.It is not perfect, but it works. It will be further developed.Code:#define __AVR_ATmega32__#define F_CPU 16000000UL#include <avr/io.h>#include <math.h>#include <util/delay.h>#include <avr/pgmspace.h>#include <avr/interrupt.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include "lcd.h"#include <stdint.h>volatile int val=1000;volatile int border=1023;volatile int16_t val3=0;uint64_t temp=0, W0=0, W1=0, W2=0, W3=0, W4=0, os=8, se=16,dv=24;uint64_t DDS_CLOCK=125000000;/*unsigned long int tuning_word=0;unsigned long freq=432000;*/uint64_t tuning_word=20000000;uint64_t freq=33210000;uint64_t num=4294967296;uint64_t x=50000, step=1, max=40000000;int send_freq(void);int main(void){/*unsigned*/int pos=7;char buffer= "123";char *gen = buffer;char buffer2= "123";char *poi = buffer2;ltoa(x,gen,10 );DDRD=0xFF;PORTD=0x00;DDRC=0xFF;PORTC=0xFF;DDRB=0b00000111;PORTB=0b11111000;lcd_init(LCD_DISP_ON_BLINK);_delay_ms(100);lcd_clrscr();lcd_gotoxy(0,0);//lcd_puts("FREQUENCY:");lcd_gotoxy(15,1);PORTB=0b11111100; //reset???_delay_us(1);PORTB=0b11111000;_delay_us(2);_delay_ms(50);/*//////////connection with s AD9850PORTD=0b 1 1 1 1 0 0 0 0;AD9850 D7 D6 D5 D4 D3 D2 D1 D0PORTB=0b 1 1 1 1 0 0 0 0;AD9850Reset W-CLK FQ-UD*///correctly resetting the AD9850PORTB=0b11110000;_delay_us(5);PORTB=0b11110100;_delay_us(5);PORTB=0b11110000;_delay_us(5);PORTB=0b11110010;_delay_us(5);PORTB=0b11110000;_delay_us(5);PORTD=0b00000000; //data_delay_us(5);PORTB=0b11110001;_delay_us(5);PORTB=0b11110000;// Chip is RESET now/*PORTB=0b11110100; //only for temporary_delay_us(5); //output offPORTB=0b11110000;*/_delay_ms(500);PORTD=0b00000000;PORTB=0b11110001;PORTB=0b11110000;_delay_us(6);////PORTD=0x00; //W0_delay_us(3);PORTB=0b11110010;_delay_us(6);PORTB=0b11110000;_delay_us(3);////PORTD=0x00; //W1_delay_us(3);PORTB=0b11110010;_delay_us(6);PORTB=0b11110000;_delay_us(3);////PORTD=0x1A; //W2_delay_us(3);PORTB=0b11110010;_delay_us(6);PORTB=0b11110000;_delay_us(3);////PORTD=0x36; //W3_delay_us(3);PORTB=0b11110010;_delay_us(6);PORTB=0b11110000;_delay_us(3);////PORTD=0xE3; //W4_delay_us(3);PORTB=0b11110010;_delay_us(6);PORTB=0b11110000;_delay_us(3);////PORTB=0b11110001; //Frequency update_delay_us(3);PORTB=0b11110011;_delay_us(3);PORTB=0b11110011;_delay_us(6);PORTB=0b11110010;_delay_us(8);PORTD=0x00;while(1){lcd_gotoxy(0,0);///////////////////////////////////ltoa(tuning_word,poi,10 );lcd_puts(poi);///////////////////////////////////lcd_puts("FREQUENCY:");//_delay_ms(50);PORTC^= _BV(PC7);lcd_gotoxy(0,1);lcd_puts(" ");ltoa(x,gen,10 );if (strlen(buffer)==1)lcd_gotoxy(7,1);if (strlen(buffer)==2)lcd_gotoxy(6,1);if (strlen(buffer)==3)lcd_gotoxy(5,1);if (strlen(buffer)==4)lcd_gotoxy(4,1);if (strlen(buffer)==5)lcd_gotoxy(3,1);if (strlen(buffer)==6)lcd_gotoxy(2,1);if (strlen(buffer)==7)lcd_gotoxy(1,1);if (strlen(buffer)==8)lcd_gotoxy(0,1);ltoa(x,gen,10 );lcd_puts(gen);lcd_puts(" Hz ");if (pos==0){lcd_gotoxy(0,1);step=10000000;}if (pos==1){lcd_gotoxy(1,1);step=1000000;}if (pos==2){lcd_gotoxy(2,1);step=100000;}if (pos==3){lcd_gotoxy(3,1);step=10000;}if (pos==4){lcd_gotoxy(4,1);step=1000;}if (pos==5){lcd_gotoxy(5,1);step=100;}if (pos==6){lcd_gotoxy(6,1);step=10;}if (pos==7){lcd_gotoxy(7,1);step=1;}_delay_ms(50);//////////////BUTTON CONTROLif (!(PINB&0b11000000)) //zeroing{x=0;send_freq();_delay_ms(50);goto jumpover;}if (!(PINB&0b10000000)) //increase frequency{x=x+step;send_freq();if (x>max)x=40000000;_delay_ms(60);}if (x>max)x=40000000;if (!(PINB&0b01000000)) //decrease frequency{x=x-step;send_freq();if(x<1)x=0;_delay_ms(60);}if(x<1)x=0;jumpover:if ((!(PINB&0b00100000))&&(pos<7)) // move cursor{pos++;_delay_ms(250);}if ((!(PINB&0b00010000))&&(pos>0)) //move cursor the opposite way{pos--;_delay_ms(250);}if (!(PINB&0b00001000)){/*tuning_word = (x*num)/DDS_CLOCK; //32-bit tuning word//W0=0x00; //still zeroW1 = (tuning_word & 0xff000000UL) >> 24;W2 = (tuning_word & 0x00ff0000UL) >> 16;W3 = (tuning_word & 0x0000ff00UL) >> 8;W4 = (tuning_word & 0x000000ffUL) ;*//*W1=0x01;W2=0x06;W3=0x24;W4=0xDD;*/lcd_gotoxy(12,0);lcd_puts("Sent");send_freq();_delay_ms(500);lcd_clrscr();lcd_gotoxy(0,0);}}return 0;}int send_freq(void){/*//W0=0x00;W1=0x3B;W2=0x64;W3=0x5A;W4=0x1D;*/tuning_word = (x*num)/DDS_CLOCK; //32-bit tuning word//SPLIT THE TUNING WORD TO FIVE PARTS!!W0=0x00; //still zeroW1 = (tuning_word & 0xff000000UL) >> 24;W2 = (tuning_word & 0x00ff0000UL) >> 16;W3 = (tuning_word & 0x0000ff00UL) >> 8;W4 = (tuning_word & 0x000000ffUL) ;/*//////////connection with s AD9850PORTD=0b 1 1 1 1 0 0 0 0;AD9850 D7 D6 D5 D4 D3 D2 D1 D0PORTB=0b 1 1 1 1 0 0 0 0;AD9850Reset W-CLK FQ-UD*//////////////correctly resetting the AD9850PORTB=0b11111000;_delay_us(5);PORTB=0b11111100;_delay_us(5);PORTB=0b11110000;_delay_us(5);PORTB=0b11110010;_delay_us(5);PORTB=0b11110000;_delay_us(5);PORTD=0b00000000; //data_delay_us(5);PORTB=0b11110001;_delay_us(5);PORTB=0b11110000;// Chip is RESET now_delay_us(5);/////////////PORTD=0x00; //W0 Zero all the time_delay_us(2);PORTB=0b11110010;_delay_us(4);PORTB=0b11110000;_delay_us(2);///////////////PORTD=W1; //W1_delay_us(2);PORTB=0b11110010;_delay_us(4);PORTB=0b11110000;_delay_us(2);////PORTD=W2; //W2_delay_us(2);PORTB=0b11110010;_delay_us(4);PORTB=0b11110000;_delay_us(2);////PORTD=W3; //W3_delay_us(2);PORTB=0b11110010;_delay_us(4);PORTB=0b11110000;_delay_us(2);////PORTD=W4; //W4_delay_us(2);PORTB=0b11110010;_delay_us(4);PORTB=0b11110000;_delay_us(2);////PORTB=0b11110001; //Frequency update_delay_us(2);PORTB=0b11110011;_delay_us(2);PORTB=0b11111011;_delay_us(4);PORTB=0b11111010;_delay_us(8);PORTD=0x00; //IMPORTANT!!! SET THE DATA PINS TO ZEROreturn 0;}

author: Hydrawerk
author_rank: Super Contributor
timestamp: April 11, 2015, 06:15:23 pm
content: There was apparently a problem with this stuff. When the factory test mode is turned on, then theD2pin acts badly.

author: Hydrawerk
author_rank: Super Contributor
timestamp: April 23, 2015, 01:50:04 pm
content: Here I made a video and you can even look at my project attached. The code is non-professional.

author: cncjerry
author_rank: Unknown
timestamp: April 25, 2015, 09:07:06 pm
content: Have you looked at MMICs? There are a number that will do 10db or better gain with relatively good noise factor and are very broadbanded. Minimal external components as well. Depending on your needs and drive you can make several pretty cheaply and attach as needed with BNC or SMA. There are also a number of LNAs using 2n5179 etc RF transistors that are broad band and get 13db gain. I don't know if you can hit 10v P-P without a supply in the 14v range. With a 12V supply there are a number of rail to rail op amps that slew into 100Mhz as well.I have several amps that are used to buffer DDS chips from 9851s to 9854s etc. I have MAR2, MAR3, MAR6 types as well as a discrete 2n5179 that hits 13db but that is tuned. You would lose 3db at a minimum doing a broadband version.Lookup some of the VNA or SWR measuring circuits because I remember several having buffers. N2Pk VNA doesn't use a buffer so skip that one. I use the buffer after the DDS filter.Clearly the simplest would be a MAR-X type but you have to look at saturation as I don't remember if they go to 10dbm. For some reason I think they halt at +7dbm.

author: mematyi
author_rank: Contributor
timestamp: October 20, 2015, 06:14:09 pm
content: Hello! I just got this module off eBay.As you have said, i got an AD844 op-amp for amplificating the sine wave's amplitude.I want to use it as a sine generator, up to only some Megahertz.How should i set it up? I mean should i connect the module to the inverting input or non-inverting, do i need filter caps etc.Can you give me some help and point me to the right direction?

author: vinicius.jlantunes
author_rank: Regular Contributor
timestamp: December 15, 2015, 04:46:05 pm
content: Subscribed.