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.

MSP430FR2676: Failed External Oscillator Check

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?

    // Configure FRAM wait state (set to 1 to support 16MHz MCLK)
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_FLLREF, ui8LFOsc, CS_CLOCK_DIVIDER_1);
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);
  • Hi Luke,

    Is there a possibility that in addition to the initial delay, the clock signal on the bad board is intermittent?

    The code looks ok to me when I compare it with the example code from MSP430Ware.

    Srinivas

  • Hi Srinivas,

    I am Luke's coworker. We added a GPIO toggle prior to calling the function 'CS_turnOnXT1LFWithTimeout' and again when we exit the function. We tested on both a good board and bad board:

    Bad Board = 65ms toggle
    Good Board = 30ms toggle
     
    This test is very repeatable, and the toggle is within 1ms each time.
     
    The clock signal is very clean during the pulse.
    Are you able to send us the source code for the CS_turnOnXT1LFWithTimeout function? We'd like to replace this function call with its source code and put pin toggles around each part to narrow in further.
    Thanks for your help!
  • If you created the project with "empty project with driverlib source" you have the source right there in your project.

    If not, it's in your MSPWare tree, named something like:

    C:\ti\msp430ware_3_80_06_03\driverlib\driverlib\MSP430FR2xx_4xx\cs.c

    [Edit: Hit Post too soon: I've seen a fair amount of startup variation between individual crystals -- I think a 30ms variation wouldn't be so unusual. What happens if you extend the timeout a little?]

  • I dug up the Sit1552 data sheet, and it appears to be a TCXO, not a crystal. I suspect you want to call CS_bypassXT1WithTimeout() instead.

**Attention** This is a public forum