adc12位转换用的是 多通道序列
关键的初始化为:
ADC12CTL0 = ADC12ON+SHT0_2+REFON+REF2_5V;
ADC12CTL1 = ADC12SSEL_1+SHP+CONSEQ_1;
ADC12MCTL0 = INCH_0+SREF_1;
ADC12MCTL1 = INCH_1+ SREF_1+EOS ;
主程序里头相关的程序
while (1)
{
ADC12CTL0 |= ADC12SC;
while ((ADC12IFG & BIT0)==0);
A0results[index] = ADC12MEM0;
while ((ADC12IFG & BIT1)==0);
A1results[index] = ADC12MEM1;
}
问题在读到 ADC12MEM0后 走不下去了,执行完ADC12CTL0 |= ADC12SC;看了寄存器发现
ADC12IFG=0X01;
不知道是为什么?
此帖出自
小平头技术问答
一周热门 更多>