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.

MSP430F5329: XT1 oscillator Fault

Part Number: MSP430F5329

I am getting a XT1LFOFFG fault in UCSCTL7

At start I think I should get it because "After a PUC, the UCS module default configuration is:
• XT1 in LF mode is selected as the oscillator source for XT1CLK. XT1CLK is selected for ACLK "

So I expect a fault, 

So then I set ACLK to REFO with
UCS_initClockSignal(UCS_ACLK, UCS_REFOCLK_SELECT, UCS_CLOCK_DIVIDER_1 );

And Turn off XT1 with UCS_turnOffXT1();

So then I try to clear the flag:

if (UCSCTL7 & XT1LFOFFG) // If XTL LF Mode is set clear it, this is disabled
{
UCSCTL7 &= ~XT1LFOFFG; // clear it
}

And the XT1LFOFFG percists. 
It says

XT1 oscillator fault flag (LF mode). If this bit is set, the OFIFG flag is also set.
XT1LFOFFG is set if a XT1 fault condition exists. XT1LFOFFG can be cleared
by software. If the XT1 fault condition still remains, XT1LFOFFG is set.
0b = No fault condition occurred after the last reset.
1b = XT1 fault (LF mode). A XT1 fault occurred after the last reset.


If it is off and ACLK is 32768 Hz from REFo

And SMCLK and MCLK are 7,372,800 Hz using the REFO as input to DCO FLL why is there a fault? 

void CLK_Init(void)
{
  uint16_t status;
  // I believe when everything is done the clocks are:
  // ACLK = 32768 Hz using REFO
  // MCLK = 7,372,800 Hz from REFO
  // SMCLK = 7,372,800 Hz from REFO
  // Set DCO FLL reference = REFO
  // Any external Crystals are off

  _BIC_SR(SCG0);    // Make sure the FLL is turned on.

  UCS_initClockSignal(UCS_FLLREF,
                      UCS_REFOCLK_SELECT,
                      UCS_CLOCK_DIVIDER_1 );
  // Set ACLK = REFO
  UCS_initClockSignal(UCS_ACLK,
                      UCS_REFOCLK_SELECT,
                      UCS_CLOCK_DIVIDER_1 );
  
  UCS_initClockSignal(UCS_SMCLK,
                      UCS_DCOCLKDIV_SELECT,
                      UCS_CLOCK_DIVIDER_1 );
  
  // Set Ratio and Desired MCLK Frequency and initialize DCO
  UCS_initFLLSettle(7373, // kHz
                    225 ); // 7372.8/32.768 = 225
  
  // In this mode we are below 8 MHz so we can have PMMCOREV0 = 1.8V
  // so now that the frequency is lower we can set the voltage. 
  status = PMM_setVCore(PMM_CORE_LEVEL_0);
  if (status == STATUS_FAIL) while(1); // we have problems. When debugging stop here. 
  
  //PMM_enableSvsHSvmH(); // in this mode we have highside so turn on.
  //PMM_enableSvsLSvmL();  // we need low side enabled in this mode.  
  //PMM_enableSvsLReset(); // We should never see a low voltage event
  
  UCS_turnOffXT1(); // Make sure external 32.768 kHz Crystal is off
  if (UCSCTL7 & XT1LFOFFG) // If XTL LF Mode is set clear it, this is disabled
  {
    UCSCTL7 &= ~XT1LFOFFG; // clear it
  }
  
  UCS_turnOffXT2(); // Make sure external 14.7456 MHz Crystal is off
  //Verify if the Clock settings are as expected
  clockValue[0] = UCS_getMCLK();
  clockValue[1] = UCS_getSMCLK();
  clockValue[2] = UCS_getACLK();
  T1Enable_Port();
  if (d.Debug[7]) print_clock_values();
  return;
}

  • Hi,

    First, to clarify, I am assuming that you have no XT1 on your board. Is this correct? Also, why are you concerned with the XT1LFOFFG if you are not using XT1. Are you seeing the same issue with OFIFG?

    Regards,
    Nathan
  • Actually that is NOT the case. 

    I am using a prototype board that has a 32768 Hz and a 14.... MHz crystal, but to save cost and power we are trying to do everything with the internal REFO and VLO clocks. If it works we are good. If it does not work we have a backup to use the crystal. The EE did not think the internal clock was accurate enough so he put the external one on. I believe it is. And it looks like it is working. 

    So at startup the documentation says:
    After a PUC, the UCS module default configuration is:
    • XT1 in LF mode is selected as the oscillator source for XT1CLK. XT1CLK is selected for ACLK.
    • DCOCLKDIV is selected for MCLK.
    • DCOCLKDIV is selected for SMCLK.
    • FLL operation is enabled and XT1CLK is selected as the FLL reference clock, FLLREFCLK.
    • On devices that have XIN and XOUT shared with general-purpose I/O, XIN and XOUT pins are set to
    general-purpose I/Os and XT1 remains disabled until the I/O ports are configured for XT1 operation. If
    XIN and XOUT are not shared with general-purpose I/Os, XT1 is enabled.
    • When available, XT2IN and XT2OUT pins are set to general-purpose I/Os and XT2 is disabled.

    I do not want it to use the XT1 and I do not want an oscillator fault. I am trying to clear all faults. 



    I am fighting a reset that is occurring at the exact same place in my code every time. And the registers after reset seemed to say it was at first a fault of writing to a bad memory location, then an oscillator fault, and now a PMM password error, even though there are no PMM statements anywhere near where it is resetting. 

    And now after removing all code and starting to add code back it may be something related to the ADC that is causing the reset. Because all the other code is back in except the code that reads the internal temperature with the ADC and the operating with the VLO clock in this mode. (But it also happened when I first removed the VLO slowdown before rewriting from scratch.)

    So I am trying to wipe out all errors/warnings or anything else that could make this processor reset.  I have another thread going after that problem.







  • I forgot to answer your question.

    First, to clarify, I am assuming that you have no XT1 on your board. Is this correct? Also, why are you concerned with the XT1LFOFFG if you are not using XT1. Are you seeing the same issue with OFIFG?

    Yes, I am seeing OFIFG and it looks like it was from XT1LFOFFG.

**Attention** This is a public forum