Hi,
I have used the following code for Analog to Digital Conversion(ADC) using internal voltage reference.
#include <msp430.h>
int main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P6SEL |= 0x01; // Enable A/D channel A0
ADC12CTL0 = ADC12ON+ADC12SHT02+ADC12REFON+ADC12REF2_5V;
// Turn on ADC12, Sampling time,On Reference Generator and set to 2.5V
ADC12IE = 0x01; //Enable IFG
ADC12CTL1 = ADC12SHP; // Use sampling timer
ADC12MCTL0 = ADC12SREF_1; // Vr+=Vref+ and Vr-=AVss
for ( i=0; i<0x30; i++); // Delay for reference start-up
ADC12CTL0 |= ADC12ENC; // Enable conversions
while (1)
{ ADC12CTL0 |= ADC12SC; // Start conversion
while (!(ADC12IFG & BIT0));
__no_operation(); // SET BREAKPOINT HERE
}
}
When I simulate this code by giving analog input to A0/P6.0, I donot get conversion result in the ADC12MEM0 register.
Can anyone help me in this regard ??
Thank you in advance