已回答假定已回答

AD9915无输出

fish_popo 在 2014-2-24 詢問的問題
最後回覆由chyw12於2014-3-3提供

你好,我现在有一款关于AD9915的应用,原理图如下

AD9915.jpg

程序代码如下:

/*延时程序*/
void SDelay(int32 len)
{
while(len>=0)
{
  len--;
}
}
/*AD9915复位*/
void ResetAd9915()
{
RESET_H;
Delay(10000);
RESET_L;
SCLOCK_L;
ST1_H;
FUD_L;
}
/*AD9915 FUD信号*/
void WriteSCBandFUD()
{
ST1_H;
FUD_L;
FUD_H;
SDelay(500);
FUD_L;
SDelay(500);
}
/*AD9915写一字节程序*/
void Write1Byte(uint8 byte)
{
uint8 temp1 = 0x80;
uint32 i;
ST1_L;
SDI_L;
for(i=0 ; i<8 ; i++)
{
  if((byte&temp1) == 0x0)   SDI_L;
  else            SDI_H;
  SCLOCK_L;
  SDelay(10);
  SCLOCK_H;
  SDelay(10);
  SCLOCK_L;
  temp1 = temp1>>1;
}
temp1 = 0x80;
}
/*AD9915写五字节程序*/
void Write5Byte(uint8 addr,
        uint8 byte0,
        uint8 byte1,
        uint8 byte2,
        uint8 byte3)
{
  Write1Byte(addr);
  Write1Byte(byte0);
   Write1Byte(byte1);
   Write1Byte(byte2);
   Write1Byte(byte3);
   WriteSCBandFUD();
}

/*AD9915初始化程序*/
void InitAd9915()
{
ST1_L;
Write5Byte(0x00,0x00,0x01,0x00,0x08);
Write5Byte(0x01,0x00,0x00,0x09,0x00);
Write5Byte(0x02,0x00,0x00,0x19,0x1c);
Write5Byte(0x03,0x01,0x05,0x31,0x20);
Write5Byte(0x03,0x00,0x05,0x31,0x20);
Write5Byte(0x0b,0x21,0xea,0x35,0x93);
Write5Byte(0x0c,0x00,0x00,0x00,0x00);
ST1_H;
}

/*频率改变,对应AD9915输出频率改变的算法*/
void Change_Freq(void)
{
uint32 nFreq,nFref;
uint8 d0,d1,d2,d3;
nFreq = (fp64)(Frequency - Freq_L);
if (nFreq<1500000)
  nFref = (nFreq/100000.0 + 41.4)*9162596;        //nFref = (nFreq/100000.0 + 41.4)*16/3*1717986,这里鉴相频率为输出频率除以3,即为DDS的输出频率,1717986为POWER(2,32)/2500M
else
  nFref = (nFreq/100000.0 + 41.4)*6871947;        //nFref = (nFreq/100000.0 + 41.4)*16/4*1717986这里鉴相频率为输出频率除以4,即为DDS的输出频率,
d0 = nFref & 0xff;
d1 = (nFref>>8)&0xff;
d2 = (nFref>>16)&0xff;
d3 = (nFref>>24)&0xff;
ST1_L;
Write5Byte(0x0B,d3,d2,d1,d0);
  ST1_H;
}

 

 

 

但是最终无输出,想请教专家是何原因?谢谢

結果