This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2422: MSP430FR2422 crystal initialization issue , OFIFG flag always high

Part Number: MSP430FR2422

Hi,

I am connecting external crystal of  32768Hz to pin XIN (P2.1)and XOUT(P2.0) but code gets stuck because of OFIFG always high.

following is my  initialization  code

_______

P2DIR = 0xFF;
P1SEL0 = BIT4 | BIT5; // UCA0 RXD and TXD

P2SELC |= BIT0 | BIT1; // P2.0~P2.1: crystal pins
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings
// P2OUT = P1OUT =0;
// Initialize crystal
 SFRIFG1 = 0;
 do
 {
 CSCTL7 = 0; // Clear XT1 fault flag
 SFRIFG1 = 0; // Clear fault flag
/} while (SFRIFG1 & OFIFG); // Test oscillator fault flag           ______________> code hangs in this loop
CSCTL4 = SELA__XT1CLK; // Set ACLK = XT1CLK = 32768Hz

**Attention** This is a public forum