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.

LP-MSP430FR2476: Unable to set ADC to 12 Bit Resolution

Part Number: LP-MSP430FR2476

Hi. I have been trying to use the ADC. The datasheet says it is 12 Bit. But i am able to read only values till 1023. Is there any issue with my Code?

int main(void){


WDTCTL = WDTPW | WDTHOLD;
while(1){

volatile int w=0;
P1SEL0 |= BIT7; // ANALOG PIN 7
ADCCTL0 |= ADCENC_0; // ADC disabled
ADCCTL0 |= ADCON_1; // ADC On
ADCCTL0 |= ADCSHT_3; // Sample and Hold time 32 ADCCLK cycles
ADCMCTL0|= ADCSREF_0; // Reference 000b = V(R+) = AVCC and V(R-) = AVSS
ADCMCTL0|= ADCINCH_7; // A7
ADCCTL1 |= ADCCONSEQ_0; // Single-channel, single-conversion
ADCCTL1 |= ADCSSEL_0 ; // Clock source ADCOSC (MODOSC)
ADCCTL1 |= ADCSHS_0; // Sample and Hold Source ADCSC bit
ADCCTL1 |= ADCSHP; // sample-and-hold pulse-mode select
ADCCTL2 |= ADCRES_2 ; // 12 Bit Resolution
ADCCTL0 |= ADCENC_1; // ADC enabled
ADCCTL0 |= ADCSC; // start conversion

while(!ADCBUSY){};
w = ADCMEM0;
}
}

**Attention** This is a public forum