I followed code example msp430fr69xx_cs_04 for 16MHz crystal configuration. The OFIFG flag is always set and the system stopped at the do loop.
I changed the crystal to 8MHz, the problem is the same.
Change the clock to DCO configuration, the system works fine.
Here is the code:
WDTCTL = WDTPW | WDTHOLD; // Stop WDT
// GPIO Setup
P1OUT = 0;
P1DIR = BIT0; // For LED
PM5CTL0 &= ~LOCKLPM5;
FRCTL0 =0xA570;
// Set up HXT1
// Clock System Setup
PJSEL0 |= BIT6 | BIT7; //For HXT2
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
// Set DCO to 8MHz
CSCTL1 = DCOFSEL_6;
CSCTL2 = SELA__VLOCLK | SELS__HFXTCLK | SELM__HFXTCLK;
CSCTL3 = DIVA__1 | DIVS_2 | DIVM__2; // Set all dividers
CSCTL4 |= HFXTDRIVE_3 | HFFREQ_2;
CSCTL4 &=~HFXTOFF;
do
{
CSCTL5 &=~HFXTOFFG; // Clear HXT2 fault flag
SFRIFG1 &= ~OFIFG;
} while (SFRIFG1 & OFIFG); // Test oscillator fault flag
CSCTL0_H = 0; // Lock CS registers
Please tell me What is the problem?