|
回复 板凳 wstt 的帖子
C:\Documents and Settings\Administrator\桌面void Init_AD()
{
P6SEL = 0x08; // Enable A/D channel inputs
ADC12CTL0 = ADC12ON+MSC+SHT0_3; // Turn on ADC12, extend sampling time
// ADC12CTL0 |= REF2_5V; //选用内部参考电压为2.5V
ADC12CTL0 &= ~REFON; //内部参考电压打开
ADC12CTL1 = ADC12SSEL_2+CSTARTADD_3+SHP+CONSEQ_2; // Use sampling timer, repeated sequence conseq_0 conseq_2 single , many
// ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3
ADC12MCTL3=SREF_5;
ADC12CTL0 |= ENC; // Enable conversions
ADC12IE=BIT3;
_EINT();
/*启动ADC*/
ADC12CTL0 |= ENC;
ADC12CTL0 |= ADC12SC; //启动ADC
}
#pragma vector=ADC_VECTOR
__interrupt void AD_IT(void)
{
AD3=ADC12MEM3;
ADC12IFG&=0;
}
中断里 AD3的值 和寄存器 ADC12MEM3的值 怎么不相等啊
还是一样的 我去掉A3的输入量 AD3还是有值 |
|