I'm trying to only run the HFXT clock, and completely disable the LFXT clock. I have a 7 MHz crystal on HFXT and nothing on LFXT. The MSP430FR5969 does not seem to support operation for a 7 MHz crystal on LFXT.
The problem is that HFXT is working fine, but the LFXT clock keeps on generating fault interrupts, even though it's supposed to be off.
--
So far I have tried this:
// XT1, XT2 Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_6; // Set DCO to 8MHz
CSCTL2 = SELS__HFXTCLK | SELM__DCOCLK; // select HF clock
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
CSCTL4 |= HFXTDRIVE_1 | LFXTOFF; // set drive strength to 01 for HF, disable LF clock
CSCTL4 &= ~(HFXTOFF); // enable HF clock
do
{
CSCTL5 &= ~(LFXTOFFG); // Clear LFXT fault flag
CSCTL5 &= ~(HFXTOFFG); // Clear HFXT fault flag
SFRIFG1 &= ~OFIFG; // clear oscillator fault flag
// }while (CSCTL5 & HFXTOFFG); // Test oscillator fault flag for HF crystal only. This works
}while (SFRIFG1&OFIFG); // Test oscillator fault flag using the 'official way'. This fails on LFXTOFGG
HFXT is running fine, but the using the official way makes the do while loop get stuck. I'd rather fix the official way, because LFXTOFFG affects the SFRIFG1 register.
The LFXT is not running (CSCTL4.LFXTOFF =1), yet an interrupt is generated for a failing LFXT (CSCTL5.LFXTOFFG =1).
The MSP430FR5969 users manual (slau367b.pdf) mentions: (p84):
"LFXT_OscFault: When the fault detection logic is enabled (ENLFXTD = 1), this signal is set
after the LFXT oscillator has stopped operation and is cleared after operation resumes."
However, I could find no other reference to ENLFXTD anywhere.
Does anybody have an idea how to disable the LFXT fault detection logic?
thanks, Michael