AnsweredAssumed Answered

AD9833 output problem

Question asked by SAFWAN on Mar 15, 2018
Latest reply on Mar 20, 2018 by musach

hello

i try to interfacing AD9833 chip with microcontroller
i have a problem that the chip out Random frequencies
this schematic i made it.

 code in mikro c:

 

 

sbit fsync at LATG15_bit;

 

void main()

{

portg.f15=1;

trisg.f15=0;

SPI2_Init_Advanced(_SPI_MASTER, _SPI_16_BIT, 40, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE);

 

delay_ms(100);

fsync=0;
spi2_write(0x2100);
fsync=1;
delay_us(1);
fsync=0;
spi2_write(0x51C7);
fsync=1;
delay_us(1);
fsync=0;
spi2_write(0x4000);
fsync=1;
delay_us(1);
fsync=0;
spi2_write(0xC000);
fsync=1;
delay_us(1);
fsync=0;
spi2_write(0x2000);
fsync=1;

}

 

with this code the output is : 906.7 Hz

is there any problem in code or schematic?

Outcomes