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.

MSP430FR5969: msp430fr5969 development board

Part Number: MSP430FR5969

HI,

I like to work in MSP430FR5969-SP so i have purchased a development board for it, in the development board high frequency oscillator is not available and in the schematics it is said as DNP,

i want to use the high frequency external crystal, but when i programmed for high frequency crystal , the crystal frequency cannot be viewed in oscilloscope, yet the microcontroller is not working as per the DCO frequency also as per the CTL2 register description 

I have attached my sample program for clock, how do i enable external oscillator. 

CSCTL0 = 0xA500;
CSCTL1 = 0x000C; /* 8 Mhz - 0x000C */
CSCTL2 = 0x0155; /* Aclk is VLOclk, SMclk & Mclk is HFXT clock */
CSCTL3 = 0x0000; /* crystal frequency is not divided */
CSCTL4 = 0x8881; /* SMclk on,LFxtclk off, HFXTCLK on , 4MHZ crystal selected */

  • Hi Sasi,

    I think this example code maybe useful for you.

    https://dev.ti.com/tirex/explore/node?node=ALVL0SoDYDeHxNK7-GSVwQ__IOGqZri__LATEST

    Thanks!

    Best Regards

    Johnson


  • From the resource explorer i downloaded an example program named msp430fr59xx_cs_04.c

    based on this program crystal oscillator worked, creating a one second led toggle,

    I changed DCO frequency to 4Mhz which creates 2 second delay

    Then i selected HFXT of 4Mhz for MCLK now when i checked it creates a delay of 335 seconds.

    #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_4; // Set DCO to 8MHz
    CSCTL2 = SELA__LFXTCLK | SELS__HFXTCLK | SELS__HFXTCLK;
    CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
    CSCTL4 |= LFXTDRIVE_0 | HFXTDRIVE_0;
    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
    }
    }

    does MCLK support HFXT

  • It seems as though you need to set HFFREQ=0 for a 4MHz crystal. (I'm not quite sure why the Example didn't set HFFREQ=2.)

    > CSCTL4 &= ~HFFREQ_3;  // HFFREQ=0 for 4MHz

    It appears you disabled the loop that clears LFXTOFFG and HFXTOFFG. I suspect (a) there is a fault initially while the crystal starts up (b) the clock won't switch until you explicitly clear the fault (and it stays cleared). Is there a reason you removed the loop?

  • Hi Bruce,

    I uncommented to loop and it worked fine, but in my design, I am not using an external low-frequency oscillator so I commented the loop and the external crystal is not providing the required clock pulse is it possible that this microcontroller can work only with external high-frequency oscillator

  • Data sheet (SLAS704F) Table 5-5 claims the HFXT runs up to 24MHz. My Launchpad even has a site (Y1) for a high-speed crystal.

    Clearing HFXTOFFG (and OFIFG) repeatedly is pretty much required [Ref User GUide (SLAU367P) Sec 3.2.8], since the clock system won't switch clocks until HFXTOFFG is explicitly turned off (and stays off). 

    Probing a a crystal oscillator with a scope is notoriously difficult. I suggest routing SMCLK to P3.4 and watching that [Ref data sheet Table .6-57].

  • Hi Bruce,

    My external crystal oscillator is working fine and able to produce desired frequency when i have an external low-frequency oscillator, whereas in my design i not able to use an external low-frequency oscillator, is there a way to make it work without external low frequency oscillator

  • I think my neuron finally fired -- you don't care about  (indeed expect) an LFXT fault, but it still causes OFIFG to be set.

    I haven't tried this combination. But based on UG (SLAU367P) Sec 3.2.8 (specifically "If LFXT is sourcing any system clock..") you should start by something like:

    > CSCTL2 = SELA__LFMODCLK | SELS__HFXTCLK | SELS__HFXTCLK; // ACLK=something which is not LFXT

    There's also CSCTL5:ENSTFCNT1=0 [Ref UG Table 3-9], which based on the description turns off the clock-fault logic for LFXT. [I haven't tried it, maybe it works.] 

**Attention** This is a public forum