Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

dual channel ADC conversion

$
0
0

hi everyone, 

 

i'm sampling from single channel ADC and send the data over UART. 

now i need to two channel simultaneously and send the data.

 

for one channel my code is below:

-----------------------------------------------

 ADC10CTL1 = INCH_5 + ADC10DIV_3 ;         // Channel 5, ADC10CLK/4
 ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE;  //Vcc & Vss as reference
 ADC10AE0 |= BIT5;

 ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start, single measure! 

 

while(1)           {
      if(!((P1IN & BUTTON)==BUTTON)) 
      {
         ADC10CTL0 |= ENC + ADC10SC;
         value1 = ADC10MEM>>2; // used only 8 bits of 10bits adc conversion...
 while ((UCA0STAT & UCBUSY)); // Wait if line TX/RX module is busy with data
         UCA0TXBUF = value1;
              }
  }
}
-------------------------------------------------

can you please help me to make following changes...

 

i need to use p1.4 and p1.5 for ADC conversion (two channel), and the ADC referance voltage should be 2.5V or lower.

 

thank you all...


Viewing all articles
Browse latest Browse all 2077

Trending Articles