ADI 技术
直播中

何禄蔓

7年用户 156经验值
私信 关注
[问答]

请问AD7710双通道输出一直为0XFFFFFF是为什么?

最近用到AD7710,发现不管输入信号怎样,两路输出的转换结果一直为0XFFFFFF,不懂什么原因,希望大家帮忙看看,应用电路图如下:

回帖(4)

杨军

2018-9-29 15:52:44
先读读别的寄存器看能读对不
举报

何禄蔓

2018-9-29 16:11:34
引用: 珠海易胜 发表于 2018-9-29 06:42
先读读别的寄存器看能读对不

读控制寄存器也是错误的,可是我看了感觉时序什么的都是对的
以下是我写控制寄存器的程序:
void WriteREG(unsigned long int puke)          //0x209022激活自校准模式   this sub function is to write 24bit data to register
{
  unsigned int flag = 0;
  unsigned int ShiftFlag = 0x0080;
  unsigned int High8 = 0, Low16 = 0, ShiftData = 0;
  int i = 0;
 
 
  High8 = (puke & 0x00FF0000)>>16;
  Low16 = puke & 0x0000FFFF;
 
   *P_IOA_Buffer = *P_IOA_Buffer & 0xFFFE; //set SCLK low
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0010;     //set TFS high
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0008;     //RFS taken high
  *P_IOA_Dir = *P_IOA_Dir | 0x0002;           //to configure SDATA as ouput
  *P_IOA_Attrib = *P_IOA_Attrib | 0x0002;
 
//start to write data to control register
  *P_IOA_Buffer = *P_IOA_Buffer & 0xFFDF;     // A0 set LOW,write control reg
 
  Delay1us();
 
  *P_IOA_Buffer = *P_IOA_Buffer & 0xFFEF;     // TFS set low
 
 
 
  for(i = 0; i<24; i++)
  { 
  if(0 == i)                           //deal with the high 8 bit
  {
  ShiftFlag = 0x0080;
  ShiftData = High8;
  }
  else if(8 == i)                         //deal with the low 16 bit
  {
  ShiftFlag = 0x8000;
  ShiftData = Low16;
  }
  flag = ShiftData & ShiftFlag;
 
 
  if(flag)
  {
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0002;//SDATA=1  0010
// asm("INT OFF");
// Delay1us();
// asm("INT IRQ");
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0001;//SLCK  a rising edge
// asm("INT OFF");
  Delay1us();
// asm("INT IRQ");
  *P_IOA_Buffer = *P_IOA_Buffer & 0xFFFE;//SLCK  a down  edge
  Delay1us();
  }
  else
  {
  *P_IOA_Buffer = *P_IOA_Buffer & 0xFFFD; //SDATA=0
// asm("INT OFF");
// Delay1us();
// asm("INT IRQ");
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0001; //give SCLK a rising edge
// asm("INT OFF");
  Delay1us();
// asm("INT IRQ");
  *P_IOA_Buffer = *P_IOA_Buffer & 0xFFFE;
  Delay1us();
  }
  ShiftFlag = ShiftFlag >> 1;
  }
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0010;   //set TFS high
  *P_IOA_Buffer = *P_IOA_Buffer | 0x0020;   //set A0 high
}
举报

袁飞

2018-9-29 16:19:54
引用: jingfu888 发表于 2018-9-29 07:01
读控制寄存器也是错误的,可是我看了感觉时序什么的都是对的
以下是我写控制寄存器的程序:
void WriteREG(unsigned long int puke)          //0x209022激活自校准模式   this sub function is to write 24bit data to register

问一下,检查过IO的电平适配么
还有SPI的极性是否正确 么
举报

何禄蔓

2018-9-29 16:39:11
引用: 60user105 发表于 2018-9-29 07:10
问一下,检查过IO的电平适配么
还有SPI的极性是否正确 么

检查了下,IO口配置好像有点问题,还在调,有进展跟您保持交流  ~很感谢
举报

更多回帖

发帖
×
20
完善资料,
赚取积分