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.

ADC122S706

我在使用这个得时候,程序时序程序大概就是这样,怎么出来的数据相当于11位adc的采样结果最大值是2047

程序:

#define lowall P1OUT&=((~BIT1)&(~BIT0));
#define highall P1OUT=~P1OUT;
#define LOW P1OUT&=~BIT1;
#define HIGH P1OUT|= BIT1;
void AD_RX()
{
unsigned char i=0;
temp1=0;temp2=0;
lowall;
for(i=0;i<16;i++)
{
LOW;
if((P1IN&BIT2)==0)
temp1<<=1;
else
{
temp1<<=1;
temp1=temp1+1;
}
if((P1IN&BIT3)==0)
temp2<<=1;
else
{
temp2<<=1;
temp2=temp2+1;
}
HIGH;
}
highall;
HIGH;
}