This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLC2543采集值不对,在基准位2.447V(电压表测出来的)

Other Parts Discussed in Thread: TLC2543

TLC2543采集值不对,在基准位2.447V(电压表测出来的),7脚是信号输入,外部信号通过AD623数据放大再输入,在输入为零时,AD623的5脚电压作为输入信号;

在做实验时输入为零,AD623的5脚加一个0.5878—0.6172V,那么数码管上应该显示984—1033字显示,可是在调节AD623的5脚电压时,显示的AD数就是调不到1000字?这是为什么?

TLC2543驱动函数:

sbit _CS=P3^5;

sbit CLOCK=P3^6;

 sbit EOC=P3^7;

sbit DA_IPUT=P2^4;

sbit DA_OUT=P2^3;

 

unsigned int AD_out()

{  

unsigned char i;  

unsigned int AD_value=0;

 _CS=0;

 CLOCK=0;

 for(i=0;i<12;i++)

 {   DA_OUT=1;  

 _nop_();_nop_();_nop_();  

 CLOCK=1;  

_nop_();_nop_();  

AD_value*=2;  

 if(DA_OUT) AD_value++;  

CLOCK=0;  }  

_CS=1;

 CLOCK=0;  

wait(5);  

if(AD_value>=2)AD_value-=2;

 return(AD_value);

 }

void INIT_2543(unsigned char com)

 {  unsigned char n;

  _CS=0;

 CLOCK=0;

 for(n=0;n<12;n++)

 {   CLOCK=0;  

 if(n<8)

   {  

  DA_IPUT=(bit)(com&0x80);  

  com=com<<1;

  }

  CLOCK=1;

  }

 _nop_();_nop_();

 CLOCK=0;

 _CS=1;  

DA_IPUT=0;

}

unsigned int TLC2543(unsigned char com)

 {  EOC=1;

 _nop_();_nop_();

 INIT_2543(com);

 wait(5);  

while(!EOC);

 return AD_out();

 }