/*****************************TI提供的代码*****************************/
void TIADC12Init_1( void )
{
ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
// to avoid overflow of results
ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
ADC12MCTL0 |= INCH_0+SREF_2; // ref+=AVcc, channel = A0
ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
ADC12MCTL2 = INCH_2 + EOS; // ref+=AVcc, channel = A2 end seq.
ADC12IE = 0x04; // Enable ADC12IFG.1
}
/********************************开始转换*******************************/
void ADC12Start_1( void )
{
ADC12CTL0 |= ENC;
ADC12CTL0 |= ADC12SC;
_EINT();
}