MCU是133,A3接电池分压,A4,A5接两路信号
采用序列单次转换
//multi-channel
ADC12CTL0 |= SHT0_8 + ADC12ON + MSC; //multi-channel
ADC12CTL1 = CONSEQ_1 + SHP; //sequence channel,single sample,use sample timer
ADC12MCTL0 = SREF_0 + INCH_3; //input channel=3,power,Vref+=××CC,Vref-=××SS
ADC12MCTL1 = SREF_0 + INCH_4; //input channel=4,channel2,Vref+=××CC,Vref-=××SS
ADC12MCTL2 = SREF_0 + INCH_5+EOS; //input channel=3,channel1,Vref+=××CC,Vref-=××SS
// ADC12IE |= BIT2; //ena××e int
发现A3,A5正常,A4的值是乱跳的。
调试一下单通道,代码如下
//single-channel
ADC12CTL0 |= SHT0_15 + ADC12ON;
ADC12CTL1 = CONSEQ_0 + SHP + CSTARTADD_0;
ADC12MCTL0 = SREF_0+INCH_3;
// ADC12MCTL0 = SREF_0+INCH_4;
// ADC12MCTL0 = SREF_0+INCH_5;
结果还是一样,A4的值不对。
仔细看了一下A4,A5的区别,两路信号经过相同的模拟电路进来,
不同的是,A4的放大电路都焊好;
而A4是直接挂的1.25V的电平。
难道是430的ADC输入通道还有要求? |