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/MSP-EXP430F5529LP: How to set the frequency of an external quartz resonator in a TI-RTOS?

Part Number: MSP-EXP430F5529LP
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

How to set the frequency of an external quartz resonator in a TI-RTOS?

  • What version of TI-RTOS are you using?
  • Hello, TI-RTOS MSP43x 2.20.00.06. and Code Composer Studio Version: 7.3.0.00019/

  • The following tutorial describes a little about the MSP430 boot process:

    processors.wiki.ti.com/.../BIOS_for_the_MSP430

    There is mention of when we do frequency boost during boot here:

    processors.wiki.ti.com/.../BIOS_for_the_MSP430

    and how to disable it here:

    processors.wiki.ti.com/.../BIOS_for_the_MSP430

    As well, the 'ClockFreqs' module provides some hints:

    software-dl.ti.com/.../indexChrome.html

    If you're using your own external oscillator, you may need to disable the Boot module and add the necessary initialization content to your main().

    Add the following to your .cfg file to .cfg file to inform BIOS of the resulting CPU speed:

    var BIOS = xdc.useModule('ti.sybios.BIOS');
    BIOS.cpuFreq.lo = xyz; /* xyz is frequency in Hz */

    Alan
  • Привет!
    Получилось запустить нужную частоту с помощью следующих действий:
    GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5,GPIO_PIN3);
    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5,GPIO_PIN2);

    UCS_setExternalClockSource(32768,8000000);
    UCS_turnOnXT2(UCS_XT2_DRIVE_8MHZ_16MHZ);

    UCS_initClockSignal(UCS_ACLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_2);
    UCS_initClockSignal(UCS_MCLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);
    UCS_initClockSignal(UCS_SMCLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);

    UCS_initClockSignal(UCS_FLLREF,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);
    PMM_setVCore(PMM_CORE_LEVEL_3);

    UCS_initFLLSettle(16000,2);

    where the desired frequency (16000) must be a multiple of degree 2, get the frequency of 24 MHz using quartz 8MHz, you can, but first divide it into UCS_CLOCK_DIVIDER_2, and then multiply by 6(UCS_initFLLSettle(24000,6)).

    and you need to add it to .cfg:

    var Boot = xdc.useModule('ti.catalog.msp430.init.Boot');
    Boot.configureDCO = false;


    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.cpuFreq.lo = 16000000;
    BIOS.cpuFreq.hi = 0;

    var ClockFreqs = xdc.useModule('ti.sysbios.family.msp430.ClockFreqs');
    ClockFreqs.ACLK = 4000000;
    ClockFreqs.SMCLK = 16000000;
  • GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5,GPIO_PIN3);
    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5,GPIO_PIN2);

    UCS_setExternalClockSource(32768,8000000);
    UCS_turnOnXT2(UCS_XT2_DRIVE_8MHZ_16MHZ);

    UCS_initClockSignal(UCS_ACLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_2);
    UCS_initClockSignal(UCS_MCLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_2);
    UCS_initClockSignal(UCS_SMCLK,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);

    UCS_initClockSignal(UCS_FLLREF,UCS_XT2CLK_SELECT,UCS_CLOCK_DIVIDER_1);
    PMM_setVCore(PMM_CORE_LEVEL_3);
    UCS_initFLLSettle(24000,6);
    get the frequency of 24 MHz using quartz 8MHz, you can, but first divide it into 2, and then multiply by 6.

    /* ================ Boot configuration ================ */
    var Boot = xdc.useModule('ti.catalog.msp430.init.Boot');
    Boot.configureDCO = false;


    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.cpuFreq.lo = 24000000;
    BIOS.cpuFreq.hi = 0;

    var ClockFreqs = xdc.useModule('ti.sysbios.family.msp430.ClockFreqs');
    ClockFreqs.ACLK = 4000000;
    ClockFreqs.SMCLK = 24000000;
  • Anton,

    I think your answer implies that you've gotten it to work using the code you show.

    Is that correct? If so, please mark yourself as answering the post.

    Alan

    [update: Marking as TI Thinks Resolved because of no response from original poster 8/3]

**Attention** This is a public forum