Richard Visokey – AD7C
Email: ad7c @ arrl . net
I have been playing around with an arduino controlled AD9850 vfo and was looking for other sketches that would load directly into the Arduino sketch program so I could change the code and play with it.
I downloaded your sketch but it won’t open. it requires another program to open. I am not a computer guy so I don’t know how to fix this. could you please help me out? I would like to be able to put it directly into the Arduino sketch program.
Your vfo project looks like a good one and I would like to build it.
Thank’s for your help.
Paul, just to be clear. I hope you realize that after you download my file you have to uncompress it. The .ZIP file is not an Arduino file but a collection of files. The arduino sketch file is inside the .zip.
Also, your email address posted here came back as invalid…so please update if you want me to direct email you.
have found some interesting information on your site! Maybe you can be interested to see some my hobby constructions… I like Arduino project (I have built a rotator controller around it, works fine), but I still prefer “old fashion” single chip controllers, coded in assembler… http://ok1dx.dyndns.org/designs.html
73 Pavel OK1DX
I’m playing around with the DDS VFO, using your code and a board from W5JH with a arduino Nano controller.
When I hook up a higher resolution rotary encoder I get flashing of the LCD when I spin the knob. I’m wondering about updating the LCD on some kind of timer schedule instead of with every frequency change. I haven’t tried it yet. I wonder if maybe a timer interrupt ever few milliseconds to check LCD update would avoid the flashing, just skip all of those updates that I wouldn’t be seeing anyway.
Have you heard of this idea or maybe tried it?
Haven’t run into a ‘flashing issue’. A couple of encoders I tried have some very high res but I am unable to reproduce a flicker. Strange?
… and the LCD only updates when the frequency changes. No change = no update routine.
I’m doing a signal generator project using a AD9850 DDS, Arduino UNO board and a Arduino Shield LCD keypad for my electronics course and I’ve been playing with your AD9850 DDS VFO project.
The problems I have been having are errors with the code i.e. “../Sig.c:574:9: error: request for member ‘OUTCLR’ in something not a structure or union” and the DDS pin name definitions being undeclared.
Have you any ideas as to how i can remove these problems? Once I have the fault I am looking to adapt the program to suit the 6 buttons on the sheild LCD or possibly a keypad. Do you have any suggestions for these changes?
PS. I am an amateur programmer at best
Andrew, Sorry. I can’t be of much assistance. I have never used the LCD Keypad shield so I have no idea of the pin-out or how they work. I suggest starting with my schematic and comparing that to the shield schematic for the LCD and button connection. I believe you find the fault there. My sketch is NOT compatible with the shield. You’ll have to re-write my sketch to work with the shields different pin-out.
hi richard ,
I bought all the parts from ebay for your dds vfo design but I only bought a arduino chinese clone uno not the original arduino uno .
I have connected it all up as per your circuit diagram .
I did have trouble with the rotary library and then got it imported .
I do have it setup in arduino as the arduino uno board type and the correct com port .
the system device manager tells me that it is a “usb serial ch340″ as this is the type of serial chip that has been used on my clones .
I can compile and upload the sketch but the circuit does not work .
nothing happens on the lcd display hd44780 .
I then tried using the examples for
blinking display works ok
1. serial input which monitors digital pin2 as a input , turned on the serial monitor .
I then turned the rotary encoder and could sometimes see the state changing from 1 to 0 as I turned it therefore this works correctly.
2 the example for the Lcd display to show “hello world” . I setup the pins as per your code 12,13,4,5,6,7 (I think it was) and I could not get this one to work .
I am powering the dds, display and encoder off the 5v power built into the arduino itself , is this ok ??
therefore I am just wondering if you now if anyone has been successful in getting it to work with the arduino clone or do you have any more suggestions to help me get it going .
It is such a great design and thanks for your efforts .
I have interested in your AD9850 DDS VFO Project. I need a Arduino sketch program to build an experimental VFO. I need low frequencies, around 30KHz to 100KHz. Could you provide more informations about that?
Marcio – PY3MLS
Nothing to provide. Just build the project. It can go that low in KHz.
I intersted to your project dds . I have a question . Which type arduino do you uesd . In this pase you said arduino Uno but in document said nsno v3 .
I want make your oroject snd I do not know which arduino use.
Best regards , EP4HR , hamid .73
You can use either. But I recommend using an UNO.
Thank you I want make your project .I Iinform you result.
73 de ep4hr
I add rotary.h to arduino but again those massage appear .
You did not correct add the rotary library to the Arduino. Try to save the project with another name and then check that you have imported the library for the rotary controller.
I drag the rotary folder in Ardino libraries
but still there is problem.
I find problem. Your oroject do not work with arduino ver. 1.5.8 so I install arduino ver 1.06 and problem solved.
when I push rotary step frewuency changes but when I rotate rotary both step and frewuency change .
I do not connect 5V to rotary .5V must be connect or not?
Now circuit works. I connect rotary encoder to 5V and last problem solved . Thank you rich,
Hi Rich , very nice work you did . I’m new on Arduino and like to use your VFO to build a 80/40 RTX .In the VFO is the displayed frequenci the base starting frequency – the IF. For my project I need the possibility to switch between 2 base starting freq and 2 IF . I like to do it with a H/L output.
ex : H = 80m = BSF (3.5 MHz ) – IF (870 KHz ) = output 2.6 MHz
L = 40m = BSF ( 7MHz) – IF (4.4MHz ) = output 2.6 MHz
Could this be possible ?
thanks for your work , 73 , Marco
Hi Richard , I have my VFO working now ( on 80 and 40 m ) with all the stuff I need . I used your code and after some learning I was able to adapt your code .
Did you use your project also on a AD9851 ?
It works fine with an ad9851. You just need to adjust the clock frequency divider in my code. simple.
I’m trying to run DSS with ad9850 frequencies from 1.ooHZ up to 300KHz.oo.
Is it maybe possibleand how ? (two decimals are required)
Could you help me please?
Thank you very very much.
Yes. It already can do that. Just remove the frequency limit in the sketch.
I retired due to bad health a couple of years ago and decided I’d have a go with the DDS VFO to keep my mind active
Ive spent a couple of years and have expanded the Code significantly along with a front panel PCB. I have built 10 units which cost me about £45 each. This includes an output to the display showing the band edges which provides an output for switching band pass filters. There is also an input for a bar graph signal strength meter included on the VFO display. Also an RIT and band select switch.
+/- IF offset can be achieved from the front pannel controls. I can only give a taste for what I have done. I gave you the credit for the initial software in the start up screens. If you send me your email address I can send you all the code , PCB layots along with pictures for the project. I am trying to recoup the cost of pcb and parts for the project and am willing to sell at cost + postage. I am advertising on UK ebay.
Thanks again for all you have done, and I hope I can complement your good work
can not find the code for the 9850, only the rotary encoder
am i truly as draft as I feel ?
I have a small 9850 board from ebay , a Mega 256 and want to gnerte 75khz, should be simply
But when I load the library and simple defines to get started i get
rctrlsca1.ino:88:1: error: ‘dds’ does not name a type
code as loaded from examples
#define data_pin 12
#define load_pin A5
#define clock_pin A4
#define clock_hz 120000000LL
dds ddschip(DDS9850, data_pin, load_pin, clock_pin, clock_hz); // set my dds up with
what do I do ?
Can’t help you. That’s not my code. Must be from another program?
Thanks for posting this software and “how to”. I have all my parts wired and ready to go. When I compile the code I get a few errors
“Arduino: 1.6.5 (Linux), Board: “Arduino/Genuino Micro”
AD9850_LCD_ROTARY_WMENUS.ino: In function ‘void setup()’:
AD9850_LCD_ROTARY_WMENUS:43: error: ‘PCIE2′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS:44: error: ‘PCINT18′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS:44: error: ‘PCINT19′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS_IF.ino: At global scope:
AD9850_LCD_ROTARY_WMENUS_IF:17: error: redefinition of ‘Rotary r’
AD9850_LCD_ROTARY_WMENUS:17: error: ‘Rotary r’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:18: error: redefinition of ‘LiquidCrystal lcd’
AD9850_LCD_ROTARY_WMENUS:18: error: ‘LiquidCrystal lcd’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:19: error: redefinition of ‘int_fast32_t rx’
AD9850_LCD_ROTARY_WMENUS:19: error: ‘int_fast32_t rx’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:20: error: redefinition of ‘int_fast32_t rx2′
AD9850_LCD_ROTARY_WMENUS:20: error: ‘int_fast32_t rx2′ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:21: error: redefinition of ‘int_fast32_t increment’
AD9850_LCD_ROTARY_WMENUS:21: error: ‘int_fast32_t increment’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:23: error: redefinition of ‘int buttonstate’
AD9850_LCD_ROTARY_WMENUS:22: error: ‘int buttonstate’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:26: error: redefinition of ‘String hertz’
AD9850_LCD_ROTARY_WMENUS:23: error: ‘String hertz’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:27: error: redefinition of ‘int hertzPosition’
AD9850_LCD_ROTARY_WMENUS:24: error: ‘int hertzPosition’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte ones’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte ones’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte tens’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte tens’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte hundreds’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte hundreds’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte thousands’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte thousands’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte tenthousands’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte tenthousands’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte hundredthousands’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte hundredthousands’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:28: error: redefinition of ‘byte millions’
AD9850_LCD_ROTARY_WMENUS:25: error: ‘byte millions’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:29: error: redefinition of ‘String freq’
AD9850_LCD_ROTARY_WMENUS:26: error: ‘String freq’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:30: error: redefinition of ‘int_fast32_t timepassed’
AD9850_LCD_ROTARY_WMENUS:27: error: ‘int_fast32_t timepassed’ previously declared here
AD9850_LCD_ROTARY_WMENUS_IF:31: error: redefinition of ‘int memstatus’
AD9850_LCD_ROTARY_WMENUS:28: error: ‘int memstatus’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:34: error: redefinition of ‘int ForceFreq’
AD9850_LCD_ROTARY_WMENUS:34: error: ‘int ForceFreq’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void setup()’:
AD9850_LCD_ROTARY_WMENUS_IF:38: error: redefinition of ‘void setup()’
AD9850_LCD_ROTARY_WMENUS:39: error: ‘void setup()’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF:44: error: ‘PCIE2′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS_IF:45: error: ‘PCINT18′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS_IF:45: error: ‘PCINT19′ was not declared in this scope
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void loop()’:
AD9850_LCD_ROTARY_WMENUS_IF:64: error: redefinition of ‘void loop()’
AD9850_LCD_ROTARY_WMENUS:63: error: ‘void loop()’ previously defined here
In file included from /home/User1/arduino-1.6.5-r5/hardware/arduino/avr/cores/arduino/Arduino.h:30:0,
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void PCINT2_vect()’:
AD9850_LCD_ROTARY_WMENUS_IF:108: error: redefinition of ‘void PCINT2_vect()’
AD9850_LCD_ROTARY_WMENUS:84: error: ‘void PCINT2_vect()’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void sendFrequency(double)’:
AD9850_LCD_ROTARY_WMENUS_IF:119: error: redefinition of ‘void sendFrequency(double)’
AD9850_LCD_ROTARY_WMENUS:97: error: ‘void sendFrequency(double)’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void tfr_byte(byte)’:
AD9850_LCD_ROTARY_WMENUS_IF:129: error: redefinition of ‘void tfr_byte(byte)’
AD9850_LCD_ROTARY_WMENUS:106: error: ‘void tfr_byte(byte)’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void setincrement()’:
AD9850_LCD_ROTARY_WMENUS_IF:137: error: redefinition of ‘void setincrement()’
AD9850_LCD_ROTARY_WMENUS:114: error: ‘void setincrement()’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void showFreq()’:
AD9850_LCD_ROTARY_WMENUS_IF:155: error: redefinition of ‘void showFreq()’
AD9850_LCD_ROTARY_WMENUS:132: error: ‘void showFreq()’ previously defined here
AD9850_LCD_ROTARY_WMENUS_IF.ino: In function ‘void storeMEM()’:
AD9850_LCD_ROTARY_WMENUS_IF:181: error: redefinition of ‘void storeMEM()’
AD9850_LCD_ROTARY_WMENUS:158: error: ‘void storeMEM()’ previously defined here
Multiple libraries were found for “rotary.h”
Not used: /home/User1/arduino-1.6.5-r5/libraries/Rotary
‘PCIE2′ was not declared in this scope
This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.”
Would you be so kind as to give me a hand ironing out those problems?
If you do not use an Arduino Uno you have to change the interrupts. It appears you are using a micro. Look through other posts on this board and find what others have done to make the Micro work with my sketch.
Dear friends, I am using Arduino Nano V3.0 and got same issue (error: redefinition of ‘Rotary r’). I didnt find in discussion board how to change interrupts. Ive tried many combinations without success (Rotary r = Rotary(x,y). Can you help me please? Thank you very much. 73 de Felipe PY1IA.
The error you are getting is because you didn’t correctly include the Rotary library files. Fix that 1st.
Then… you can review an older post from this board that contains the info about the NANO.
on September 30, 2014 at 9:11 am said: Edit
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.
I try to compile your arduino dds schets.
I still get a message : Exit status one.
What do I wrong???
Libraries are present ( rotary lcd and eprom)
I found that when you get the Exit Status 1 error that if you use the earlier Arduino program 1.0.6 the code will compile and load into the Uno or Nano. Using the latest version of the program 6.X.X will result in the error.
I was wondering if you ever built a Superhet you once asked me about. I felt bad I didn’t document the schematic. Well, I’ve since built another receiver. This one uses 3 cheap ceramic resonators as the IF filter, an IF IC, etc. The best thing about this unit is a variable AGC. The NE602 is notorious for swamping out with strong signals. This unit uses an op amp off the volume level (slowed down by a cap) amplified and connected to the in input signal of the NE602 which dampens things. Due to the 2 year process of ripping it apart and rebuilding it a thousand times, no schematic for this one either. But the heart of the circuit is your VFO. I wish I could do better with the front end so that I don’t get those reflection/spurious signals.
I am putting together DuWaynes SNAjr II and was trying to find the your rotary encoder file since this library needed to compile the the sketch. Any help is appreciated thanks. K7RSB Ross Bell
Hello Richard ,
I’am Nelu YO9BXE and live in Targoviste ROMANIA.
Your project Arduino DDS VFO-IF is very interesting and it works very well. There’s a small delay from the rotation frequency encode to display but no bother.
I would like to implement a +/- RIT 10kHz. Can you help me? I do not know how to do this alone. If you have an email address I can send multiple images and movies about this project. My email address is firstname.lastname@example.org
Thank for your amability. Best regards , Nelu
There should be almost no delay. You may have a defective encoder.
I have been working on a DDS 9951 project and ran upon something interesting and would like to ask your opinion please. The DDS 9951 software I wrote works fine except for one thing. I find that the RESET logic does not affect the DDS. Shouldn’t taking the logic level LOW-HIGH-LOW-HIGH cover any possible RESET logic requirement? I’ve tried grounding the pin; I’ve tried giving it pulses of H/L L/H and of course all the 3-pulse combinations. Would your opinion be that it must be hardware since I did not build the module and have no way to verify the RESET circuitry. It just seems that RESET does nothing. To get a RESET (and subsequent output), I have to “jockey” the power supply connection while sending it the software-generated setup and tuning words. Once and a while, I will hit it and the DDS starts. Once started, no manner of RESET logic will stop the DDS (reset it). Strange or what? Thank you sir.
Can’t help much. Never used the 9951.
Hello Dear Sir
I made your DDS project as RF signal generator and it work very well . I want use DDS Arduino for a Ham TRX radio and I need more PIN so I use Arduino Mega 2560 but rotary doesn’t work .I know problem is on interrupt but I can solve problem .can you send a rotary code for Arduino mega 2560 .
Best regards ,Hamid EP4HR
Don’t have a mega2560 to test so I can’t write the code.
Sorry Rich because before I see other comment I ask you for Mega2560 .
Nikki answer this question and I change code according Nikki comment and now I work DDS VFO
By Mega 2560 .
Nikki comment is here :
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:
Next you simply want to change the name of the ISR service routine (called ISR) from ISR(PCINT2_vect) to void MyIsr(void).
Best regards Hamid ,EP4HR
Hi, my DDS 9850 works well, however the output freq is a little to high.
Must I increase ore decrease the 125 MHz clock on 9850 in the Arduino code to get the output right ??
Tnx in advance
I made your DDS project running a xtal controlled transmitterr and it work very well.
However the DDS output freq is a little to high.
Do I have to change the 125MHZ freq or the other number up or down to adjust the DDS freq.
int32_t freq = frequency * 4294967295/125000000; // note 125 MHz clock on 9850
Please let me know
Tnx in advance / Greetings KeesJan – Pe1PIC
Change “4294967295″ slightly higher or lower to help calibrate the output of your DDS. Be sure to let your DDS run and warm up for at least 20-30 minutes before calibration.
Hello I am using Arduino genuino/uno.
I tried to load program many times but fail. one times goes good and working fine.
Now I have tried again to load program ad return the following error.
Arduino Ide version 1.8.0
Error is the following:
Arduino:1.8.0 (Windows 7), Scheda:”Arduino/Genuino Uno”
exit status 1
redefinition of ‘Rotary r’
Questo report potrebbe essere più ricco di informazioni abilitando l’opzione
“Mostra un output dettagliato durante la compilazione”
in “File -> Impostazioni”
Can you help me please
You did not load the rotary library. You must import the rotary library into the sketch and then it will compile correctly.
I am planning to build a version of your DDS VFO for an old TS-820S. Have you or anyone else been able to add RIT to the VFO? I’m primary a CW op so RIT is important for me.
73 Bill NZ0T
RIT is completely possible but I don’t know of anyone who has implemented it. It shouldn’t be that hard. You can just use the IF version of my code and rather than have a large IF offset you can have just 1 or 2khz adjustable offset.
Rich, I’m trying to add the capability to control RIT via an analog voltage. I’d like to vary the output frequency + and – 1000Hz when the voltage on the analog pin going from 0 to +5V. I’m a novice with the Arduino. I’ve been told that I need to map the voltage on the pin using something like this:
int rit = map(analogRead(PIN), 0, 1023, -1000, 1000);
Any help is appreciated. Thanks. – Curt, K8AI
I checked your code for AD9851 (your updated version) on 328p. Any changes on the interruption routine?
Not at this time.
I am SOOOO close to getting your DDS VFO up and running……
My trouble is understanding the proper hookup of the rotary encoder.
The encoder I have has 5 pins: GND, +, SW, DT, and CLK.
Your schematic shows the encoder with 5 separate connections; 2 go to ground, and the remaining three connect to the Arduino, but, they are not labeled on the encoder side.
Would you be willing to clarify those pin connections/labels on the encoder so I can hook it up properly? So far, the combinations I have tried are not working….
So very much appreciated, Rich.
Your DDS project has received much attention!! Great stuff!
So excited to get this thing working……
Thanks for the great and very useful project. I am retired and 70 and been a builder for 55 years. Been Using MElabs Picbasic Pro for a decade+ and have built some cool stuff, but the Arduino Family of boards have allowed me to build things that I could only dream of.. and Beyond. I have built the Projects in QST over the last years and found a need for a DDS Signal Generator as I stumbled onto your project. I had all the parts and wired it just like the Schematic and after a few minutes of troubleshooting I got it loaded and working. I had an Old HP step attenuator in 10db steps and put DDS rf into it and could feed my HF rig direct with a pretty low level clean signal. Something I needed. That’s why hams build stuff. Anyhow… Thanks again for empowering us old timers.
Your email address will not be published. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>