|
adc10转换开始之后读不到ADC10MEM的值?求助
[复制链接]
void main(void)
{
WDTCTL = WDTPW+WDTHOLD; //关闭看门狗
LCD_init_first();
LCD_init(); //复位1602液晶
LCD_write_string(2,0,tishi); //显示提示信息
LCD_write_char(11,1,'V'); //显示电压单位
ADC10CTL1 |= CONSEQ_0;
ADC10CTL0 |= SREF_1+REFON+REF2_5V;
ADC10CTL0 |= ADC10SHT_3 + MSC;
ADC10CTL1 |= ADC10SSEL_1 + ADC10DIV_1 + SHS_0;
ADC10CTL1 |= INCH_1 ;
ADC10CTL0 |= ADC10ON;
ADC10AE0 |= BIT1;
for(i=0;i
{
ADC10CTL0 |= ADC10IE + ENC + ADC10SC;
while((ADC10CTL0&ADC10IFG)==0);
result+=ADC10MEM;
}
result>>=5;
Trans_val(result);
}
主函数如上,运行到倒数第六行就运行不下去了,这是为什么呢求助
|
|