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.

MSP430FR5739: MSP430FR5739 XT1CLK

Part Number: MSP430FR5739

hello all.

i am simply trying to work with external  XIN crystal mode of 20MHz value .

i did the below setting of the  CS Registers but from my testing  i get MCLK  as 5MHz and i  don't understand where is

deviation of 4  as i expecting to get the 20MHZ.

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
CSCTL0_H = 0xA5;
CSCTL1 |= DCORSEL + DCOFSEL1;              // DCO on 16 MHz for MSP DCORSEL = 1 , DCOFSEL = 00 
CSCTL2 = SELA_0 + SELS_0 + SELM_0;      // set  ACLK = SMCLK = MCLK    source  from  XT1CLK
CSCTL3 = DIVA_0 + DIVS_0 + DIVM_0;         // set all dividers /1
CSCTL4 = XTS + XT1DRIVE0 + XT1DRIVE1 ;   // XT1  setting  to High-frequency mode , Maximum drive capability
CSCTL5 &= ~XT1OFFG;

PJSEL0 |= BIT4;          // setting ports to XIN and XOUT pins
PJSEL1 &= ~BIT4;


  • Hi,

    You should configure the XIN and XOUT pins before turning on the XT1.

    // XT1 Setup
    PJSEL0 |= BIT4 + BIT5;

    And after turning on the XT1, you should add below code to wait for stable XT1CLK  and clear fault flag.

    do
    {
    CSCTL5 &= ~XT1OFFG;
    // Clear XT1 fault flag
    SFRIFG1 &= ~OFIFG;
    }while (SFRIFG1&OFIFG); // Test oscillator fault flag

    If my post helped solve your issue, please click on the  VERIFY ANSWER    button. 

    Winter,

    Search E2E! Your questions may already be answered! 

  • hi Winter,

    many  tanks...... it works.

    I spend a whole day without success

    It is a pity that MSP430FR57xx Family User's Guide document is not more friendly and detailed.

    Thanks

    Aharon.

     

**Attention** This is a public forum