For Hal & Andre

Terry Fox tfox at knology.net
Tue Nov 18 23:16:05 CST 2014


Hey guys.
Regarding the master oscillator used with DDS devices (for your frequency 
hopper project), there are a several ways often used to calibrate the DDS 
output frequency, which depends on the master oscillator.  Here are a couple 
of the more popular, some simple.

One is to use a highly accurate master oscillator.  If you calibrate the 
master oscillator to a GPS or rubidium standard ONCE, and it is stable with 
temperature or voltage variations (or you apply a tuning voltage depended on 
a calibrated voltage and/or temperature variation chart), that should be OK. 
But, that requires an expensive oscillator and time to do all that 
calibration.

Another is to use a tunable master oscillator with a PLL that constantly 
disciplines that oscillator against a standard, again a GPS or rubidium 
reference.  Some amateur radio groups (Softrock, QRP, SDR Widget, others) 
have been experimenting with an inexpensive GPS device, a UBLOX NEO-7M (or 
NEO-7N).  These are available from ebay for about $20 or so.  A cheap 
TTL-to_RS232 level shifter is usually used to communicate with the NEO-7.

The NEO-7 does not create a great 10MHz reference, as its internal 
oscillator is not evenly divisible by 10MHz.  But, there are certain 
frequencies that it can be programmed to provide a nice frequency with very 
little jitter.  Match that freq to the divided master oscillator freq, and 
feed them into a comparator.

My personal preference, and the simplest (hardware), is to NOT try and tune 
the master oscillator.  Instead, figure out what the ACTUAL frequency of the 
master oscillator is, and change the DDS FTW (Frequency Tuning Word) 
calculation to use that frequency instead of a "plugged" nominal frequency. 
To calibrate, you tune the DDS to a reference frequency, then adjust the 
master oscillator value in your FTW calculation routine until the DDS output 
matches the reference frequency.  Obviously, the reference can be at any 
frequency that you can tune the DDS output to, but (within limits) the 
higher the reference freq, the better.  I usually use 10MHz, as I can 
calibrate against either my rubidium reference or my GPS disciplined 
oscillator.  I usually use a dual-trace  oscilloscope with one input (and 
the trigger) being the reference and the other being the DDS output.  Adjust 
the master oscillator frequency (or fudge factror) value in the FTW 
calculation loop while watching a few cycles of the two traces until they do 
not move in relation to each other.

You could also build a simple hardware frequency comparator (like the phase 
comparator in a PLL) that lights LEDs for too high, close to correct 
frequency, and too low.  Adjust the master oscillator value until the "close 
to correct" light stays on (or off) for long periods.

After that, if you are concerned about frequency drift, you can add 
temperature and/or voltage monitoring on the Arduino, and do a simple 
calibration of freq vs temp, or freq vs voltage.  Or, you can live with the 
drift to start with.

Since a DDS FTW calculation is typically: ((2^32/ master oscillator) * 
output freq)  (all in Hertz),
I usually add a signed value "calibration value" (or fudge factor) to the 
master oscillator number before dividing the 2^32 by it.  That calculation 
only needs to be done once, then stored, as long as the master oscillator 
frequency doesn't need to be adjusted.  On some DDS chips, you can get 
sub-Hertz accuracy, but that complicates the calculations, and is probably 
not worth doing, especially with an Arduino.  This first calculation will 
give you the FTW for 1Hz.

So, to change the DDS output frequency, just multiply the result of the 
previous step (FTW for 1Hz) by the wanted frequency (in Hertz), and you have 
your FTW to send to the DDS chip.

I store both the nominal master oscillator frequency and the fudge factor 
separately in the Arduino EEPROM area, so I can recall them separately and 
adjust as necessary.  There are other ideas if you want to get fancy 
(multiple DDS chips, etc).

One other factor with the Arduino is that it doesn't have doubles.  Some 
people use single floats, which loose a little accuracy.  Others use 
long-long integers, which are 64-bits.  I've done both.  I've also developed 
special 64-bit assembly math routines to do these specific calculations for 
PIC chips when we were messing with the AD995x on the David Brainerd boards. 
Trying to maintain 32 bits of accuracy is beyond the Arduino math libraries. 
I might be able to find my old PIC code, which could be translated to C. 
But again, that amount of accuracy may not be necessary.

Another caveat on the Chinese AD9850 modules is that the output low-pass 
filter is NOT correct, and will not be properly filtering for 125MHz.  It 
was discovered that the values on the Chinese DDS modules are actually for 
the slightly more expensive DDS modules that use the AD9851.  The master 
clock on the AD9851 modules is 30MHz, which is multiplied by six internally 
in the AD9851 to 180MHz DDS clock.  Both types of Chinese DDS modules (D9850 
and AD9851) use the same filter components, the ones for 180MHz.

So, there are actually three types of Chinese DDS modules:
The AD9850 (125MHz) with the small pot and small oscillator
The AD9850 (125MHz) with a larger pot and oscillator can
The AD9851 (180MHz) with the small pot and small 30MHz oscillator

The AD9851 modules are more expensive, but may be worth it, as they can go 
higher in frequency before exhibiting too many artifacts.  There is only a 
one-bit change (to turn ON the *6 PLL) in the commands sent to the AD9851. 
The AD9851 does take more current when the PLL is enabled.

You can also put a couple of small power resistors and some insulation 
around the oscillator can, and create a small oven-like thing around it. 
Then, let it stabilize before calibrating it.  This might help some, but BE 
SURE not to cover or heat up the DDS chip.  The AD9850 was an 
early-generation DDS, and takes a LOT more power than the AD983x or AD995x 
series.  But, they are cheap!

All of the above is from memory, after the Tuesday night tech session.  I 
can expand (or correct) as necessary.
73, Terry, WB4JFI




More information about the Tacos mailing list