AD9850 DDS VFO

I was browsing eBay one day and I ran across a posting for the Analog Devices AD9850. The AD9850 is a chip that can produce a sinusoidal wave from about 1hz to 40mhz. Somehow the electronics dealers in Hong Kong have been able to mate the chip to a small board that provides TTL level control and then sell it for an unbelievable $8 (or less!). I know a few people have paid as little as $4 (USD) for them.

AD9850 Module

To control the AD9850 you’ll need some sort of micro-controller.  Without going into too much detail you are required to send a set of serial or parallel data to the chip to set the frequency.  There are numerous postings on the web detailing exactly how to do this so I won’t go into too much detail. However it has been hard to find a good AD9850 Pinout so here you go.

D0 – D7 = Parallel programming bits
GND = Ground (obvious); Vss
CLK = Serial programming clock
Latch = Serial programming latch (FQ_UD pin on 9850)
DATA = Serial programming DATA (internally tied to D7)
RST = Reset. Keep tied to GND
SQW = Square wave outputs (complementary) Duty cycle adjustable with blue pot.
SINA = Raw unfiltered AD9850 sine output
SINB = 70 MHz LPF filtered AD9850 output.

For me, the easiest way to manage the AD9850 is with an Arduino Uno.  If you don’t know about the Arduino platform you should check out the official site at www.arduino.cc.  I have been playing with the Arduino for only a couple of months and I already have found it to be a fantastic development platform.  If you are a hobbyist tinkerer… you really can’t go wrong with one.

I have paired may AD9850 with an Arduino Uno, LCD display, Rotary encoder, and a few other small parts and have put together a very descent DDS VFO capable of any frequency between 1mhz and 30mhz (It will go to 40 if you wish).  A little quick work with a protoboard and I have a nice working VFO.  You can watch my video on YouTube showing how it works. I also have another video of the VFO attached to my oscilloscope.

AD7C DDS VFO

This project is ongoing.  You should be able to deduce the pin outs on all items from the Arduino Sketch but if you have questions just contact me. My schematic is a little rough as I do not tend to create them that often so let me know if you catch anything out-of-place!

Because of a lot of requests I have also created a version for IF (superhet) type receivers. The VFO now supports an Intermediate Frequency and can switch upon the HI/LOW level of one analog input on the Arduino. The IF can be anything you wish and can be additive or subtractive.

** UPDATE November, 2013 **
I have updated the sketch to write the last tuned frequency to memory and recall it upon boot-up. This is a 100% direct drop-in replacement and requires you to only upload the new sketch. The code is well documented and for those of you who modified my original sketch it should be easy enough to adapt as you see fit.

Both Arduino sketchs (IF and NON-IF), schematic, libraries, and notes are available for download here.  Also, Jiri (OK1DXK) create a great drawing (aka schematic) if you wish to use an Arduino Nano. If you build something from my design please send me a picture or a video of your creation.  I love to see what others do!





Or you can also send a donation via paypal to rvisokey@yahoo.com (My registered PayPal address.)

405 thoughts on “AD9850 DDS VFO

  1. Hi, I’m wanting to build a VFO to run an old Drake 2 NT xtal controlled transmitter. I’m interested in what you have built here. I will need some kind of amp to bump up the output to 4v ptp, manual calls for 12v on 15 meter band for some reason.
    Anyhow I like what you have here and let me know what you think.
    Thanks, Gary KF7WNS

    • Gary,

      You can easilly build a buffer amp to drive the signal to 4v PTP or even 12v PTP, however, I find that level somewhat huge! Typically 1v or .5v is more than ample for most circuits but if that’s what the manual for your Drake states… that’s what you’ll need.

      Please remember that the output voltage of the DDS VFO varies with frequency so if you need it to output a constant level across a wide-range VFO you’ll need to design an AGC (or sorts) into your buffer to provide a constant level output. I’ve seen some great designs with simple op-amps that accomplish this with a tap into the feedback circuit. I’m not the expert here so I would recommend you get on the eham.net forums or arrl.org TIS group for more assistance.

      God luck on your project.

      73,

      Rich
      AD7C

    • I am not familiar with the Arduino Mega so I can’t be of assistance. You’ll probably need to adjust the pinouts from the UNO to the MEGA as they are different. The main difference is going to be the Interrupt pins.

      Sincerely,

      Rich
      AD7C

    • This was asked a number of years ago but is still valid.
      The reason the rotary does not work on the Mega2560 is due to the differences in interrupts between the Uno and the Mega2560 or or specifically the Uno’s lack of them. It turns out the fix is rather simple.

      In the setup(){} function comment out the following lines and then add the two lines immediately after the commented out code like this::
      /*
      PCICR |= (1 << PCIE2);
      PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
      if (rx =30000000){rx=rx2;}; // UPPER VFO LIMIT
      if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT
      }
      }

      No change in pinouts necessary though I did adjust the lcd wiring with pin 4 of the lCD to D13 and pin 6 of the LCD to D12 (just swapped them) and changed:
      LiquidCrystal lcd(12, 13, 7, 6, 5, 4);
      TO:
      LiquidCrystal lcd(13, 12, 7, 6, 5, 4);

      One last thing that is not Mega2560 specific was a labeling errata in the wiring diagram. D10 of the Arduino goes to the DATA pin of the AD9850 and NOT D7. So it should read DATA and not D7 on the DDS AD9850 in the diagram. Hope this helps someone.
      It works for me :-)
      Nikki

      • What a shame, the web code filtered out some of the code I posted. This makes the above incomplete. So I will try to describe what needs to be done instead.

        On the Mega2560 use the attachInterrupt() function in the setup() part of the program. The lines that reference PCICR , PCIE2, PCMSK2, PCINT18 and PCINT19 as well as the sei(() function in setup() can be commented out or deleted. This amounts to 3 lines towards the top of the setup() function. The new code uses attachInterrupt() for INT_0 & INT_1 like this:
        attachInterrupt(0,MyIsr,CHANGE)
        attachInterrupt(1,MyIsr,CHANGE)
        of course don’t forget the semicolons at the end of each line.

        Next you simply want to change the name of the ISR service routine (called ISR) from ISR(PCINT2_vect) to void MyIsr(void). Then your’re done. I hope the web server doesn’t filter out this, If it does, then I tried.
        Good luck,
        Nikki

        • in this way?
          void setup() {
          lcd.begin(20,4);
          lcd.backlight();
          Serial.begin(9600);
          lcd.setCursor(0,0); // Se pone el cursor en la primera posición de la pantalla
          pinMode(A0,INPUT); // Connect to a button that goes to GND on push
          digitalWrite(A0,HIGH);
          //PCICR |= (1 << PCIE2);
          //PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
          if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT
          }
          }
          well i have a problem :

          dds9850.ino: In function 'void setup()':
          dds9850.ino:33:20: error: 'MyIsr' was not declared in this scope
          dds9850.ino: At global scope:
          dds9850.ino:46:6: error: expected constructor, destructor, or type conversion before '(' token
          Error de compilación

          • //PCICR |= (1 << PCIE2);
            //PCMSK2 |= (1 << PCINT18) | (1 <=30000000){rx=rx2;}; // UPPER VFO LIMIT
            if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT
            }
            }

  2. Hi, I too am planning on building this circuit. I was wondering if you’ve messed around with the AD9850 Library for the Arduino? I appears to have simplified things quite a bit. I’m also looking for other examples using the AD9850. I bought 2 for pocket change. Here’s the library:

    http://code.google.com/p/ad9850-arduino/

    • Never used the library as I had no issue controlling it for what I needed it to do but thanks for the tip! 73, AD7C – Rich.

    • Analog Devices AD9850. Get on ebay.
      The rotary encoder I used was from a junk drawer, however, you can find a similar one for $3-$4USD at sparkfun.com or mouser.com.

  3. Might this be a cheap replacement for a bad PTO on a TenTec Century 21 I have? Thoughts? Thanks for your work!

    Ronny
    K4RJJ

    • I don’t know much about Permeability Tuned Oscillator circuits, however, I see no reason why you can’t use it. Realize that it would replace the entire PTO section (or rather VFO). The nice part is that if you did replace it with the AD9850 you would get a much wider tuning range over the PTO. 73 – AD7C

  4. Rich,
    Please send me the new code for superhet receivers. I have a SW receiver that I built with the NE602 that uses 455khz and it would be awesome to have that figured in. Thanks for commenting a lot in the code. It helps for those of us that are struggling. This is really great that your doing this. Having a powerful VFO like this is
    worth big bucks!

    Harold Lacadie

    • Me Again,
      Well I built the circuit EXACTLY as you have described using inexpensive EBAY parts it and your software. Oh my sweet Lord! This is the coolest thing ever. Tomorrow night, it gets a real workout on my little superhet. Your setup is flawless!

      • Glad it works well for you. FYI: The NE602 doesn’t require much drive (input) to work, however, you may find that some designs require a little extra “oomph” from the AD9850 output. KF0XO has a simple buffer circuit a few posts back that boosts the output around 10db.

        Love to see a photo of it in action!

        73, Rich AD7C

        • Rich,
          I connected the Arduino VFO up to my little NE602 superhet last night. found out 2 things:
          1). A coupling cap is required (there must be some DC in the sine wave or something.
          2). The NE602 needed the entire waveform to work well and seemed to want more; need to make a buffer.

          Other than that, the tuning was smooth and clear. I even tuned down to the upper AM bradcast band. Found some spanish broadcast ot the Redsox game. I’m going to alter the code to go lower into the broacast band, make a buffer and maybe stick a little MMIC before the first IF can. Fun stuff dude! Video coming soon I hope.

          • If you watch my 2nd video of the AD9850 on Youtube you can see that the lower in Hertz you go… the more powerful the sine wave output. So in the AM band you may be able to work without a buffer but, most likely, anything above 7mhz will require one.

  5. Fantastic circuit worked straight away with the same components. I am very much interested in the new version could you please email at glitsun@hotmail.co.uk
    Many Thanks a lot for the wonderful circuit.
    Regards
    Glit.
    M0HPF

  6. Hello
    I want to ask you about the schematic I try the connection thet you made but it doesn’t work can you help me please

    • I built the circuit, but the software wouldn’t compile properly. I ended up putting the code for rotary.h into the beginning of the main program and removing the “#include rotary.h” line. The rotary encoder wouldn’t work to change frequency. I figured out that adding external 10k pullup resistors to the two encoder outputs fixed the problem, and now it works fine. I’m happy. I’m not sure what “# include Arduino.h” refers to. I hope this can help someone.

  7. Rich,
    Sorry to be a PIA but my programming skills are pretty bad when it comes to the Arduino (C language). Could you please send me the new version of your software that takes into account the IF frequency you mention above for June 6th?

  8. In looking at the AD9850 board’s specifications there is a jumper for serial mode – yet in most of the pictures I don’t see this jumper used. Is this jumper necessary or not?

    Thanks

    • The jumper let’s you select between parallel or serial input, however, you can also software select it. Generally unnecessary.

      Rich
      AD7C

  9. Pingback: 7MHZ VFO with Arduino and AD9850 | AD7C

  10. Hi Richard,
    For past few days I was trying to assemble the AD9850+LCD+rotary Encoder for the HF VFO. I have almost made it but for the rotary encoder part. In the sketch you have published I am getting some errors especially for the rotary encoder code lines .First in line no 11- it says ‘Rotary’ does not name a type, Then in line no 40 – ‘r’ was not declared in this scope .Next in line no 42 – ‘DIR_CW’ was not declared in this scope .I am not able to address these 3 errors. Hope you can help me.Thanks in advance for your time.

    73
    (Pravinkumar Anandan)
    AB9XC
    ab9xc@yahoo.com

    • You most likely did not include the rotary encoder libraries. You have to include the extra libraries for my sketch to work. While I have provided the libraries in the ZIP file, you have to setup them up to be correctly imported during build/compile. See: http://arduino.cc/en/Guide/Libraries

      AD7C
      Rich

      • Hi Rich,
        I tried to instal the rotary encoder libraries as instructed by you. But it says already there is a library called
        ” Encoder” and true to it the rotary encoder works in stand alone mode. But somehow when I try to include it is not taking saying it is not named a type. In your experience of Arduino what may be the reason it is taking “Encoder” but not taking “Rotary” ? Thanks for your time.

        73
        (Pravin)
        AB9XC

        • Sorry. Don’t know how much more help I can be. I have never experienced the problem you describe. You may want to remove then re-install everything related to the project (Arduino environment and all). Make sure you have the latest version of the Arduino environment when you re-install. Lot’s have people have downloaded my code and it has worked without issue. You can also try posting to the Arudino forums to see if someone there can help as well.

          Rich
          AD7C

  11. I have tried that also but the problem persists . Anyway thanks for all your help and if and when I solve this problem I will certainly update you.

    73
    (Pravinkumar Anandan)
    AB9XC

  12. Hi, I finally got hold of all the parts needed for the arduino ad9850 vfo project. My question is I guess the lcd I bought is the lcd keypad shield. Will this work? I’m new to this arduino and I tried to upload the code and there seems to be an error every time I do it. Could you please help me with these? 73′s and more power.

    • The code was designed for an external Hitachi styled LCD unit and not the Arduino LCD shield. However, you it can be made to work with the shield. You will need to look at the shield pin-outs (RS, write, Data, etc) and match those to the data pin-outs I used in my schematic. You’ll then need to change the code in my sketch to assign the correct pins. It’s fully documented so you can easily find the pin assignments are re-arrange them. It’s going to be a lot of work if the new pin-outs use pins assigned to the rotary encoder or DDS unit.

      Sorry! I don’t have a LCD shield so I can’t help you much with this one unless you feel like sending me one to proto :-) . My $.02. Get a basic, plain, simple LCD. The’re $5-$8. Ebay is your friend.

      Rich
      AD7C

  13. Hi Richard,
    With the active help of some Arduino forum members I was able to successfully instal the “Rotary” library into my Arduino IDE and now able to compile the AD9850 DDS code . Just now I loaded it into a ATMega328 chip and it has started to work as per your design. I am wondering whether we can modify it such that it can be used as a swept frequency source for an antenna analyzer application .
    Thanks a lot for your wonderful yet simple circuit and code.
    73
    (Pravinkumar Anandan)
    AB9XC

  14. Thank you so very much for the FW and the schematics.
    Hello Rich,
    My children’s Aurduino board was sitting idle after they played around building a few basic projects during their last summer holidays….
    The simplicity of the Aurdino attracted me, and while Googling for more info I came across your web page. I’m glad I did !
    Your code worked the very first time I switched it on, and your well commented sketch helped me a great deal in my intro to the Uno.

    Please watch my video @ http://www.youtube.com/watch?v=LiPcl01YB9o
    This is an ongoing project for a HF to 2m transverter.
    73

  15. Hello Rich: I have a question reguarding downloading the rotary libraries. There are 2 rotary libraries, rotary3 and rotary. Do I need to add both to the IDE? Or am I looking at the wrong file?
    73
    Dave

    • Dave… those files are part of the original source code. As I did not write that code but rather just modify it I felt it necessary to include and credit the original authors. Ignore everything in the RotarySource folder unless you want to make source code changes (doubt it).

      You are only interested in importing the 2 files in \libraries\rotary folder: rotary.cpp and rotary.h and my main arduiono sketch (.ino file). As there has been some confusion please only 1 of the .ino files. More is explained in the ReadMe.txt file.

      73, Rich AD7C

  16. Hi Rich: Thank’s for the help. I am new to Andurino so just needed a step in the right direction. All is OK now once I downloaded the coerrect file
    73
    Dave
    Wb4CHK

  17. Hi Rich,
    I will be very grateful if can you tell me how to change the code such that it can be used as a swept frequency antenna analyzer with appropriate LPF from a bank of Low Pass Filters etc. Thanks in advance for your time.

    73
    DE
    AB9XC
    (Pravin)

  18. Hi Rich. I am designing a board that will plug into the Arduino and have the 9850 DDS module plug into the top of the board. From your schematic you have the data line from D7 on the 9850 module going to the pin10 on the Arduino.(UNO) which you assigned as Data 10. It would make a cleaner board if I connected Data 10 on the Arduino directly to Data in on the 9850 board.They seem to be connected. Any problem connecting Data 10 directly to Data in on the 9850 module rather than D7? I hope this makes sense!!!
    73
    Dave WB4CHK

  19. how to generate the Arduino Uno with two sinusoids using two plates DDS9850 and only one arduino can someone help me

    • Marcos,

      Doing what you ask would be difficult. The Arduino UNO has just enough outputs to run one AD9850. You probably would need to run an Ardunino Mega to use two boards. Sorry… I’ll be unable to help you with your project.

      Rich
      AD7C

  20. Hi Rich,
    I tried the sketch to my board, it works well, but the dial speed when change the frequency is too slow for me, i just using generic and commons 3 pins rotary encoder (ticking when i spin it type). i tried to lowering and increasing delay speed with change the value from 250 to 100 and lower with mean i need it that the rotary encoder will response quicker, but i don’t feel many changes, anyone have ideas to fix my problem?
    Thank’s Rich, this sketch is simple and easy, hope i can adding some menus in future :)

    • Rudik,

      Did you also hook up the push-button “switch” as shown on the schematic? When you push the switch it changes the rate (speed) at which the rotary encoder advances/declines the frequency. YOU DO NOT need to modify the sketch code to get the rotary encoder to respond faster. I am also using a generic 3 pin encoder.

      Rich
      AD7C

  21. Hi Rich,
    Well, because i don’t have the rotary encoder with 5 pins, i just used 3 pins rotary encoder type, and change the push button with ordinary push button switch, in my understanding, it’s should be no problem.
    Another important function i wondering is auto saved last frequency used, so in case we turning the controller off, the last dial should still remain in previous setting. I am and my friend is working with this, so, i will updating the updated sketch here for everyone use.
    thank you
    rudik

  22. Hi Rich,
    I built your DDS project, it works great. Just wondering what the switch does that is connected to A5 on the Arduino? I have mine hooked up as the schematic shows but it doesn’t appear to do anything. Thanks.

    Joel
    KB6QVI

    • The switch changes the steps (rate) of tuning. 10hz, 100hz, 1khz, etc. If your switch does nothing check the connections. Most rotary encoders have a ‘switch’ built in that actuate when you depress them so an external switch is not necessary. However, you can use an external switch as you did. Watch the video of this build on my YouTube page and you can see the action of the switch.

      Rich
      AD7C

  23. A very nice little sketch and project for the Arduino. Thank you

    Somebody mentioned the switch on A5 and that’s the effectively the TX/RX of if shift state switch as it changes the output frequency to be the one shown on the display, less the constant defined by ‘iffreq’.
    It is not the one to change the DDS switching steps which is on A0 and is the push button on the rotary encoder.

    It certainly works very well and at present I have mine working with the other DDS available on Ebay which has slightly different pin outs and names.
    This may help others to use the different DDS boards out there and the pin markings on the different boards are compared here:
    D7 = DATA
    MCLK = W_CLK
    FQUP = FU_UO
    RST = RESET

    I also changed the line: lcd.print (” “);
    to be
    lcd.print (“rx”)
    simply to show that it’s in if shift more .

    Brilliant and thanks again
    Dale G4IPZ

  24. anyone have updates regarding the the problem with the last used frequency dialed when system goes shutdown? i mean, when last time i tuned to 7.100.000 Hz, then i turned off the system, i want the dial frequency remain at 7.100.000, Hz, not to the default value as i stated in sketch. i think this should become the basic function anyway.

    • That is not a problem that is by design. There is no routine to store the last entered (dialed) frequency in the DDS so when power is removed and restored the system always resets back to the default VFO frequency.

      However, I am working on this as an improvement… with some other items. Anyone wishing notice when I am done can send an email to AD7C @ ARRL.NET and I will add them to the notify list.

  25. Pingback: Nachbau eines digitalen Sinusgenerators « Peter Hostermann

  26. Rich,
    Great project, I have built it around the Uno, the Nano, and the Pro Mini and they all work perfectly. I prefer the Pro Mini as they are dirt cheap. The only thing that would make this better would be if it had the ability to remember the last frequency you were on and you are working on that, thanks. BTW, mine draws 140ma with the Pro Mini module.

    Joel KB6QVI

  27. This little project has really sucked me in HI !
    My versions have been run on a UNO, a NANO and even on a UNO bootloader chip programmed and built stand-alone on veroboard.
    It’s been a great learning curve.
    So far I’ve rewritten quite a bit of the sketch so it now uses an 8 x 2 display, has separate up/down buttons for the step values, has an IF shift inhibit switch depending on what I’m driving with it and the ability to change the shift frequency by a push button. I’m now working on saving the chosen shift into the EEPROM and learning masses as I go along.
    One of my next mods will be to use an I2C display to release the digital pins for other uses.
    Fantastic fun!

  28. Completed build on the WB4CHK pcb and barring a few toubleshoots we are up and working with a Sine Wave to be proud of.

    Minor problems if they help anyone.
    Keep the IF and the non-IF sketches in separate folders when you load one of them into the arduino IDE you get duplicate declarations etc.

    Others : my faults..
    Using ribbon cable – one faulty data connection traced with ohmeter an fixed.
    22K might be bit to large for the contrast – it is all in the last smidgin of the turn of the pot. (Plans say 25K – but 22k on hand here)
    Non critical.
    Wired the 12V supply into the 5V regulator using connector from the aruduino.
    All works OK but tabbed-regulator gets a bit warm. Fix this next time with 9V into arduino from the 78L09. (with 12v into the 09).

    The project is to become my new bench RF sig generator so will be looking at the N3ZI buffer amp and a stepped attenuator. Possible calibration later or some kind of const voltage amp.

    Enjoy the project everyone!
    73
    Toni
    G6XMO

    • Moving the IF version out of the folder containing both .ino files, solved duplicate declaration error for me too! Compiler was finding first error at ‘void storeMEM()’ Using Linux Mint 17.1 and Arduino 1:1.05. Thanks Tony for the comment. Thanks to Rich for the wonderful project!

      Bob KD0JIY

      • Just finished installing Arduino Ver. 1.6.5 on Xp. Downloaded and tried compiling non IF version of vfo. Got the duplicate declaration error, when both .ino files were in the same folder.
        Removed the IF version and then the remaining one compiled fine! The XP operating system is a virtual one using Oracle virtual box on Linux Mint 17.1 . I found out about the AD9850 Arduino shield (by WB4CHK) at Rich’s site about an hour ago. Neat!
        Tnx agn to Rich, Tony, and WB4CHK

        Bob KD0JIY

        • Installed Arduino Ver. 1.6.5 on Windows 7 Pro Sp1 with all Microsoft updates. Compiled (arduino ‘verify’) Rich’s non-IF .ino file. Got the error ‘duplicate Rotary r’. Removing the IF .ino file from its original folder solved the problem. The non-IF file compiled 100%.
          This time the Windows 7 operating system was on a normal hard drive, not virtual. I need to get some parts, and try this vfo. Thanks again, to Rich and contributors!
          Bob KD0JIY

  29. Pingback: DSS VFO Update – Last Frequency Saved in EEPROM | AD7C

  30. ** Code Update **
    Version 2.0 of both sketches is release. Version 2.0 saves the last dialed frequency to EEPROM memory and reloads it at boot-up. Code is 100% direct replacement of old code.

    If there are any questions please just ask.

    73,
    Rich
    AD7C

  31. Would it be possible to control 2 DDS modules to allow I-Q outputs for SDR applications.
    maybe use extra arduino output pin to select DDS module, send same freq data 32 bits, need control word to for each DDS module for 0′ & 90′ phases.

    • Frank. Very possible to drive 2 AD9850 boards. However, I would probably want to use an Arduino Mega as they have more digital and analog pins easily allowing for the extra AD9850. While I am no expert on SDR and IQ I see a problem as I am not sure how you would control the phase of the AD9850′s. Something conquerable in code perhaps but a little beyond me at this point.

      73,
      RICH
      AD7C

      • Hi Rich,
        Feed both DDS modules with 1 clock source with equal wire length.
        AD9850 control byte can select phase value (5 bits)
        thinking to use Arduino I/O pins 0-1 to select chip when loading 40 bits data into DDS chip.

  32. Hi, very much appreciate your design.
    I downloaded the non-IF version 2.0.
    I am having a problem compiling the code.
    Probably my problem.
    For statement Rotary r = Rotary(2,3),
    I get error ‘Rotary’ does not name a type
    Help

  33. Have been looking around at how to incorporate some wobbulator functionality into the DDS VFO so that it becomes a great bench tool – RF signal generator and filter tester/alignment in one.
    Using the existing two switches and adding an I2C DAC to make the sweep voltage it should be possible to program into the existing setup a menu for VFO and another menu for Wob. The IF switch would make an Escape button and the rotary encoder an Enter keep. The Wob sweep limits could be set with the rotary encoder and the step too.
    I have a o-scope that will take X-Y inputs; the idea is that the filter under test gets the sweeping frequency (with the sweep voltage from the DAC) and the output of the filter is then displayed on the o-scope Y. The set frequency and DAC voltage are set on the same loop in software.
    The I2C DAC proposed is the MCP4725. These are an inexpensive chip. The cost of postage is actually more than the IC. You can get a breakout board from Adafruit or Sparkfun. Even using a local distributor in the UK the shipping cost doubles the cost of the purchase. So I’ve decided to get the chip and homebrew the circuit. Will probably add it ‘island style’ on the Arduino DDS VFO “Shield”.
    73
    Tony

      • Update on the wobbulator project.
        I have now got a MCP4725 working with the arduino on its own and drawing an nice sine wave on the scope. This was the first time I have worked with the SOT23-6 package. So much so that you open the packet from your supplier and say ‘where is the IC’. The are really tiny for something so useful. What a mess though – I switched the SDA and SCL pins so the thing wouldn’t work at first. When I wired them correctly the chip registered on the I2C probe software and bingo – here we are!

        I bought the ‘raw’ chips rather than the breakout board from Sparkfun or Adafruit. Nothing against these people they are great. However, my local supplier didn’t keep the breakout board and I priced up the board at UKPounds 12 delivered, when the chips are UKPence 80p each. Made some adaptor pads using press and peel (really must buy some new stock of this).

        Next job now we have a DDS VFO and a DAC is to integrate the two software modules into a menu driven VFO/Wobbulator.

        More next week.

        • Bit of a haitus in the project – I have completed the hardware element and though it was time to box it up (with a little wriggle room for mods) before finalising the software.

          I did get the DAC to sweep across the X trace of the scope and the VFO to sweep +/- 2KHz of a centre frequency.

          Idea of boxing it up it to 1) try the RF shielding and see if anymore bypass or filtering is needed and 2) to get the project out of the ‘loads of wires’ phase and safe from short circuits on the bench.
          The plan is to allow the boxed project to be programmed by having the USB connector accessible.

          A thought – for an antenna analyser – use some of the design from the 4SQRP projected ‘tenna dipper’ should be able to adapt this on ‘manhattan’ construction.

  34. Hi Rich,
    Hope you still remember me . I have succssfully assembelled your AD9850 DDS VFO design using Arduino ATMEGA328 chip a few months back. Thanks to you it is working fine and of great use to me as a general purpose VFO. Now I want to put similar VFO s for more specialised uses like (1) Antenna Analyser (2) SDR etc. I have got a few AD9850 boards and an AD9851 board through ebay.
    Regarding (1) Antenna Analyer I have alreday requested you to kindly publish the code, hope you are on the job time permits.
    (2) For SDR it will be awsome if two similar 9850 boards can controlled by a single Arduino (I think ATMEGA328 will be sucfficient) as it requires just an extra pin (to drive two separate W_Clks with 90 degree phase delay) than the single board . If it is difficult to do in software I think we can do it in hardware without the need of the extra pin if the clock frequency is known. We can have a full HF SDR without the need to use X4 VFO and the 7474 chips . I request your opinion about the same.
    I am in the process of upgrading the AD9850 software to include the “last frequency” feature you published recently. So far not succssful on it and will let you know the result shortly.
    Regarding the AD9851 board I will be very grateful if you can publish the code for a HF+VHF VFO with LCD & encoder in one of your future blogs. Hope I am not demanding too much from you.

    73
    DE AB9XC
    (Pravin)

    • Pravin,

      I do not have time, at present, to work on the antenna analyzer. Work and other projects have kept me away from exploring the code. However, I do plan on someday generating a code an schematic but I can not state a time-frame.

      For the SDR I suggest you seek out another user who posted some items about SDR on this board. Frank VK3ZFS has shown an interest in the same topic and together you both may be able to find a way to use dual AD9850′s to build an SDR.

      I would suggest to you that you take a look at http://arduino.cc/en/Reference/HomePage. With the current code I have published an a little exploring you can build all the items you requested without my help. The arduino platform is simple and learning is part of the fun. Many people have taken my DDS project and expanded on it by learning how to program the arduino.

      To get the AD9851 working in my sketch you should only need to replace one line. Replace my line with this new line: int32_t freq = frequency * 4294967296.0 / 180.0e6;

      73,

      Rich

  35. Hi Rich,
    Thanks for your suggestions and I will try to learn some code programming. Will certainly keep you posted about the modifications/projects if and when I make it. Hope it will be useful to many other hams also through this board.

    73
    DE AB9XC
    (Pravin)

  36. Hi Frank,
    I would like to know how far you succeded in the quadrature VFO design using two AD9850 boards controlled by single Arduino? Any idea what is the W_CLK frequency ?

    73
    DE AB9XC
    (Pravin)

    • Did any one get the two in quadrature? Maybe just use the two outputs and a delay line? Most software will correct for this I’m reading. SDR# ha that function.

  37. Rich,
    I run the new compile the new version of your software and I get a “Rotary redefinition error..
    The newer Rotary library is loaded.
    Windows and Linux
    I compile the old version and it’s fine.

    • Odd problem. I’ve experienced this as well. Make sure you open the file in Arduino Program and then you must save the file, typically in the /mydocuments/Arduino folder (varies by OS). If you don’t save the file before you compile… that error will appear. Also make sure you have the latest version of the Arduino program.

      Rich

  38. Hi Rich,
    I successfully tried your project using Arduino Nano v.3.0. Almost no changes. It works very nice. Thank you very much.
    73′s
    Jiri (OK1DXK)

    • Antero, Make sure you have newest version of Arduino software. You MUST save the new sketch with a valid name and correctly have the libraries imported.
      73,
      Rich
      AD7C

  39. Copy the text from the sketch and paste into a new MS WORD doc. Then copy out of the word doc and paste back into a NEW sketch. There is something that happens to the formatting that WORD fixes automatically (probably line breaks).
    Make sure the libraries are there as others recommended.
    Also here are some links to info on syncing two of these badboys in Quadrature for the SDR IQ system.
    http://www.analog.com/static/imported-files/application_notes/599711852800924681833359689AN-587.pdf

    http://blog.2gn.com/electronics/sync-two-ad9850-dds-modules-from-the-same-clock/

  40. hi great circuit- i built it and works good. i plan on making a small radio. have 1 question- i used a small ebay arduino mini /nano and it dosn’t have a pin a5 for the mf switch so i hooked it up to a3(it only has a0 thru a3). could you tell me were in the program to change a5 to a3? not good at programming yet but having fun learning.

    thanks
    steve

      • Hi Steve.
        Some of the bootleg Arduino Mini’s ‘hide’ the A4 to A7 pins in odd places on the board and often not too clearly screen printed.
        The ones I use have a separate block of holes which are beneath the ICSP connector.
        The bootleg Arduino Nano’s I use have the A4 to A7 in the normal place on one side folowing on from, A0 to A3.
        It is worth noting that some Chinese copies advertised as Nanos are in fact Pro Minis. I’m pretty sure that the easiest way to tell one from the other is that if it has a usb connector it’s a Nano if it doesn’t then it’s a Mini.
        Also check that the ones you buy are using the 328 device as some of the older ones are still floating about out there.
        Slim G4IPZ

  41. Update 15/12/2013

    Incrementally nearer to the final product.

    I’ve got a crude break out of the loops that end the various functions and return to the main menu.
    When A1 goes low the loop should end.
    This works but is a bit hit and miss….

    do{
    buttonstate2 = digitalRead(A1);
    }while (buttonstate2 == HIGH);

    (moved my button2 onto A1 for some reason or other early in the project.)
    I realise that you have be ‘caught’ pressing the button with this method.

    Anyone have a better idea?

    • Project nearly finished – if anyone can help with this one…
      I have put in a rudimentary menu system that allows selection of Sig Gen or Wobbulator.
      Problem is – if you break out of the wobbulator do while loop using the button the button press becomes the select button for the menu system which selects the first option – which is sig gen.

      Anyone know how to stop this from happening?

      This is acting as an escape button…
      do{
      buttonstate2 = digitalRead(A1);
      }while (buttonstate2 == HIGH);

      the button above is the select button as well as escape, so the keypress is caught and selects the first option on the main menu instead of stopping at the main menu.

      Your help appreciated then I can pass on the project to the group here if they want to give it a try.

      I’m thinking of adding a new button for “escape” to break the loops but would prefer not to as the unit is cased up and I’d have to dismantle etc to drill a new hole for another button.

  42. Hi Rich,

    I have been using your original sketch for a while now with no problems but when I uploaded the new Rev 2.0 sketch it still doesn’t remember the last frequency. I’ve started from scratch several times with the same results. Have you any ideas what i’m doing wrong, it works perfect just won’t remember.

    • I am guessing you didn’t see this section in the Sketch… Just change to 0.

      int ForceFreq = 1; // Change this to 0 after you upload and run a working sketch to activate the EEPROM memory. YOU MUST PUT THIS TO 0 AND UPLOAD THE SKETCH AGAIN AFTER STARTING FREQUENCY IS SET!

      73,
      Rich

  43. Hi Rich,
    I have built a multiband BITx Txvr designed by G6LBQ The IF is 10.7 MHz
    I am also in the process of making your DDS vfo, Thankyou for publishing your design) I managed to get the IF offset to work. but is it possible to have it change from addative to subtractive or vice versa when the frequency changes to, say above 10 MHz. Excelent project Thanks……………Peter (GW4ZUA)

  44. Rich
    I just wanted to say thank you for a wonderful website. I just assembled a prototype of the DDS VFO and it works like a champ. I plan to use it with a small amp to make a VFO to replace xtals used in the older transmitters. I am using the IF version so I can offset the sig gen during receive. I haven’t used it yet but I see no reason why it won’t work. Thanks again.
    I modified the code a bit to remove some of the tuning step choices, it was easy to do even for a non coder such as myself.
    Larry Naumann
    n0sa

  45. Great little project, and valuable learning tool. I didn’t get mine to work first time up, but read over the posts and found my problem, for some reason the rotary folder did not have some files when imported. Fixed problem, and now to box it. I just want to say thanks for making the code and help you gave in this project.
    John N8RVE

  46. Hello great work, and thanks for sharing. I am new to arduino and am still playing around with the starter projects. I am wotking on getting this dds working. Once I do i was wondering if there was a way to send an adjustable reset to the dds with another encoder to do burst pulses. Would like to be able to control the total pulse count and space between pulses. I have been trying to figure it out but am so lost. thanks

  47. In my version I have changed the 100 ohm resistor as follows: +5 VCC –10 k–A0—encoder. So I have cured the instability of the encoder. Thanks to YO6OGW for the right advice.

  48. Hi Rich,
    Thank you, I’ve been made the second version by your updated sketch. first try i confusing because the random frequency at 143.XXX.XXX Hz appeared on LCD display, so i read your sketch comments in program line about what we must do double uploading by 1 and 0 changes in sketch. now the DDS is working as I expected, when the system off and on again, the frequency setting still remain on last position.
    I changed the default frequency setting to 3 MHz because right now i do some 80 meter band experiments, and use this DDS VFO with Arduino Control as the frequency generator.
    thank you,

  49. After hitting some bumps (I’m new at Arduino) I have the circuit working on the breadboard. I have a nice waveform of 1V PP, open circuit and 0.5V PP across a 47 Ohm resistor. I can hear a nice strong signal in a receiver across the room. I can see this as a problem when trying to receive signals. I found that the Arduino and/or the AD9850 are too slow to recover from keying the power. I need a way to turn the VFO on while transmitting and off while receiving. Or, shift the frequency out of the receiver band-pass during receive. The 2NT transmitter I want to use has a VFO keying relay that goes to ground during transmit. Anyone have an idea?
    The OK1DXK drawing has a push button bringing pen A5 to ground through a 1k resistor. This is labeled MF Frequency Shift; I can’t see that this does anything. Maybe this is for the IF version of the Sketch?
    Regards,
    Stew ke4yh

    • I’m a little confused? Don’t you use the same DDS for your TX and RX. Are you using a different oscillator during TX/RX? You mentioned you’re worried about RX then say you want to turn if off for TX. I don’t know why you want to turn it off when transmitting. You may want to explain better so the forum can best answer your question.

      RE: A5
      Putting A5 to ground shifts the frequency, at least in my version of the code. The amount of shift is determined by a setting set in the top portion of the code (easily found).

      Rich
      AD7C

  50. Hi Rich,
    I will be using separate RX and TX. Old Drake 2NT TX and R4B RX. If the VFO is running during receive it blocks incoming signals. Right now I’m using the non-IF sketch and perhaps I should be using the IF version so I can off-set the VFO during receive. Is that possible?
    Thanks,
    Stew ke4yh

    • Yes. If you use the IF version you can then utilize the offset to move the frequency anywhere you wish during the receive.

      Rich
      AD7C

  51. Hi,
    I have seen many people use AD7C developed Arduinoi Code with an AD9850 DDS VFO as a LO for HF receivers . But wondering how is the performance of the RX with respect to the sensitivity and spurious rejection especially around the Xtal osillating frequency of 16MHz !! Can anybody enlighten me what happens when we tune to near 16MHz region ? Thanks a lot for Rich for his wonderful code and prompt clarification of doubts.
    (AB9XC)
    Pravin

  52. Hello,
    a few weaks ago i found a new Arduino shield. Beside LCD it also is including an increment encoder and some joystick control:
    ( http://www.elecfreaks.com/wiki/index.php?title=LCD_Key_Shield )
    So my idea was, when using it in conjunction with the chinese DDS module and the UNO, this must be the ideal hardware for the DDS generator project.
    Here you can see my results:
    http://www.kh-gps.de/dds_ad7c_dj7oo.gif
    http://www.kh-gps.de/dds_ad7c_dj7oo.ino

    What else is planned, is also storing the step spacings.

    73 de Klaus, DJ7OO

  53. Hi Rich, great project. Thank you for making this available. My VFO is almost complete. Waiting for parts for the LT1253 buffer amp. I am restoring on old tube Johnson Messenger CB transceiver and converting it to 29 Mhz AM. Crystals are high $$$ now days so this is perfect for a crystal substitute. Having the IF offset will be great as the Johnson wants the receive crystals to be 455 Khz lower than the operating frequency. I will use a relay in the transceivers PTT circuit to operate the A5 switching.
    One thing I was wondering, if anyone has found a good way to CW Key the output? Possibly, this could be added into the Arduino Sketch code or the AD9850 output could be keyed? With some buffer amp and filtering these VFO’s would make nice QRP transmitters. Just need to have a way to plug in a key.
    :-) 73, Randy, W5KCM

    • Well, finally finished my DDS VFO, AD9850 Chinese module Arduino mini. The AD9850 and oscillator module ran very hot on 5 volts. Runs much cooler on 3.3 volts. Used the mod by putting 2 diodes in series with the 5 v supply. Drops the voltage to about 3.4 volts. Built the LM1253 buffer amp and this gives good clean consistent output up to 30 Mhz. Works great.
      Looking for a couple items,
      1. A way to CW key the output ?
      2. A good way to adjust the output level with a pot?
      73, Randy, w5kcm

  54. Hi there Rich. Firstly, thanks for a great and well documented project.
    I am new to Arduino, but I have found it a lot less daunting
    than some other more complex DDS sketches.
    I have changed the code around a little, and added a signal meter, using the lcdbargraph library.
    The past few weeks have been a great learning curve and I,m very pleased with the results.
    I would now like to take this further and add some memory options,but I seem to have hit a brick wall!
    Does anyone have any ideas as a starting point?
    Thanks & 73′s John G8FPN

  55. Hi
    Any one have any ideas please, i cant seem to get the rotary encoder to work, the push button part of it works fine but thats all

    Any ideas please
    Cheers

    • SORTED FOLKS
      Turned out to be that the brand new Rotary encoder i brought had 2 of its pins shorted out with a lump of solder, removed the solder and it now works fine, Many thanks for the design

  56. I’m really impressed with your writing skills
    as well as with the layout on your blog. Is this a paid theme or did you modify it yourself?
    Anyway keep up the nice quality writing, it’s rare to see a nice blog
    like this one these days.

  57. Hi, I have built the VFO exactly as the schematic and double checked wiring, but I am getting a very strange problem. The square and sine waves are not the same frequency as the LED display. Have the same effect on three 9850 modules? when the LCD reads 10.Mhz I get 5.8080 Mhz. At 6.0Mhz on the LCD I am getting 1.80900 Mhz.. At 4.0Mhz I am getting 191.Khz. I have not altered the sketch at all. Any ideas before I pull out more grey hairs, please

    • I would suspect you are using the IF version of the code and the difference in display vs. output frequency is because of the IF offset of 4.192mhz. Did you read my code “readme” file? The IF offset is clearly explained. Just turn it off or use the NON-IF version of the code.

      Rich
      AD7C

  58. I never post comment like this otherwise but i feel i have to complement you for your great work. I have had an AD9850 for a while but i have never come around to doing anything with it until reading this post and the material you have put out for download. Thank you very much! Iĺl throw in a small donation too. Thanks again.

  59. Hi,

    Can we use arduino + AD9850 for an all band VFO lets say in place of a DDS VFOs made using PICs ?? Costruction of the once in you post seems to be a very simple compared to the ones with PICs. I believe only the programming needs to be worked upon for an all band VFO. What are your thoughts around this idea ??

  60. Hello
    Excuse me my English expression.
    I built the VFO. It’s working OK, but introducing the signal in a receiver (mixer NE602, FI Xtal 8 MHy) the reception shows a lot of birdies. I Have not a spctrum analycer, but I think the signal from the AD9850 is very dirty.
    I don’t know it its all OK, but it’s nok working as a VFO in communications receiver
    Any suggestion…?
    Thanks
    Miquel
    EA3H

    • Yes. The AD9850 has a decent output but there are some birdies. However, a lot of people use it in their projects. I believe you need to install a LOW PASS or NOTCH PASS filter on the output to get a clean signal. The higher in frequency you use on the AD9850… the more dirty the output. Anything above 25MHZ has a lot of harmonics.

      Good luck,

      73,

      Rich
      AD7C

      • Thanks for the answer.

        I install a low pass filter (C, L, C, L, C, double pi) and still has a lot of birdies. I think I have samething wrong, because I know the AD9850 is universally used.
        .
        I have not spectrum analycer, that mean I have birdies in reception, but every time, inclusive with the antenna disconnected, The birdie is every KHZ or more…. aggghhh.

        All my receiver and oscillator is Manhattan style, but I have tried to improve the groung connections, and the problem is not solved.

        I am going to be crazy
        Miquel
        EA3HTV

    • Simple. Change the bottom value in the sketch to your desired “low” frequency.

      if (rx >=30000000){rx=rx2;}; // UPPER VFO LIMIT
      if (rx <=1000000){rx=rx2;}; // LOWER VFO LIMIT

      Rich
      AD7C

  61. Dears,

    To make the sketch of Rich working with an AD9851, you have to modify it as follows :

    int32_t freq = frequency * 4294967296.0/180.0e6; (instead of 4294967295/125000000)

    But this is not sufficient. To activate the freq. multiplier in the AD9851, you need also :

    tfr_byte(0×001); (instead of 0×000)

    Regards,

    Gaëtan

  62. I’ve been directed here from the Arduino forum. I’m new to all this. So forgive me if these questions are silly:
    Will you project do the following:
    1) In the ranges of 20 – 30 kHz will the sine wave have a resolution of at least 30Hz steps.
    2) The amplitude of the sine wave should not vary or have little variation as the frequency is changed.
    3) The frequency should not vary over time and remain as fixed as possible.

    Thanks in advance for your help.

    • 20-30khz is just above the audio range. This project was really meant more for Radio Frequencies (RF) rather than audio frequencies (AF).

      1. It can generate a 20-30khz sinusoidal. No problem. The resolution can be as low as 1Hz. Both are up to you. Just change the parameters in my Sketch program to get there.
      2. The amplitude will change as you vary the frequency but at 20-30khz it will be minimal. You would need a buffer if you didn’t want it to change at all. Actually, to hook the output up to just about anything you want to put a buffer circuit on this project anyways. A few people have provided schematics on this forum already but not sure if they will work for AF.
      3. The frequency is fairly fixed (no drift) as it uses a crystal for the clock but ALL crystals drift over time. Unless you are doing something that requires “LAB” accuracy I doubt the drift will bother you.

      Rich
      AD7C

  63. Hi dear, there is a good way to make cheap and effective signal generator. So I have a question; can I get 0,01 Hz resolution from AD9850 ?

    • I don’t have a full sketch but I can tell you the main item you need to adjust is the interrupt. The Nano uses different interrupt pin assignments.
      Your problem is here:
      PCICR |= (1 << PCIE2);
      PCMSK2 |= (1 << PCINT18) | (1 << PCINT19);

      I think you move it to 8 and 9 if I remember correctly.
      Rich
      AD7C

  64. What a great project – thanks so much, Rich!

    I bought a UNO board this afternoon, connected it up to a DDS board and LCD display, loaded your sketch – my first ever – and it ran perfectly first time. Mine is the AD9851 version of the board so I changed the Ref Clock to 180MHz, set the clock multiplier bit, and increased the upper frequency limit to 60MHz

    I aim to turn this into a general purpose shack signal generator, so I wanted to be able to adjust it for frequency accuracy. I put a trimpot from 5v to ground and connected the slider to A1; then used the analog voltage at A1 to adjust the Ref Clock with this simple change:
    int32_t freq = frequency * 4294967295/(179999500+analogRead(A1))

    I’m now working on monitoring the AD9851 output level with an AD8307 driving another UNO analog input so that I can display the output level in dBm alongside the “step size” on the second line of the LCD. That, plus some gain-controlled amplification should make it a very useful instrument.

    Thanks again Rich!

    Steve (G3TXQ)

  65. Schematic is not openening in eagle ,which soft I have to use ???is there any ready PCB design. Available for that it would be helpful.
    What shift I have to use my intermediate frequency is 10mhz .

    • I did not make the eagle schematic so I can’t help. The PDF schematic does open.

      For a 10MHZ if use 10000000 for the IF number in the sketch. Read the instructions!

      Rich
      AD7C

  66. Dear Richard,
    congratulation for your very nice job. I tested it and it works perfectly. I am trying to make some changes in order to add some other functions and a sort of menu.
    I am writing you because I am studing your very clear code.but cannot understand some setups, I found that you used int_fast32_t to declare some main variables (may be double precision), but I couldn’t find any explanation in the Arduino references. Could you please help me to understand. I am not an expert of programmer.
    Many Thanks
    kind regards
    Antonio

  67. Hi Rich,
    what kind of declartion is “int_fast32_t rx=7150000″ and so the others? I couldn’t find any reference on Arduino web site.
    Thank you
    Antonio

  68. Hi Rich,
    I hate to appear a total idiot – but I am at a loss! I have returned to amateur radio / electronics after a break of some 35 years – no valves any more – struggling with Arduino / coding and the little black chips!
    I have built the circuit and uploaded the sketch AD9850_LCD_ROTARY_WMENUS.ino – no characters displayed on the lcd – nothing appears to be happening.
    I have contrast control on the lcd panel but no characters displayed – any clues? Arduino works fine with other sketches.
    Desperately want to make this work as part of a homebrew rig and return to radio.

    Any help much appreciated.

    Charles

    • FYI: Charles was having problems because his Arduino was bad along with a faulty USB cable. CHECK THOSE CHINESE CLONES as sometimes they are duds!

      Rich
      AD7C

  69. Rich,
    I’m back after a 42 years away. Thanks for the project as it work like a champ. Now I just need to build a transmitter to make use of it. I think that I will also have a go at WSPR and QRSS.

  70. Hi Rich, Just made the project with a Nano (Atmega 328).Works fantastic.
    I changed some of the code to cover lower frequencies,(for a general coverage signal gen), also replaced the periods with commas and Mhz to read hz. So reads 7,200,000 hz etc.
    Many thanks, I have been looking at this little DDS board for some time. I was going down the Pic route till I found this.
    Cheers
    John

  71. Hi Rich, glad to see your nice article. I would like to ask you if are there a simple way to test the DDS Ebay modul without a “brain”, like Arduino or something similar, just using a fixed parallel code in the pins made with wires. It could generate just one frequency, useful for tests.
    Regards

  72. hello
    I built the circuit and cant get an output, what does the switch do. I have a pushbutton rotary which you have but I don’t have a switch. is that required to turn on the output?
    I changed the sketch a little for a serial display only using four wires including ground and power, also adjusted the frequency so now from 20Hz to 30MHz
    thanks

    simon

    • The switch is only necessary if you need to use the DDS for an IF type circuit (Intermediate Frequency). If you do not have a switch, you should NOT use the IF version of the sketch.

      Do you get output to the LCD? How are you testing the output… radio, HF receiver, frequency counter, etc??

  73. hello
    im testing it with an oscilloscope, I get a readout to the lcd. I have tested the ad9850 separately using a different sketch, which I think your sketch is based off. it gives me an output.
    I tried measuring the output with a multimeter but when I connected the probes the reading went from 0.43 to 0.00 when the probes touched the pins. I set the meter 2mA setting and it showed 0.43 without touching the probes. then I touched the probes to the pins and it went to 0.00

    • Not sure what to tell you. Double check your wiring and double check the SETUP that you must do in the top part of the sketch. Hundreds of people have downloaded and run this sketch/schematic without problem so it 100% works.
      Good luck,
      Rich
      AD7C

  74. Hi Rich,
    As a novice I was delighted to find this project and get it to work!
    I now hope to build myself 2 of – one for a Signal Generator and the other as a VFO 1 – 30Mhz.
    I forsee problems and would much appreciate your advice ie. I see the need for a buffered, amplified, constant and filtered output for the VFO and a buffered, constant, attenuated and filtered output for the SigGen.
    I couldn’t design a xtal set ! – have you any pointers / circuits which would suit e.g. ALC in-built.

    Best Regards

    Charles

    • Charles,

      A couple of other people on the board have built a buffer amplifier for this project. Just search through this posting and you should find the listings.

      Rich
      AD7C

  75. Hi,The DDS works great! I’m really lost with the programming. The Arduino site helps but I’m totally confused! Can anyone explain line by line what each command means and actually does? Just want to know how it really works.
    Thanks,
    Randy WB4PBS

  76. Rich:

    Thanks for such a nice comprehensive site. My VFO test rigs worked the first time, constructed as shown.

    Time to research the code, and build to my liking.

    73

  77. Hello Rich,
    i’ve just get my dds module..i’m going to use it as vfo for my transceiver project.
    i’ll need to offset frequency output for the IF receiver (455 khz) while PTT is active, i.e i need a pair of TX/RX freq, controlled by the PTT. Since the 9850 has two sine outputs, i’m thinking to add mixer on one of the output, or just to try offsetting by software..what you think..

    Best Regards

    • Suryo,

      If you read my instructions and use the IF version of mysketch everything you require for the 455khz offset is already done.

      Rich
      AD7C

  78. Hello Rich;
    I have been reading all the comments, and tried all kinds of tricks to add/import the rotary library, but the sketch doesn’t verify. It stops at the usual “Rotary r = Rotary(2,3)”. I tried to load the Rotary library automatically and manually, zipped and un-zipped, but no suc6. I run Arduino IDE 1.0.6 on a Mac with OSX 10.5.8.
    Do you, or has anybody else, some suggestions? Is there a way to incorporate the rotary library in the sketch?
    Hope to hear!
    Best regards; Roland, DK.

  79. Hello again Rich;
    Been fiddling with the sketch while waiting for help, and after I changed #include to #include (Capital “R”) the sketch compiled ! :-) Not sure whether that supposed to make the difference, but it worked for me. The problem is solved, so everybody can sleep well again.
    Waiting is now on the rotary KY-040 out of China.
    Can wait to get the vfo working!
    Best regards: Roland, DK.

      • Just to get the record straight, as some of text above disappeared due to the signs in front and after “rotary.h”, I changed #include rotary.h to #include Rotary.h, with a capital “R”.
        Hope this helps other people :-)

    • Read/Follow the schematic provided for this project! The Arduino provides the 5V on a pin. Look at the side rail marked POWER and you’ll see 3.3v, 5v, GND, etc. Grab there.
      AD7C
      Rich

          • Familiar with schematics, but the Arduino is a whole new show for me. I hope this next question isn’t as elementary but here goes:

            On this page and video you show the AD9850 interfaced with the Arduino via a proto-board. For a final build in an enclosure, I can’t see how the AD9850 header pins are supposed to plug into the Arduino header receptacles. Or perhaps the two boards are mounted separately and connected with flying leads instead of headers?

          • AD9850 board is not an Arduino product. You can’t plug them together. You could etch your own daughter board to connect the Arduino to a header set that works with the AD9850 but as you guessed… most just wire up leads.
            Rich
            AD7C

  80. Another question please: I have the same AD9850 board that you depict in the photo. I can see pins GND, D7, WCLK, FQUP, REST, VCC, and I-R on one edge of the board. But on the opposite edge the pins are labelled VO_P, VO_N, GND, OUT, GND, VINN, VINP. Nowhere do I see CLK, Latch, DATA, RST, SQW, SINA, SINB as you explain below your photo. I am wondering where I take the signal off of the 9850 board?

    • Hi Steve, I have exactly the same module which is different from that used by most of the experimenters. The single row of pins are labelled VO_P and VO_N, they do not correlate with anything obvious on the AD9850 data sheet. I assume they are outputs and will find their way back to pins 20 and 21 (analog outputs) of the 9850. There is nothing on the internet that explains what these are. There is a third pin labelled OUT, I assume this is the low pass filtered sine wave. In the absence of any information I plan to build it and look with a scope to see what I get! Did you or anyone else work it out?

  81. Pingback: DDS VFO demo Using AD9850 and Atmega328P | AmoghDesai.com

  82. Nice work!! I am building up a vfo for the W8DIZ Multipig transceiver and will need multiple offsets since it is a single conversion transceiver and works on the 10 ham bands 160-10… I know that you have accounted for offsets but wonder if you have thought about handling multiple offsets like this… Is your code adaptable to this need..

    Steve NU0P

    • The code is very adaptable. Many people have taken my base code and modified it to include RIT, XIT, memory, recall, band switching, etc. Arduino is not hard to learn and the limit really is how much time you wish to put into it. The hardest parts were always controlling the encoder and communicating with the DDS. Since that is done other mods are fairly easy once planned.

      Good Luck!

      Rich
      AD7C

  83. Richard, I am confused…I have downloaded and saved the ad7c_dds_vfo.zip to the arduino program…(I am not a programmer, so I get confused) when I compile the revision 2.0 I get multiple errors the first one has to do with 11th line..
    Rotary r = Rotary (2,3); AD9850_LCD_ROTARY_WMENUS_IF:17: error: ‘Rotary” does not name a type..
    and it goes on from there, what the hell as I doing wrong ?