Tool/software: Code Composer Studio
Hi,
i have some trouble with adc12 in MSP430F5659,i need to read adc reading without interrupt but the problem is that i didn't obtain result in memory register also execution waits for result load in memory(IFG waiting).I post my code below please solve this , hope you can solve it easily.
int main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
P6SEL |= BIT7; // Enable A/D channel inputs
ADC12CTL0 = ADC12ON; // Turn on ADC12, extend sampling time
// to avoid overflow of results
ADC12CTL1 = ADC12CONSEQ_3+ADC12SSEL_3; // Use sampling timer, repeated sequence
ADC12CTL2=ADC12RES_2;
ADC12MCTL7 = ADC12INCH_7; // ref+=AVcc, channel = A0
ADC12CTL0 |= ADC12ENC; // Enable conversions
ADC12CTL0 |= ADC12SC; // Start convn - software trigger
while (1)
{
ADC12CTL0 |= ADC12SC; // Start conversion
while (!(ADC12IFG & ADC12IFG7));
result=ADC12MEM7;
__no_operation(); // SET BREAKPOINT HERE
}
}