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.

MSP430F5529: let device using external crystal oscillator base on TI-RTOS

Part Number: MSP430F5529

Hi Team,

My customers is using TI-RTOS on this device. They want to using external crystal oscillator to instead of internal. How to achieve this? I'm not familiar with TI-RTOS, Please give us some support.

--

Thanks & Regards

Yale

  • Hello Yale,

    There is no direct TI-RTOS drivers for setting up an external crystal. You will need to use MSP430 DriverLib (which TI_RTOS uses)  or have a setup function in the beginning of your code that setups the crystal with bare metal code as shown here.

  • Jace,

    1. Under using RTOS, how to judge the device is using XT1 or internal CLOCK(REFO)?

    P5SEL |= BIT4+BIT5;     //P5.4和P5.5选择XT1晶振功能
    
    UCSCTL3 |= SELREF_0;    //设置FLL参考时钟源为XT1
    
    UCSCTL4 |= SELA_0;      //ACLK = XT1CLK
    
    UCSCTL0 = 0;            //设置DCO=MOD=0
    
    do
    {
    
        UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG); 
        
        SFRIFG1 &= ~OFIFG;
    
    }while(SFRIFG1&OFIFG); 
    
    UCSCTL6 &= ~XT1DRIVE_0; 
    
    __bis_SR_register(SCG0); 
    
    UCSCTL1 = DCORSEL_4; 
    
    UCSCTL2 |= 249; 
    
    __bic_SR_register(SCG0); 
    
    for(i = 50000;i>0;i--);

    2. Under using ROTS, the device seems doesn't work unless setting CLK to 8192000Hz? How to resolve it?

    --

    Thanks & Regards

    Yale

  • Yale,

    For setting up the device, ignore TI-RTOS. That is for running specific tasks once the device is setup. Use this code example for setting up a LF xtal: https://dev.ti.com/tirex/explore/node?node=A__ALDSyPuzciqGUqasjmxBaQ__msp430ware__IOGqZri__LATEST 

    Keep in mind, your setup may vary from what's in the code depending on your hardware setup. In particular the load capacitance needed for the device. If you have external load caps, then you shouldn't enable the internal ones available for this device. For details on external load caps and balancing them for your crystal please see section 2.1 of the following app note: MSP 32-kHz Oscillators.

    The while loop checking the DCO flags is what ensure the xtal is stable until it moves on. You can enable the interrupts associated with the xtals to be able to get informed if xtal failed and switched to REFO. 

    My advice is to setup the device first w/o TI-RTOS integration and make sure you got the device operating how you want it, then integrate that setup in your TI-RTOS project. 

  • Of course, Ti-RTOS expects a particular frequency, though you should be able to change it. I imagine you need to dive into the configuration file:

**Attention** This is a public forum