This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unwanted voltages on ADC(A3,A6,A7) with UART communication in msp430f2254

Other Parts Discussed in Thread: MSP430F2254

Hi,

     In my application iam sending the ADC voltages through UART communication, here the problem is, with out UART initialisation the ADC's perfectly working, but while initialising UART by default the ADC pins getting 3.2 Volts(VCC).

Can any one help me out , why these voltage are coming on those pins (A3,A6,A7)  with UART initialisation.below is my UART initilisation code.

 

 void serial_init()
  {
  
    P3SEL =  0x00;                            // configuring as GPIO pins
    P3DIR =  0xFF;
    P3SEL |= 0x30;                            // port3 4,5 are configured as uart
    P3OUT =  0xc0;                            //
    UCA0CTL1 |= UCSWRST;
    BCSCTL1 = CALBC1_16MHZ;
    DCOCTL  = CALDCO_16MHZ;
    BCSCTL1 |= XTS+XT2OFF;                    // set in high freq mode and Crystal2 Off
    BCSCTL3 &= XCAP_0;
    BCSCTL3 |= LFXT1S_2;                      // set for 3-16MHz crystal for high freq mode
    UCA0CTL1 |= UCSSEL_2;                     // CLK = SMCLK
    UCA0CTL0 = 0x00;                          
    UCA0BR0 =  0x82;                          // 16MHz/9600 = 1666.6
    UCA0BR1 =  0x06;               
   // UCA0MCTL = UCBRS1 + UCBRS0;               // Modulation UCBRSx = 3
    UCA0MCTL = UCBRS0;
    UCA0CTL1 &= ~UCSWRST;
   
  }

here is ADC initialisation

                                               ADC10CTL1 =  CONSEQ_0;
                                               ADC10CTL0 = SREF_0 + ADC10SHT_0 +  ADC10ON;
                                               ADC10AE0 = 0xFF;

under single channel and single conversion mode.


Thanks in Advance,

Regards

Manohar

  • Why do you set all the port 3 pins as GPIO outputs before setting the P3SEL bits? Also you don't ever configure the PxSEL bits needed for the ADC10.

    Try to run a UART & ADC10 example from our code examples. First run each of these individually to verify proper operation, then merge them and see if you have the same problem.

  • Thanks for your reply, i made the changes still a small problem ,would u please help me in this matter..??

    I am using msp430f2254 it is having 16KB flash with 512B RAM in that i used

     name                        origin        length      used            unused

     RAM                   00000200   00000200  0000008c  00000174

    FLASH                0000c000   00003fde   00002ae4   000014fa

    here the problem is, in my application i am using LCD and UART with ADC operation ,if i am using all operations( that is UART, LCD and ADC) at a time the controller gets hung up, but if i use two operations at  a time it works fine.

    Where i have to make changes to do all operations at a time?

     

     

**Attention** This is a public forum