Call Search
     

New to Ham Radio?
My Profile

Community
Articles
Forums
News
Reviews
Friends Remembered
Strays
Survey Question

Operating
Contesting
DX Cluster Spots
Propagation

Resources
Calendar
Classifieds
Ham Exams
Ham Links
List Archives
News Articles
Product Reviews
QSL Managers

Site Info
eHam Help (FAQ)
Support the site
The eHam Team
Advertising Info
Vision Statement
About eHam.net

   Home   Help Search  
Pages: [1]   Go Down
  Print  
Author Topic: Writing the code for those AD9850/1 DDS VFO modules  (Read 18594 times)
K8AI
Member

Posts: 69




Ignore
« on: September 28, 2012, 11:01:37 AM »

Could anyone help with some example Bascom, assembly, etc. code that will control those DDS IC's such as the AD9850? There's a load of those modules on Ebay that are cheap and I'd like to put one to use as a 5-5.5 MHz VFO but I'm confused about what code controls the frequency, etc.

Here's one of them I'd like to try using:


http://www.ebay.com/itm/New-AD9850-DDS-Signal-Generator-Module-0-40MHz-Test-Equipment-/170783661135?pt=LH_DefaultDomain_0&hash=item27c37fdc4f

Thanks,

Curt, K8AI
Logged
KA4POL
Member

Posts: 2084




Ignore
« Reply #1 on: September 28, 2012, 11:20:42 AM »

Here you can see how to run the module using an Arduino: http://www.elecfreaks.com/2110.html
Logged
AA4PB
Member

Posts: 12980




Ignore
« Reply #2 on: September 28, 2012, 11:59:58 AM »

Here's another option. More expensive but complete with everything you need including a display:

http://www.pongrance.com/super-dds.html
Logged
TANAKASAN
Member

Posts: 933




Ignore
« Reply #3 on: September 29, 2012, 12:34:34 AM »

What's always been confusing to me is that to calculate the tuning word for the AD9851 you need to do some 32-bit math, yet people are controlling them with 8-bit micros. Maybe someone will let us in on the secret.

Tanakasan
Logged
KA4POL
Member

Posts: 2084




Ignore
« Reply #4 on: September 29, 2012, 01:10:09 AM »

There is not much of a secret to this. The 32 bit tuning word is purely internal. To get data into the chip you load 5 times 8 bit. The tuning word is loaded with bytes 2 to 5. The first byte controls phase modulation, power down enable and loading format. You also could load using a 40 bit serial data stream through a single pin.
You see, this is no new technology, just the good old way of splitting data into smaller chunks.
If all else fails, read the data sheet  Wink
Logged
TANAKASAN
Member

Posts: 933




Ignore
« Reply #5 on: September 29, 2012, 02:49:19 PM »

Agreed, but the calculations for that 5 x 8-bit tuning word need some 32-bit math:

Tuning word = (2^32 / DDS clock frequency in Hz) x Wanted Frequency in Hz

Big numbers for eight bits (255 max) and even sixteen bits (16,535 max) will be a struggle. The only way I can think of doing it is a series of stored values in memory rather than do the calculation, but then I ain't a software guy.

Tanakasan
Logged
M0HCN
Member

Posts: 473




Ignore
« Reply #6 on: September 29, 2012, 06:08:07 PM »

The key phrase is 'multiple precision arithmetic', basically you set up 4 bytes for a 32 bit value and use software carry and borrow to allow multiple 8bit operations to emulate a 32 bit multiply (you may wish to google "shift and add multiplication"). 

It is a bit of a pain, but does work (You may want to figure that 2^32 / RefClk is a constant, which makes things a deal easier).

Regards, Dan.
Logged
KA4POL
Member

Posts: 2084




Ignore
« Reply #7 on: September 29, 2012, 10:12:54 PM »

I agree, it is not as straight forward as adding 1 and 1. There are people who have problems with calculating  percentages and others who use surface integrals as early morning exercise.
The fact that there are microcontrollers doing the job proofs that some people did not have major problems. You got to do what you can do best.
Logged
K8AI
Member

Posts: 69




Ignore
« Reply #8 on: October 08, 2012, 01:18:05 PM »

Thanks all. I did find this little tool that will at least help verify tuning word calculations:

http://designtools.analog.com/dtDDSWeb/dtDDSMain.aspx

This op's example code looks like it might help with how to handle the tuning word:

http://members.home.nl/bzijlstra/software/examples/80-40-20.htm


What I'm trying to get working is a 5-5.5MHz DDS VFO with an LED display and tuned with an optical encoder.

I'm your typical ham - I'm cheap. I don't want to use a Basic Stamp, Arduino, some AMQRP module, etc. I'd like to take a cheap little AVR or PIC with this ~$5 DDS module and make a simple VFO and program it with something simple like BASCOM.

For me, it's a big task. I'm not much knowledgeable nor experienced in writing any type of code.
Logged
KA4POL
Member

Posts: 2084




Ignore
« Reply #9 on: October 08, 2012, 10:02:18 PM »

May be some helpful information can also be found at http://kd1jv.qrpradio.com/butterfly/bflydds.HTM where you can download the source code for an AVR Butterfly controller.
Good luck.
Logged
K8AC
Member

Posts: 1477




Ignore
« Reply #10 on: October 16, 2012, 10:27:31 AM »

I suggest you take a look at the IQPro DDS VFO from AA0ZZ.  It uses an AD9854, but Craig compares that to the AD9850 in his documentation.  The documentation and source code are free and the code is all very well documented assembler language.  From your mention of the 5 - 5.5 MHz VFO, I wonder if you're doing that for a piece of Drake gear?  If so, please contact me via email at: k8ac@k8ac.net for lots more info.

73, Floyd - K8AC
Logged
G0MGX
Member

Posts: 39


WWW

Ignore
« Reply #11 on: October 28, 2012, 11:12:20 PM »

Sorry for not being around when the question was posted....

I've done loads of experimentation with the AD9851 and have built a numbe of projects including a signal generator and sweeper for my shack. The code and some other info is all here:

http://g0mgx.blogspot.co.uk/2012/02/dds-running-well.html

On that page you will find links to previous posts on the DDS build, a link to the source code and a demo video of the project running; I used an Arduino board to interface to exactly the AD9851 board you referenced. The code is in C, but is high level enough to read and understand what's going on quite easily if you need to translate into some other language....

Hope this helps.

Mark. G0MGX
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!