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.

SMCLK frequency is changing on run time

Other Parts Discussed in Thread: MSP430F5249

Hello,

I'm using MSP430f5249 controller. I'm sending AT commands through UART of controller to Telit GSM module. 

I'm using external crystal of  8MHz as clock source. and intial settings of UCSC is as below.

PMAPPWD = 0x02D52; // Enable Write-access to modify port mapping registers
P4MAP7 = PM_MCLK;
PMAPPWD = 0; // Disable Write-Access to modify port mapping registers

P5SEL |= BIT2+BIT3; // Port select XT2
P5SEL |= BIT4+BIT5; // Port select XT1

UCSCTL6 &= ~XT2OFF; // Set XT2 On

// XT1 is by default on as it is used default reference for the FLL - internal load caps?
// Loop until XT1,XT2 & DCO stabilizes
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
// Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG; // Clear fault flags
}while (SFRIFG1&OFIFG); // Test oscillator fault flag

UCSCTL6 &= ~XT2DRIVE0; // Decrease XT2 Drive according to
// expected frequency
UCSCTL4 |= SELA_0 + SELS_5; // Select SMCLK, ACLK source and DCO source
UCSCTL4 |= SELM_5;

But while sending AT commands, SMCLK source is changing from 8Mhz to 1Mhz due to XT2 oscillator fault flag is getting set.

Please let me know what could be the reason for this issue. Why SMCLK frequency is getting changed on run time?

 

  • When an oscillator fault is detected, then this is most likely because there is an oscillator fault. If this happens only during the transfer, then the transfer is causing problems outside the MSP. Check your layout. Is the crystal shielded against crosstalk? Short, symmetrical traces? Correct load capacitance? No high-current or high-frequency paths beneath the crystal?

    When a fault is detected, MCLK or SMCLK will switch to DCO. Which is likely still running on default 1MHz.
    Unless the crystal is up again and you properly (means: manually, and successfully) clear the xOFFG flags and the OFIFG flag, SMCLK and MCLK will remain switched to DCO. Once OFIFG is clear, they will revert back to the crystal. The fail-safe fallback won’t change the clock source selecting for the clocks. So the SSEL/MSEL bits will show ‘crystal’ even when actually running from DCO due to crystal failure.

**Attention** This is a public forum