已回答假定已回答

AD2S1210使用问题

Zh-SBW 在 2015-7-29 詢問的問題
最後回覆由color_zz於2017-12-5提供

请教ADI工程师,我按照官方给出的例程更改代码的,现在有以下几个问题

1 芯片默认输出激励频率为10KHZ,这个正确,但是我用配置模式配置为5K 即

WriteToAD2S1210(EXFREQUENCY, 0x14);

  测得频率为23KHz,如果配置为0x50 则为31Khz,这与Datasheet 上面计算不一致。

我只连接例程上用到的几个引脚>CS  ->SCLK  >SDI >A0 >A1 >WR  >SPL  ->RD ->RESET

频率更改是必须断电后重启,才可以更改。

2 串口读不出数据,全部为零,激励信号输出正常,放大后连接旋转变压器激励信号波形失真,但是幅值和频率不变,所以我觉得没问题。sin +- cos+-包络波形有,即在转动电机时可以看到。

下面是我的主要代码

   InitSci();

/*  while(1)

   {

    scia_xmit(4);

    scia_xmit(1);

   }*/

 

  AD2S1210Initiate();

  AD2S1210SelectMode(CONFIG); //Configuration Mode

  WriteToAD2S1210(CONTROL, 0x7F);   //write control register address

 

  ReadFromAD2S1210(CONFIG, CONTROL, buf); //read control register

  scia_xmit(buf[0]);

  WriteToAD2S1210(EXFREQUENCY, 0x14);   //write frequency register address for 5KHz Excitation

  ReadFromAD2S1210(CONFIG, EXFREQUENCY, buf); //read frequency register

  scia_xmit(buf[0]);

  ReadFromAD2S1210(CONFIG, POSITIONMSB, buf); //read position register MSB

  scia_xmit(buf[0]);

  ReadFromAD2S1210(CONFIG, POSITIONLSB, buf); //read position register LSB

  scia_xmit(buf[0]);

  DELAY_US(5);

     WriteToAD2S1210(LOSTHRES, 0x01);   //write LOS register address >0.5V

  ReadFromAD2S1210(CONFIG, LOSTHRES, buf); //read control register

  scia_xmit(buf[0]);

  WriteToAD2S1210(DOSMISTHRES, 0x0D); //write DOS register address >0.5V

// AD2S1210SoftReset();

 

  ReadFromAD2S1210(CONFIG, FAULT, buf); //read/clear fault register

  scia_xmit(buf[0]);

 

  AD2S1210SelectMode(POSITION); //Normal Mode position output

 

  ReadFromAD2S1210(POSITION, POS_VEL, buf); //read data register

  scia_xmit(buf[2]);

  scia_xmit(buf[1]);

  scia_xmit(buf[0]);

  AD2S1210SelectMode(VELOCITY); //Normal Mode velocity output

 

  ReadFromAD2S1210(VELOCITY, POS_VEL, buf); //read data register

  scia_xmit(buf[2]);

  scia_xmit(buf[1]);

  scia_xmit(buf[0]);

 

  while(1)

     {

 

  AD2S1210SelectMode(POSITION); //Normal Mode position output

 

  ReadFromAD2S1210(POSITION, POS_VEL, buf); //read data register

  scia_xmit(buf[2]);

  scia_xmit(buf[1]);

  scia_xmit(buf[0]);

 

 

串口接收到的数据只有在while里面有,之前的接受不到。adi_susan

結果