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.

请教专家关于lunchpad msp430g2231的ADC10问题,谢谢

问题代码

void init(void)   //ADC10

{

ADC10CTL0&=~ENC;

ADC10CTL1=INCH_0+CONSEQ_0;

ADC10CTL0=SREF_1+ADC10SHT_2+REF2_5V+ADC10ON;

for(unsigned char i=255;i>0;i--);

ADC10AE0=0x01;  //P0.1 ADC输入

}

t=0;

     ADC10CTL0&=~ADC10IFG;

     ADC10CTL0|=ENC+ADC10SC;

     __delay_cycles(10);

     while(!(ADC10CTL0&ADC10IFG));

    t=ADC10MEM;

    data_converter(display_buffer,t);      //数据变换

 send_data(display_buffer); //发送数据软件模拟UART

__delay_cycles(20);

但是在串口老是收到1023这个数

不知道那里错了

谢谢解答