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.

TMS320F28069M: Change internal oscillator to external oscillator in motorware

Part Number: TMS320F28069M

Hi all,

I was recently trying to switch the internal oscillator to external oscillator in HAL_setupClks function. I needed to keep system clock 90Mhz as it is. I refereed few conversation in the forum regarding this. But did not worked.

So far I tried to mimic control suit XtalOscSel function in HAL_setupClks as below, 


CLK_enableCrystalOsc(obj->clkHandle);//enable

usDelay(1000);

CLK_disableClkIn(obj->clkHandle);


CLK_setOsc2Src(obj->clkHandle, CLK_Osc2Src_External);

CLK_setOscSrc(obj->clkHandle,CLK_OscSrc_External);


CLK_setLowSpdPreScaler(obj->clkHandle,CLK_LowSpdPreScaler_SysClkOut_by_1);

CLK_setClkOutPreScaler(obj->clkHandle,CLK_ClkOutPreScaler_SysClkOut_by_1);

But did not worked. Is there any example with external oscillator . Please help me to solve this.

Thanks.

  • What frequency is the external oscillator? The reference code is for 20MHz oscillator as below.

    // enable the crystal oscillator
    CLK_enableCrystalOsc(obj->clkHandle);

    // Delay 1ms before converting ADC channels
    usDelay(10000);

    // disable the external clock in
    CLK_disableClkIn(obj->clkHandle);

    // set the oscillator source
    CLK_setOscSrc(obj->clkHandle,CLK_OscSrc_External);

    // Switch from INTOSC1 to INTOSC2/ext clk
    CLK_setOsc2Src(obj->clkHandle, CLK_Osc2Src_External);

    // enable internal oscillator 1
    CLK_enableOsc1(obj->clkHandle);

    // disable oscillator 2
    CLK_disableOsc2(obj->clkHandle);

    And you need to change PLL divider in HAL_setupPll()
    PLL_setDivideSelect(obj->pllHandle,PLL_DivideSelect_ClkIn_by_4);
  • Thank you Yanming, It worked.