need help in ad9833 programing

Status
Not open for further replies.

ud23

Advanced Member level 3
Joined
Apr 20, 2011
Messages
926
Helped
185
Reputation
370
Reaction score
180
Trophy points
1,323
Visit site
Activity points
6,138
hi i am using ad9833 for sine wave generator with 89s52 micro controller i am getting 2 channel sine wave and after changing frequency i am getting same frequency not Chang in also frequency getting constant 90k frequency.
 

Hi,

Seems quiet a complicated programming proceedure , easy to get wrong.

Have you tried to get it working with a different frequency when starting up - it might be you are activating it but it is just defaulting to 90khz and your second attempt to change it is having no effect.

Seems a few sites using the chip if you google it.
 

Hi,

I have some Chinese source code for the AT89S52 with routines for controlling the AD9833. The original files were filed with unicode Chinese comments, which is why the comments are now filled with '?' characters.

Hope it helps solve your problem.
 

Attachments

  • C51_AD9833.zip
    4.1 KB · Views: 91

thanx for your post and help but still having problem frequency remains same not changing
here my code


#include <reg51.h>
sbit dds_clk=P3^1;

sbit dds_dat=P3^0;

sbit dds_en=P3^2;
unsigned char control;
void delay(unsigned int T)
{
while(T){
T--;
}
}
void write_2byte(unsigned int a){ //write 2 byte to dds
unsigned char i ;
dds_clk=1;
dds_dat=1;
dds_en=1;
// control=0;
delay(1000);
dds_clk=1;
delay(2);
dds_en=0;
for(i=0;i<16;i++){
if(a&0x8000)
{dds_dat=1;}
else
{dds_dat=0;}
dds_clk=0;
delay(5);
dds_clk=1;
a=a<<1;
dds_dat=0;
}
delay(2);
dds_en=1;
dds_clk=0;
delay(1000);
// control=1;
}

void init_dds(void){
write_2byte(0x2100);
// write_2byte(0x2000);
// write_2byte(0x4219);
// write_2byte(0x4000);
write_2byte(0x8219);
write_2byte(0x8000);
write_2byte(0xC000);
write_2byte(0xE000);
write_2byte(0x2000);

}
void main()

{
init_dds();


}
 

Looks like the answer lies in these two routines:


I do not have the datasheet for the AD9833 handy, but you should be able to make sense of the command and data sent to the device.

Try sending the same commands and data in the routines above to the AD9833 and see if you can get a frequency change.
 

hi i am having too much offset voltage and still getting double channel out put so do i need filter my input signal from controller?If yes which type filter is suited for it?
 

I'll need to see a schematic of your current design. Can you post or upload it?

So are you now able to change the frequency?
 

i am see change in frequency not sure its true or not output duty cycle veried too much. see attachments have look in ad9833 section
 

Attachments

  • schematic dia.pdf
    34.4 KB · Views: 107

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…