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.

MSP430FR2475: Can't clear XT1OFFG.

Part Number: MSP430FR2475

I don't know why I can't clear XT1OFFG.

I wrote the following code based on the link below, but I can't get out of the while and clear the flag. What is the possible problem?

MSP430FR2433: XT1 Clock Operation and requirement for XT1OFFG Crystal Fault Interrupt - MSP low-power microcontroller forum - MSP low-power microcontrollers - TI E2E support forums

#include <msp430.h>

int main(void){

    WDTCTL = WDTPW + WDTHOLD; // Stop WDT
    P2SEL0 |= BIT0 | BIT1;
    do {
           CSCTL7 &= ~( XT1OFFG | DCOFFG ); // Clear XT1,DCO fault flags
           SFRIFG1 &= ~OFIFG; // Clear fault flags
    } while (SFRIFG1 & OFIFG); // Test oscillator fault flag

 while(1){
 /* code*/

    }

}         

**Attention** This is a public forum