测量输入电压后,程序显示的转换的结果与采用公式计算的结果不符,并且在不同的输入电压下,AD转换的结果并非线性关系
void main(void)
{
WDTCTL = WDTPW+WDTHOLD;
P6SEL |= 0x04;
ADC12CTL0 = 0x0270;
ADC12CTL1 = SHP;
ADC12MCTL0 = 0x02;
ADC12IE = 0x01;
ADC12CTL0 |= ENC;
_EINT();
while(1)
{
ADC12CTL0 |= ADC12SC;
_BIS_SR(LPM0_bits);
}
}
interrupt[ADC_VECTOR] void ADC12ISR (void)
{
results = ADC12MEM0;
_BIC_SR_IRQ(LPM0_bits);
} |