Hi, My customer use code below and trapped in do-while loop with the bit XT1OF is set 1.
My customer check that input condition (f=1MHz,VIL,VIH) is right and output(MCLK) is OK.
Please let me know your suggestions or code sample.
SCFQCTL = SCFQ_M;
SCFI0 = 0x00;
FLL_CTL0 = XTS_FLL + XCAP0PF; // HF mode
FLL_CTL1 = 0x00;
__bic_SR_register(SCG0);
__bic_SR_register(SCG1);
__bic_SR_register(OSCOFF);
__bic_SR_register(CPUOFF);
P1DIR = 0x22; // check MCLK
P1SEL = 0x22;
do {
FLL_CTL0 &= ~XT1OF; // Clear OSCFault flag
IFG1 &= ~OFIFG; // Clear OSCFault flag
for(i = 0x47FF; i > 0; i--); // Delay
} while((IFG1 & OFIFG)); // OSCFault flag still set?
IFG1 &= ~OFIFG;
Thank you !