AnsweredAssumed Answered

PROBLEM IN PROGRAMMING AD9912.

Question asked by arunka on Sep 30, 2016
Latest reply on Apr 26, 2017 by arunkuttath

Hi

I would like to ask you a question regarding the initial bring up of AD9912.

 

when i tried to communicate with AD9912 its not responding. i just tried to read a register of DDS, but i cant get any responds from DDS. i used SPI communication and upto 5MHZ speed. The Crystal clock freq is 25MHZ.The RESET ,POWER DOWN and IOUPDATE pins are not floarting and we tried for the buffer,live and Read Only registers to readout their values.

i just made a circuit of DDS and tried to bring up using the below code. im adding the basic code that i tried to implement. 

please help me.

 

//FCY 10Mhz
void DDS_reset()
{
DDS_rst = 1;
__delay_us(50);
DDS_rst = 0;
__delay_us(50);

}
//------------------------------------------------------------------------------
void DDS_IO_UPDATE()
{
DDS_IO_UP = 0;
__delay_us(10);
DDS_IO_UP = 1;
__delay_us(10);
}
//------------------------------------------------------------------------------
void write_DDS(unsigned char addr,unsigned char data)
{
DDSgen2_CSB = 0;
SPI1_TX_RX(0x00);
SPI1_TX_RX(addr);
SPI1_TX_RX(data);
DDSgen2_CSB = 1;
}
//------------------------------------------------------------------------------
int main()
{
__delay_ms(3000);
port_init();
pps_init();
uart1_init();
SPI1_init();


DDS_PWRDWN = 0;
DDS_reset();
DDS_IO_UPDATE();

write_DDS(0x00,0b10000001);
write_DDS(0x05,0b00000001);

unsigned char data=0;
while(1)
{
DDSgen2_CSB = 0;
SPI1_TX_RX(0b10100000);
SPI1_TX_RX(0x03);
data = SPI1_TX_RX(0);
data = data<<8 | SPI1_TX_RX(0);
DDSgen2_CSB = 1;
printf("PART ID = %x\n",data);
led_blink(50);
}
while(1) Idle();
}

 

I am also adding the schematic screen shot too.

JLKeip

Attachments

Outcomes