这里的是初始化的程序,请指点是哪里出现的问题,我采样不出来
void adc_init()
{
P6SEL |=BIT2; // Enable A/D channel A0
ADC12CTL0 = ADC12ON+ADC12SHT0_8+ADC12MSC; // Turn on ADC12, set sampling time
// set multiple sample conversion
ADC12MCTL2=ADC12INCH_2;
ADC12CTL1 = ADC12SHP+ADC12CONSEQ_2; // Use sampling timer, set mode
ADC12IE = 0x04; // Enable ADC12IFG.2
ADC12CTL0 |= ADC12ENC; // Enable conversions
ADC12CTL0 |= ADC12SC; // Start conversion
__bis_SR_register(GIE);
}
中断向量10里面读出ADC12MEM2
case 10:results= ADC12MEM2;
程序一直不能正常运行,请问哪里出现了问题?谢谢指教! |