Hi Folks. Thanks a lot for the inputs! I'm still digesting how to use the code snip-its provided.

I also noticed the 2^32 calculation and sent the update (int32_t freq = frequency * 4294967296LL/125000000L;). My freq counter is limited to 10 Hz resolution , so perhaps I am just not able to measure the difference - the output is 9,999,96 Hz when set to 10 MHz output. I'll have to dig out another counter...

I see what you're saying pito, thanks.

I'm still trying to get the faster code to run, and also played with putting the sendfreq call in an encoder interrupt, and that did nothing?

Is this not the control word in the array: dataArray[4] = 0x000; // Final control byte, all 0 for 9850 chip

The formula does seem messed up, not only the value. I'm surprised I'm getting output. I'll change that tonight and see how it pans out, but, is it not this way because we are calculating the tuning word value based on frequency? And there was something about the largest 32-bit integer value being 2^32-1.

I know decimal math, if I plug in a tuning word value of "1", I get a frequency value of 0.0291, which is the minimum frequency resolution of the DDS (spec). If the tuning word value is 34.35974, the frequency value is 1. If the tuning word value is 0, then I suspect DC output?

Again, simply verify your DDSword calculation (see my post above). When it is correct (it MUST be the same as the calc result on the ADI page above), try to pass it to the DDS chip.

Do NOT expect you will see an accurate DDS output frequency on the freqmeter, because you do NOT know the actual frequency of your 125MHz DDSclock. It could be 125.009.447,786 Hz - this DDSclock needs to be

a) measured by the freqmeter and its value has to be changed in the code accordingly, or,

b) "calibration mode": set the DDSfreq to ie. 10.000.000Hz output, pass it to DDS chip, do measure the DDS output freq (you may see something like "9.997.234Hz"), and do change the DDSclock value such until you see "10.000.000Hz" on the freqmeter (provided your freqmeter is precise enough), and do save the new DDSclock value somewhere.

I used that "calibration" mode with my DDS stuff I did long time back (so I did not care what the actual DDSclock freq was like, and, the actual DDSclock hex value was saved into an EEPROM after the calibration - btw. you can do the calibration anytime then, even when your DDS generator is already built into a nice shiny case )..

int32_t freq = frequency * 4294967296LL/125000000L;This calculates the tuning word (given the misleading variable name "freq" here) from the desired frequency. The tuning word is then sent to the device.