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.

TMS320F28035 External Clock

Customer use 12M external Oscillator .

Modified Software file DSP2803x_SysCtrl.c as bellow:

void InitSysCtrl(void)

{

   DisableDog();

 

   EALLOW;

   SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; // Enable ADC peripheral clock

   (*Device_cal)();

   SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 0; // Return ADC clock to original state

   EDIS;

 

   ExtOscSel();   

   InitPll(DSP28_PLLCR,DSP28_DIVSEL);   // external OSC clock 12MHz,so DSP28_PLLCR=10,DSP28_DIVSEL=2

   InitPeripheralClocks();

}

 

void ExtOscSel (void)  {

     EALLOW;

     SysCtrlRegs.XCLK.bit.XCLKINSEL = 1;       // 1-GPIO19 = XCLKIN, 0-GPIO38 = XCLKIN

     SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 1;    // Turn on XTALOSC

     SysCtrlRegs.CLKCTL.bit.XCLKINOFF = 0;     // Turn on XCLKIN

     SysCtrlRegs.CLKCTL.bit.OSCCLKSRC2SEL = 0; // Switch to external clock

     SysCtrlRegs.CLKCTL.bit.OSCCLKSRCSEL = 1;  // Switch from INTOSC1 to INTOSC2/ext clk

     SysCtrlRegs.CLKCTL.bit.WDCLKSRCSEL = 1;   // Switch Watchdog Clk Src to external clock

     SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1;    // Turn off INTOSC2

     SysCtrlRegs.CLKCTL.bit.INTOSC1OFF = 1;    // Turn off INTOSC1

     EDIS;

}

but when the software is running, it halt in the following point:

void InitPll(Uint16 val, Uint16 divsel)
{
   volatile Uint16 iVol;


   // Make sure the PLL is not running in limp mode
   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
   }

 

 ........

}

What's wrong, please help, thanks!

  • elan peng said:
    but when the software is running, it halt in the following point:
    void InitPll(Uint16 val, Uint16 divsel)
    {
       volatile Uint16 iVol;


       // Make sure the PLL is not running in limp mode
       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
       }

    The MCLKSTS bit indicates that the clock source went missing.  I would suggest starting by checking all of the hardware connections related to clocking, power, ground..

    Regards,

    Lori