Hi,
I wrote a c code for accessing the internal ADC of MSP430F169.
Here is my code.
void main(void)
{
unsigned int adc_count;
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
DCOCTL = DCO0 + DCO1 + DCO2;
BCSCTL1 = XT2OFF + DIVA_3 + RSEL0 + RSEL1 + RSEL2;
BCSCTL2 = SELM_0 + DIVM_1 + DIVS_1;
P2DIR |= 0x01; // configure P1.0 as output
P6SEL |= 0x01;
ADC12CTL0 = ADC12ON + REF2_5V + REFON;
ADC12CTL1 = ADC12SSEL_0 + ADC12DIV_3;
ADC12MCTL0 = 0x90;
ADC12CTL0 |= ENC;
while(1)
{
ADC12CTL0 |= ADC12SC;
while(!(ADC12IFG & 0x0001));
ADC12MEM0;
P2OUT ^= 0x01;
}
}
But I didin't getting the ADC A0 interrupt flag so the execution was stopping at while loop.
Is my configuration correct ?
Thanks
Regards