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.

CCS/MSP430G2553: ADU10 does not work

Part Number: MSP430G2553

Tool/software: Code Composer Studio

Ladies and Gentlement,

I mean, that I have done everything according to the 'Users Guide'. However it do not work. What I want is just, periodic reading the value at P1.3 of the MSP430G2553.
The value of the variable 'isoll' is always 0. The value of ADC10MEM is always 436 (decimal).

Best regards
Franz Peter Zantis

/*
Software für die Stromversorgung mit MSP430G2553
Stand: 2. September 2017, F.P. Zantis
*/

#include <msp430G2553.h>

unsigned int isoll;      //Stromvorgabe

int main(void) {
   WDTCTL = WDTPW | WDTHOLD;   // Stop watchdog timer
   BCSCTL1 = CALBC1_16MHZ;     //clock SMCLK=16MHz
   DCOCTL = CALDCO_16MHZ;      //use internal DCO as clock

   P2SEL &= ~BIT6;         //P2.6 als input/output
   P2SEL &= ~BIT7;         //P2.7 als input/output
   P2DIR |= BIT6;         //P2.6 als Output
   P2DIR |= BIT7;         //P2.7 als Output
   P2OUT &= ~BIT6;         //P2.6 auf low; LEDrot ein
   P2OUT &= ~BIT7;         //P2.7 auf low;   LEDgruen ein

   //ADC
   P1SEL |= BIT3;               //ADC input über P1.3
   ADC10AE0 = BIT3;            //ADC input A3 über P1.3 eingeschaltet
   ADC10CTL1 = INCH_3;          //Channel 3 - A3
   ADC10CTL1 |= ADC10DIV_7;      //ADC10CLK/8
   ADC10CTL1 |= CONSEQ_2;         //repeating conversion single-channel
   ADC10CTL0 = ADC10ON;         //ADC on
   ADC10CTL0 |= SREF_1;         //Vref & Vss als Referenz (1,5V)
   ADC10CTL0 |= REFON;            //Reference generator on
   ADC10CTL0 |= ADC10SHT_3;      //Sample & hold = 64 clocks
   ADC10CTL0 |= MSC;            //automatic continuous sampling
   ADC10CTL0 |= ADC10SC;         //start conversion
   ADC10CTL0 |= ADC10IE;         //ADC interrupt enable
   ADC10CTL0 |= ENC;            //ADC enabled

   __enable_interrupt();


   while(1)
   {
      if(isoll > 500)
      {
          P2OUT &= ~BIT6;         //P2.6 auf low;   LEDrot ein
      }
      else
      {
         P2OUT |= BIT6;         //P2.6 auf high; LEDrot aus
      }

   }


   return 0;
}





#pragma vector = ADC10_VECTOR
__interrupt void ADC10ISR(void)
{
   isoll = ADC10MEM;
}

**Attention** This is a public forum