是用内部AD采样,参考电压用内部参考电压2.0V
//P6口,P6.4~7 (A4~A7) 4-20mA电流 采集输入
P6SEL = 0XF0;
P6DIR = 0X00;
P6OUT = 0;
///////////
REFCTL0 = REFON + REFTCOFF + REFMSTR + REFVSEL_1;
ADC12CTL0 = ADC12SHT0_2 + ADC12MSC + ADC12ON;
ADC12CTL1 = ADC12CSTARTADD_4+ ADC12SHP + ADC12CONSEQ_3;
ADC12CTL2 = ADC12RES_2;
现在问题是为什么没有加任何电压的情况下,A4~A7引脚上有1.4V-1.5V电压 |