Part Number: MSP430FR5972
Hi,
Now I am facing one issue, I am giving the different supply (from 1.5 V to 3.6 V) to ADC channel P9.4 (A12) but it give the MAX value (4095) and when I provide GND then it gives 0 (zero) value.
conclution it gives only two value either 4095 or 0.
I am using code like:-
void adc_ch_A12()
{
ADC12MCTL0 |= ADC12INCH_12 | ADC12VRSEL_1; // A12 ADC input select; Vref=1.2V
P9SEL1 |= BIT4; // Configure P9.4 for ADC
}
void adc_init()
{
// Configure ADC12
ADC12CTL0 = ADC12SHT0_2 | ADC12ON;
ADC12CTL1 = ADC12SHP; // ADCCLK = MODOSC; sampling timer
ADC12CTL2 |= ADC12RES_2; // 12-bit conversion results
ADC12IER0 |= ADC12IE0; // Enable ADC conv complete interrupt
}