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.

RF430FRL152H master clock setting problem

Other Parts Discussed in Thread: RF430FRL152H

I want to set my RF430FRL152H MCU at full speed. There is a 4-MHz High-Frequency Clock in Compact Clock System and I set the master clock (MCLK) sourced from HFCLK (4MHz) but the MCLK ouput is only 2MHz. No matter DIVMx Divider is set to 1 or 2, the MCLK output is only 2MHz. What is the problem? Did I miss some settings?

  • I am not sure which project you are using. However using the "NFC_only" project, with the following changes I was able to produce an MCLK of 4 MHz on P1.2(pin 9).

    void DeviceInit(void)
    {
    P1SEL0 = 0xF0; //keep JTAG
    P1SEL1 = 0xF4; //keep JTAG //route MCLK on P1.2
    P1DIR &= ~0xEF;
    P1DIR |= BIT2; //enable output on P1.2
    P1REN = 0;



    CCSCTL0 = CCSKEY; // Unlock CCS

    CCSCTL1 = 0; // do not half the clock speed
    CCSCTL4 = SELA_1 + SELM_0 + SELS_0; // Select VLO for ACLK and select HFCLK/DCO for MCLK, and SMCLK
    CCSCTL5 = DIVA_2 + DIVM_0 + DIVS_1; // Set the Dividers for ACLK (4), MCLK to 1, and SMCLK to 2
    CCSCTL6 = XTOFF; // Turns of the crystal if it is not being used
    CCSCTL8 = ACLKREQEN + MCLKREQEN + SMCLKREQEN; //disable clocks if they are not being used

    CCSCTL0_H |= 0xFF; // Lock CCS

    return;
    }

    Please keep in mind that an MCLK of 2 MHz is recommended by the datasheet.
  • Alexander,

    Thanks I will try that again. I have the similar settings last time, but it seems only output 2MHz. Thanks for the reply!
  • Alexander,

    Thanks. It is successfully generated 4MHz MCLK. But the 2MHz MCLK clock is more stable, right?
  • The reason that 2 MHz is recommended is that the internal voltage regulator is able to source current at 2MHz across all devices.  At 4 MHz sometimes it cannot source that much current internally.

  • Alexander,

    I see. Thank you very much. That is the perfect answer.