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.

MSP430FG479 internal clock generation


I want to generate an internal clock DCO = MCLK = SMCLK of 4 or 8MHz, without any external crystal. is this possible?

How can I set this up?

With an external 32.768kHz oscillator it works like this:

void initClock(void)
    // DCO = 32768 * 1 * (30+1) = 1.015 MHz
    SCFQCTL = 30;
    SCFI0 = (FLLD_1);
    FLL_CTL0 = DCOPLUS;    // undevided MCLK, no internal caps on LP-Osc.
    FLL_CTL1 = XT2OFF;    // SMCLK=MCLK=DCO, ACLK undevided

what do I need to change?

  • Fabian Hoessli said:
     // DCO = 32768 * 1 * (30+1) = 1.015 MHz

    This tells most of the story. 4MHz/32768 = 122, so 30 must be replaced by 121. (for 8MHz, set FLLDx to FLLD_1 for another factor of 2)
    Also, look into the datahseet for the frequency range for different FNx settings. You'd likely have to switch to a different range, especially for 8MHz.

  • Hi

    This is not really what I want to do. At the moment i have a 32.768KHz crystal and with this configuration everything works. My question is:

    Can I also make it run, without the external crystal? Is there a internal clock source? The problem is, i can not find any internal RC oscillator!

    If its possible: What do I have to change?



  • Fabian Hoessli said:
    i can not find any internal RC oscillator!

    Look closer :) Actually DCO is oscillator you looking for.

    Fabian Hoessli said:
    What do I have to change?

    Nothing. Either you live with DCO freq and drift inaccuracies or use external crystal as reference or clock source.

  • Fabian Hoessli said:
    Can I also make it run, without the external crystal?

    Unfortunately not. The 4x family requires an external reference signal for the FLL.
    The 5x family has the internal, calibrated REFO which is a fairly good substitute for a 32768Hz crystal in many cases (albeit by far not as precise as a crystal).

    If you don't want to use a crystal, there's one workaround:

    Apply an external 32768Ht precision frequency to the XT1 pin. Configure LFXT1 for bypass mode. Program the FLL for your desired target frequency, elt the FLL settle and then store the settled DCOx and MODx values in INFO memory. On next program start, when these values ar ein info memory, disable the FLL and use them instead.

    However, this procedure must be done for each individual MSP and since the FLL is off, the DCO will drift with temperature and supply voltage (see datasheet for DCO drift).

    Actually this is what TI does during production for most of the 2x family devices that don't have an FLL at all (of course instead of settling the DCO by the non-existent FLL, it is adjusted and checked by code)