Part Number: MSP430FR2676
Other Parts Discussed in Thread: MSP430WARE
I am running into an issue with the external oscillator check at startup. For my external oscillator, I am using the Sit1552 32.768kHz crystal. On some of my boards, I get the "External Crystal: good", but on most I keep getting the "external crystal failed!" message. When I check the oscillator output of a "good board" vs. a "bad external clock board," the waveforms are identical with maybe an extra 20ms delay before the clock comes up (i.e. good board has oscillator startup within 165ms and bad board oscillator starts up in maybe 180ms+). We tried to implement a delay before calling the function to switch over to the XT1 source in case it was just checking too quickly, setting the XT1_GOOD flag to false, and then reporting it after the 2s timeout rather than checking the source the whole 2 seconds, but that didn't resolve it. We are still getting that the crystal failed.
Below is the code that we are using. Any ideas, thoughts, or questions to clarify?
FRAMCtl_configureWaitStateControl(FRAMCTL_ACCESS_TIME_CYCLES_1);
// Attempt to start the low frequency crystal oscillator
//
CS_setExternalClockSource(XT1_OSC_FREQ);
if (CS_turnOnXT1LFWithTimeout(CS_XT1_DRIVE_0, XT1_OSC_TIMEOUT) == STATUS_FAIL)
{
//
// If a crystal is not present or is failing, switch the LF
// clock definition to the internal 32kHz reference oscillator.
//
ui8LFOsc = CS_REFOCLK_SELECT;
XT1_Good = false;
}
else
{
XT1_Good = true;
}
CS_initClockSignal(CS_ACLK, ui8LFOsc, CS_CLOCK_DIVIDER_1);
CS_initClockSignal(CS_MCLK, CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);
CS_initClockSignal(CS_SMCLK, CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);
//
// Tune the DCO parameters
//
CS_initFLL((DCO_FREQ/1000), FLL_RATIO);
CS_clearAllOscFlagsWithTimeout(1000);