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.

help for programing ADC12



Hello,

i'm new to using msp430fr5969 i'm trying to program the ADC12.

whenever i try to compare the internal supply of the MSP430 if it's > 2.5v the green led is turned on else the red led is turned on so i initialize the ADC12 but i

don't now what i put as internal channel.

here is my code.

		  // Configure ADC12
		  ADC12CTL0 = ADC12SHT0_2 | ADC12ON | ADC12MSC;
		  ADC12CTL1 |= ADC12SHP | ADC12CONSEQ_1;    // ADCCLK = MODOSC; sampling timer
		  ADC12CTL2 |= ADC12RES_2;                  // 12-bit conversion results
		  ADC12IER0 |= ADC12IE1;                    // Enable ADC conv complete interrupt
		  ADC12MCTL0 |= ???????
		  ADC12CTL0 |= ADC12ENC | ADC12SC;        // Start sampling/conversion
                  unsigned int result = ADC12MEM0 ;


    // Power Test
    if ( result < 3600 )
    {
    //  turn green led on
    }
    else
    {
       // turn red led on
    }

**Attention** This is a public forum