Page 14 of 21

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 12:21 am
by SteveAndrew
DaveR wrote:My AD9850 and AD9851 modules arrived a couple of days ago, so I tried out the four hex files Steve posted. All four files worked first time when uploaded to my Mega2560 and UNO boards, and the AD9850 works very well indeed. However, there is a problem with the AD9851 in that, although it functions ok under both Arduinos, the output from it is 2/3 that of the frequency set in RSP-SAS, eg setting a spot frequency of 24MHz only produces output at 16MHz, and doing a sweep around 30MHz produces nothing on the screen because the actual sweep is carried out at 20MHz!
The AD9851 uses a 30MHz crystal, and multiplies that by 6 to get the 180MHz clock. It might be worth checking that the crystal is the correct frequency. Given the frequencies that you measured, it looks like the clock might running at 2/3 of the correct value - 20MHz crystal ? I'm using an AD9851 and it works perfectly with the same Hex files you have been using.
DaveR wrote:Doing a search for info on this glitch, I quickly came across this thread on the Arduino.cc forum from someone who had found exactly the same behaviour with the AD9851: https://forum.arduino.cc/index.php?topic=530929.0

i had a look at the link. Somebody posted that by playing around with one of the constants used in the frequency calculation he could get close to the correct frequency. Unfortunately he didn't post any figures, so it's not possible to work out his actual crystal frequency.

What is puzzling is that you have no problems with the AD9850. I know Don-K9AQ could not get his AD9850 to work with any of the Hex files, yet source code he had found did work. I've waiting for an AD9850 module to arrive. When it does, I'll be able to get a better idea of what may be happening.

You say you got two modules, are they the same as the module I post a photo of a few messages back in this thread? If not, would you be able to post a picture of them ?

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 12:49 am
by SteveAndrew
Kees_01 wrote:During developing a sketch to change these frequency settings from a Visual Basic app, I encoutered a limitation of the the Data Type Int(eger) which can handle a value between -32768 en 32767 when you have a 16 bits storage like an Arduino Uno (ATmega based board). I solved this limitation by using the data type Long instead of Int. Then you can extend to a range of -2,147,483,648 to 2,147,483,647. I am not so experienced with programming languages, but it may be causing the frequency shift you encounterd.
I checked the Trackgen code. I'm using an int32_t, which for the Arduino is the same as a Long - 32 bits. I'll have a look over the weekend and see if there is anything I can do that will duplicate the error.

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 2:09 pm
by K9AQ
I am still on my extended camping trip so I haven't been able to test the AD9851 module that I ordered. I should be back home in a couple of weeks, hopefully it will arrive while I am gone.

Don

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 7:46 pm
by DaveR
Hi Steve,

Pics of the two modules I bought :
AD9850 Module.jpg
AD9850 Module.jpg (180.56 KiB) Viewed 22938 times
AD9851 Module.jpg
AD9851 Module.jpg (217.66 KiB) Viewed 22938 times
I think the time difference meant that you missed my second message, when I wondered about the oscillator as well, but having put the scope onto the XO output pin, it's reading a solid 30MHz regardless of the set frequency, so it looks like it's a real 30MHz XO.
AD9851 XO 1.jpg
AD9851 XO 1.jpg (73.22 KiB) Viewed 22938 times
I'm wondering now if the problem lies with the I-R pin being unconnected? I think I read that this pin switches the internal oscillator in or out, but how this leads to a default of 2/3 of the set frequency I haven't a clue. I'm brand new to Arduino stuff, so it's impossible for me to judge whether the problem is with the module itself or its control. Lots of research on my part is needed, I think.

Pics of the output from each module to follow, as I couldn't get them included in this post.

Regards,
Dave

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 8:04 pm
by DaveR
Hi Steve,

Pics of the sine wave outputs from each module - the AD9850 is by far the better of the two!
AD9850 24MHz set, 24MHz out.jpg
AD9850 24MHz set, 24MHz out.jpg (74.65 KiB) Viewed 22938 times
AD9851 24MHz set, 16MHz out.jpg
AD9851 24MHz set, 16MHz out.jpg (77.78 KiB) Viewed 22938 times
AD9851 1.5MHz set, 1.0MHz out.jpg
AD9851 1.5MHz set, 1.0MHz out.jpg (74.11 KiB) Viewed 22938 times
Output Ch 2 on the AD9850 was used for the pic - Ch 1 output looks the same as the AD9851 pic (on which both channels give the same output).

Going by the clarity of the printing on the back of the chip on each module, it did occur to me that the AD9851 chip could well be counterfeit (we shouldn't be surprised if it is!). Loads of fake AD9850 chips were in circulation two or three years ago, I've read - maybe this is why Don can't get his to work?

Regards,
Dave

Re: Feedback for version 0.9a here

Posted: Sat Jul 28, 2018 11:43 pm
by DaveR
Hi Steve,

I found a user manual for the AD9850/51 board that I bought, and the I-R pin is only used for external control of the output amplitude, so has no effect on frequency. The manual can be downloaded here:

ra4nal.qrz.ru/acrobat/ad9851_manual.pdf

Regards,
Dave

Re: Feedback for version 0.9a here

Posted: Sun Jul 29, 2018 4:05 am
by K9AQ
Dave,

I can get my AD9850 module to work with another Arduino app, but not Steve's.

Don

Re: Feedback for version 0.9a here

Posted: Sun Jul 29, 2018 12:56 pm
by Kees_01
DaveR wrote:My AD9850 and AD9851 modules arrived a couple of days ago, so I tried out the four hex files Steve posted. All four files worked first time when uploaded to my Mega2560 and UNO boards, and the AD9850 works very well indeed. However, there is a problem with the AD9851 in that, although it functions ok under both Arduinos, the output from it is 2/3 that of the frequency set in RSP-SAS, eg setting a spot frequency of 24MHz only produces output at 16MHz, and doing a sweep around 30MHz produces nothing on the screen because the actual sweep is carried out at 20MHz! (I discovered this by connecting the AD9851 to an oscilloscope instead of my RSP-1A, after setting the parameters in RSP-SAS.)
Hi Dave,
I am not sure but I think I have found the answer on your issue about the output frequency of your AD9851 chip after reading the facebook page of
Mini-kits.com.au. https://www.facebook.com/minikits/photo ... 860057652/


Regards,
Kees

Re: Feedback for version 0.9a here

Posted: Sun Jul 29, 2018 6:39 pm
by DaveR
Hi Kees_01,

Well, that would confirm my suspicions, even though that post is now five years old. I bet some suppliers still have boxes of them which they are slowly trying to shift! We'll see how good the AliExpress "satisfaction guarantee" is when I report it ...

Regards,
Dave

Re: Feedback for version 0.9a here

Posted: Mon Jul 30, 2018 6:58 pm
by DaveR
Having had a look at Steve's "Don_DDS_Test.zip" file posted on page 10, and knowing now that my AD9851 chip has been "blessed" with a 4x instead of 6x multiplier, I changed the dds.clockFrequency line in the .ino file to 120000000.0 (ie 4x 30MHz), and my AD9851 now outputs the correct set frequency, so this would appear to be a simple way to customise Trackgen, if required. However, the ouput waveform is still hideous, and I doubt that there's any way to correct that!

I've informed my supplier about the problems with the module he sent me, and am now awaiting his response.

Regards,
Dave