How to display the real frequency for an AD9850
Good day to all of you !
I have an AD9850 DDS board now and I have to display the real output frequency on a standard LCD .
I saw some programs but they do dispaly the counter content only and not the real output frequency of the 9850.
I am running PICbasic Pro 2.50 .
Thanks in advance for any help.
Best regards,
Ambrogio
Re: How to display the real frequency for an AD9850
The counter content IS the frequency - unlesss the device is defective! Whilst you could use a PIC as a frequency counter you're just adding unnecessary complication and, possible accuracy errors. To use the AD9850 properly you use a filter on the output so any defect in output would be outside the passband anyway therefore (in theory) shouldn't cause problems.
Re: How to display the real frequency for an AD9850
Thanks,
I am just a little bit puzzled: if the alorithm is the following: ( this is an example )
Tuning word for 500kHz = 500000*2^32/125000000 = 17179869 or, in HEX, $010624DD
How could I display 500,000 Hz on the LCD ?
Thanks for helping.
regards,
Ambrogio
Re: How to display the real frequency for an AD9850
Hi,
Well, the basic answer is to take the tuning value and divide it by 2^32/125M or, in this case 17179869/(2^32/125000000) or, in short, 17179869/34.359738 = 500000.
Now, how to do this in PBP depends on if you're able to use LONG variables or not and to what accuracy you need the result. I don't know if you've seen my Wiki-article regarding the AD9850 or not but it describes two possible ways to calculate the tuning value when you know the frequency, it should be pretty straight forward to adapt any of the two methods to do the reverse.
/Henrik.
Re: How to display the real frequency for an AD9850
If you are using keyboard input for frequency selection just port the keypresses directly to the display at the same time you use it in the calculation for register coding.
Re: How to display the real frequency for an AD9850
Kellyseye,
if I enter the output frequency then I have to compute the Tuning word.
If I enter the tuning word I have to compute the frequency to be displayed .
Tell me if I am wrong .
Thanks,
Ambrogio
Re: How to display the real frequency for an AD9850
Thanks Henrik for having understood my problem.
I have seen all your implementations: they are great.
Congratulation.
I can use the LONG variables in PBP.
Thanks
Regards,
Ambrogio
IW2FVO