Part Number: MSP430FR2355
;-------------------------------------------------------------------------------
ORG 08000h ; Program Reset
;-------------------------------------------------------------------------------
;******************************************************************************
#include "msp430fr2355.h"
;-------------------------------------------------------------------------------
RESET mov #03000h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop WDT
MeasurePulse
clr &ADCMCTL0
mov #ADCSHT_1+ADCON,&ADCCTL0
mov #ADCDIV_1,&ADCCTL1
mov #ADCRES_2,&ADCCTL2
mov.b #0FFh,&P1DIR
mov.b #0FFh,&P1SEL0
mov.b #0FFh,&P1SEL1
A2DConversion
bic #ADCIFG0,&ADCIFG
bis #ADCENC+ADCSC,&ADCCTL0
A2DLoop
bit #ADCIFG0,&ADCIFG
jz A2DLoop
bic #ADCENC+ADCSC,&ADCCTL0
mov &ADCMEM0,R4
ret
;-------------------------------------------------------------------------------
ORG 0FFFEh
DW RESET
END
This is my code for the MSP430FR2355. It does an A/D read from A0. I clear the ADCIFG0 flag just prior to starting the conversion. Then I poll the ADCIFG0 flag to see when it completes the conversion, but it never comes out of the A2DLoop segment. The ADCIFG0 flag remains 0 forever. What am I doing wrong?