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.

CCS/MSP430FR5857: CRYSTAL OSCILLATOR CONFIGURATION NOT WORKING

Part Number: MSP430FR5857
Other Parts Discussed in Thread: MSP430WARE, TEST

Tool/software: Code Composer Studio

Dear Sir/ Madam

I have configured external crystal to the HFXTIN pin and HFXOUT of 16 MHz ,18 pf,external capacitor values connected are 30pF i.e Cx1 and Cx2 . I am not getting any output and response in debug window for the below clock configuration mentioned . I am not able to come to conclusion  that whether in my configuration something is wrong or anything else. Please revert back as early as possible.

I have configured the clock based on the example code CS_04 in msp430ware for device MSP430FRxx94.


    WDTCTL = WDTPW | WDTHOLD;               // Stop WDT


    // XTAL PIN CONFIGURATION
    PJSEL0 |=BIT6 | BIT7;

    //UNLOCKLOW POWER
    PM5CTL0 &= ~LOCKLPM5;
    //FRAM WAIT STATE
    FRCTL0 |= FRCTLPW | NWAITS_1;


    // Clock System Setup
       CSCTL0_H = CSKEY_H; // unlock cs registers
       CSCTL2 =  SELS__HFXTCLK | SELM__HFXTCLK;
       CSCTL3  = DIVS_1 | DIVM__1; // SET DIVIDER 1
       CSCTL4 |= HFXTDRIVE_3| HFFREQ_2 ;//16MHZ CRYSTAL OPERATION
       CSCTL4 &= ~HFXTOFF;// TURNING ON CRYSTAL
      do
      { // Check for fault flags
       CSCTL5 &= ~ HFXTOFFG;
       SFRIFG1 &= ~ OFIFG;
       }
      while ( SFRIFG1 & OFIFG);
     CSCTL0_H = 0; //LOCK CS REGISTER

  • Hello Priyanshu,
    not sure what you would like to see in the debugger window in terms of the oscillator functionality. Could you please explain this in more detail?
    In terms of the proper initialization initialization of the crystal oscillator, have you looked into our code examples within the TI Resource Explorer of our Code Composer Studio?
    Here is one for the 32kHz and High Frequency mode, it is the "msp430fr59xx_cs_04.c"

    //******************************************************************************
    // MSP430FR59xx Demo - ACLK = XT1 = 32768Hz, SMCLK= XT2 = 8MHz, MCLK = DCO
    //
    // Description: Configure ACLK = LFXT, SMCLK = HFXT and MCLK = DCO
    // NOTE1: 32768Hz and 8MHz crystals required!
    //
    // MSP430FR59x
    // ---------------
    // /|\| |
    // | | |-LFXIN
    // --|RST |-LFXOUT
    // | |
    // | |-HFXIN
    // | |-HFXOUT
    // | |
    // | P1.0|---> LED
    // | P2.0|---> ACLK = 32768Hz
    // | P3.4|---> SMCLK = 8MHz
    //
    // P. Thanigai
    // Texas Instruments Inc.
    // August 2012
    // Built with IAR Embedded Workbench V5.40 & Code Composer Studio V5.5
    //******************************************************************************
    #include <msp430.h>

    int main(void)
    {
    WDTCTL = WDTPW | WDTHOLD;

    // Configure GPIO
    P1OUT = 0;
    P1DIR = BIT0; // For LED

    P2DIR |= BIT0;
    P2SEL0 |= BIT0; // Output ACLK
    P2SEL1 |= BIT0;

    P3DIR |= BIT4;
    P3SEL0 |= BIT4; // Output SMCLK
    P3SEL1 |= BIT4;

    PJSEL0 |= BIT4 | BIT5 | BIT6 | BIT7; // For XT1 and XT2

    // Disable the GPIO power-on default high-impedance mode to activate
    // previously configured port settings
    PM5CTL0 &= ~LOCKLPM5;

    CSCTL0_H = CSKEY >> 8; // Unlock CS registers
    CSCTL1 = DCOFSEL_6; // Set DCO to 8MHz
    CSCTL2 = SELA__LFXTCLK | SELS__HFXTCLK | SELM__DCOCLK;
    CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
    CSCTL4 |= LFXTDRIVE_3 | HFXTDRIVE_3;
    CSCTL4 &= ~(LFXTOFF | HFXTOFF);
    do
    {
    CSCTL5 &= ~(LFXTOFFG | HFXTOFFG); // Clear XT1 and XT2 fault flag
    SFRIFG1 &= ~OFIFG;
    }while (SFRIFG1&OFIFG); // Test oscillator fault flag
    CSCTL0_H = 0; // Lock CS registers

    while (1) {
    P1OUT ^= 0x01; // Toggle LED
    __delay_cycles(8000000); // Wait 8,000,000 CPU Cycles
    }
    }


    Best regards
    Peter

**Attention** This is a public forum