I'll preface by saying that I am relatively new to using DDS' - I've only been using the AD9959 for around 2 weeks now. The project I am working on is to build a function generator using the AD9959 and an SPI connection to an Arduino Due (and a 25MHz reference clock).
I have been able to get everything up and running and am able to get any desired single tone frequency by just writing to the registers of the DDS.
Where I am having difficulties is in trying to create a basic frequency sweep - I know how and what to set all the registers to as per the AD9959 datasheet and using the AD9959 eval board software as a guide (Reg Map Debug window).
I believe the issue that I am having is in triggering the sweep - specifically writing to the profile pins (P3 in my case where I am using channel 3 from the DDS) to change their "logic from 0 to 1" which I figured I could accomplish by just writing to the digital output pins I had attached from the arduino to just go high, but unfortuantely this does not work. I believe I am correct in saying that the 'logic from 0 to 1' has nothing to do with the bytes I am sending to my registers, but is something I need toggle outside of the function registers.
I have considered that it may be a clocking issue but I have played around a bit with putting delays in my code to no avail.
Also oddly enough, when I run the attached code, I just get an output of 20MHz, but if I toggle the power of the board (so turn it off and on again) I then get an output of 45.8MHz.
I have attached the arduino code that I am using.
For my hardware connections, Arduino -> DDS (U2 row):
-Pin 10 -> CSB (my slave select pin)
-Pin 9 -> Reset
-Pin 4 -> IO_UPDATE
-SPI MOSI -> SDIO_0
-SPI SCLK -> SCLK
-Pin 6 -> P2
-Pin 7 -> P3
The adjacent pin on the DDS for each of the above is also grounded to the various grounds on the Due board:
-Digital Pin GND: IO_UPDATE + RESET + P3 + P2
-Analog Pin GND: CSB
-SPI GND: SDIO_0 + SCLK
(Using different grounds as for some reason grounding to the same ground on the arduino meant I couldnt get an output FROM the arduino, perhaps due to crosstalk??)
Any and all help will be greatly appreciated.
EDIT: I managed to resolve my issue - the problem was the 1K pull down resistor on the profile pins on the actual PCB board of the DDS. So what was happening is my trigger signal was not strong enough to actually trigger the sweep. I solved this by just putting the arduino output for that pin through a digital buffer and then to the DDS board. My attached code does in fact work fine except for some reason the no-dwell mode does not seem to work.
EDIT 2: Turns out I did not need the buffer, I had stupidly not defined my lines going from the arduino to P3 and P2 on the DDS as being outputs; pinMode(7,OUTPUT) was missing so it was not drawing the required current.