AD9850 + Arduino Uno (Problem...Please Help)

Im newbie. I buy AD9850 as like at the picture

Im try to connect AD9850 to my UNO :

***. Using digital pins 8 through 11, proto shield installed on the UNO. Pin 8 to CLK, 9 to FQ, 10 to DATA, and 11 to RST. ***

and the sketch here:

/*

#define W_CLK 8 // Pin 8 - connect to AD9850 module word load clock pin (CLK)
#define FQ_UD 9 // Pin 9 - connect to freq update pin (FQ)
#define DATA 10 // Pin 10 - connect to serial data load pin (DATA)
#define RESET 11 // Pin 11 - connect to reset pin (RST).

#define pulseHigh(pin) {digitalWrite(pin, HIGH); digitalWrite(pin, LOW); }

// transfers a byte, a bit at a time, LSB first to the 9850 via serial DATA line
void tfr_byte(byte data)
{
for (int i=0; i<8; i++, data>>=1) {
digitalWrite(DATA, data & 0x01);
pulseHigh(W_CLK); //after each bit sent, CLK is pulsed high
}
}

// frequency calc from datasheet page 8 = * /2^32
void sendFrequency(double frequency) {
int32_t freq = frequency * 4294967295/125000000; // note 125 MHz clock on 9850
for (int b=0; b<4; b++, freq>>=8) {
tfr_byte(freq & 0xFF);
}
tfr_byte(0x000); // Final control byte, all 0 for 9850 chip
pulseHigh(FQ_UD); // Done! Should see output
}

void setup() {
// configure arduino data pins for output
pinMode(FQ_UD, OUTPUT);
pinMode(W_CLK, OUTPUT);
pinMode(DATA, OUTPUT);
pinMode(RESET, OUTPUT);

pulseHigh(RESET);
pulseHigh(W_CLK);
pulseHigh(FQ_UD); // this pulse enables serial mode - Datasheet page 12 figure 10
}

void loop() {
sendFrequency(10.e6); // freq
while(1);
}


Note_1: Im upload the sketch to my arduino uno and success uploaded. Then im using counter frequency and my SDR Transceiver as receiver in 10 Mhz.

Problem: Why when I run the Arduino + AD9850, on my SDR nothing signal receive in 10Mhz - 10.5 Mhz and my counter not response the transmit signal.

Note_2: Can someone try teaching me to solve the problem and where is the wrong (in wiring and sketch ?) because I want run the AD9850 in Freq 7.030 Mhz.

Im waiting your response.

Thank You
John

Try I2C connection instead of parallel,,,,

On the Arduino UNO the 'double' is the same as 'float' and only supports 6 or 7 significant digits. You are going to lose some of the digits when you multiply a long integer with 10 significant digits by a float.

Try printing out 'freq' after you have calculated it. If the answer is not 343597383 then you are getting round-off errors.
I don't know how far off the frequency might be.

johnwasser:
On the Arduino UNO the ‘double’ is the same as ‘float’ and only supports 6 or 7 significant digits. You are going to lose some of the digits when you multiply a long integer with 10 significant digits by a float.

Try printing out ‘freq’ after you have calculated it. If the answer is not 343597383 then you are getting round-off errors.
I don’t know how far off the frequency might be.

Dear JohnWasser, Im not understand do you mean about 6 or 7 significant digit, may you explain me shortly and see the sketch which must I change and can you help me to revise or make correction about my sketch because I want to transmit at 7.030 Mhz. Im really need explain and correction sketch.

John

123Splat:
Try I2C connection instead of parallel,,,,

Dear 123splat,

What mean instead of paralel I2C ? Can you help me to check the sketch and helping me to make correction my sketch because I want my wspr transmit in 7.030 Mhz. Im newbie and need guide from all of senior here.

Thank you
John

Anyone please help me to correction my sketch and ad9850 ==>> Arduino Uno Pin Out.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks...Tom.. :slight_smile:

Hi TomGeorge;

Here the Schematic. Please help me to make correction whats wrong with my schematic of my sketch. I want transmit in 7.030 Mhz by using RTL SDR as receiver monitor.

Nobody can help you, as long as you don't understand what you are told :frowning:

Start learning more about basic things, like variable types and their value ranges, and how to add debug output to your code. Or pay somebody to make your project work as it must be done, not as you think it should be done.

This seems to be the article.
http://nr8o.dhlpilotcentral.com/?p=83
Had a quick look through it.
Serial only seems to be used to enter some digits for the frequency.
Leo..