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/TMS320F28034: problem with xternal oscillator

Part Number: TMS320F28034


Tool/software: Code Composer Studio

Greetings! I am using this uC for a very first time. So I`ve made a simple blink test from the examples - > Example_2803xLEDBlink.c. Everything works. So I`ve tried to switch to external oscillator. I have 10MHz crystal. But the problem is when I call XtalOscSel from SysCtrl and next Xtal_PLL_Init(DSP28_PLLCR,DSP28_DIVSEL), my program blocks(stops) here:

   if (SysCtrlRegs.PLLSTS.bit.MCLKSTS != 0)
   {
        EALLOW;

        //
        // OSCCLKSRC1 failure detected. PLL running in limp mode.
        // Re-enable missing clock logic.
        //
        SysCtrlRegs.PLLSTS.bit.MCLKCLR = 1;
        EDIS;

        //
        // Replace this line with a call to an appropriate
        // SystemShutdown(); function.
        __asm("        ESTOP0");     // Uncomment for debugging purposes
    }

I suppose there is some kind of problem, but I`m not sure where to seach for. Any ideas?

Thanks!

  • Pavlin,

    What board are you using for this example?

    REgards,

    PEter

  • I`m using my board! I`ve fixed it!

    this is my code:

        EALLOW;
    
           //
           // 1-GPIO19 = XCLKIN, 0-GPIO38 = XCLKIN
           //
           //SysCtrlRegs.XCLK.bit.XCLKINSEL = 1;
        SysCtrlRegs.CLKCTL.bit.XTALOSCOFF=0;
        SysCtrlRegs.CLKCTL.bit.XCLKINOFF=1;
    
        SysCtrlRegs.CLKCTL.bit.OSCCLKSRC2SEL = 0; //Switch to external clock
        SysCtrlRegs.CLKCTL.bit.OSCCLKSRCSEL = 1;
        SysCtrlRegs.CLKCTL.bit.TMR2CLKSRCSEL = 1;
        SysCtrlRegs.CLKCTL.bit.WDCLKSRCSEL = 0;   //Clock Watchdog off of INTOSC1
        SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1;    //Turn off INTOSC2
        SysCtrlRegs.CLKCTL.bit.INTOSC1OFF=1;
        EDIS;