Hi everyone,
I had a problem about adc12 single channel single conversation modes. I cannot read A1,A2,A3... just can read A0 when i select single channel mode i cannot configure it. Accualy I dont want to use interrupt services , start the conversion wait them finish and save the result. But first need read A1,A2,A3... with single channel single conversation. here is my code ;
int main(void)
{
P6SEL |= 0x02; // P6.1 ADC option select
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC12CTL0 = SHT0_2 + ADC12ON +ENC+CSTARTADD_1; // Set sampling time, turn on ADC12
ADC12CTL1 = SHP; // Use sampling timer
ADC12MCTL1 = INCH_1;
ADC12IE = 0x02; // Enable interrupt
ADC12CTL0 |= ADC12SC; // start conversion
while(1){
ADC12CTL0 |= ADC12SC;
}
}
#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR (void)
{
int a;
a = ADC12MEM1;
}