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.

TMS320F28020: Enters limp mode when not debugging

Part Number: TMS320F28020

I have a project where I'm using a TMS320F28020. On some of the PCBs the microcontroller enters limp mode (SysCtrlRegs.PLLSTS.bit.MCLKSTS==1) all the time after power up. On other PCBs it sometimes enters, and sometimes runs normally. Other PCBs again always runs fine. If I'm running in debug mode (with XDS110) the PLL and external crystal is always ok.

We've tried to replace the crystal, the microcontroller and the capacitors for the crystal. None of the changes makes any difference.

I'm using a 20MHz crystal, PLLCR=4, and DICSEL=2 (sys clock = 40MHz).

The init pll function (void InitPll(Uint16 val, Uint16 divsel)) always pass the lock check (while(SysCtrlRegs.PLLSTS.bit.PLLLOCKS != 1)).

  • This device uses INTOSC1 as the clock source upon power-up. It is inconceivable that a large number of devices have a defective INTOSC1. I have a feeling the "limp mode" happens after your code switches to the external crystal.

    Do you see a problem if you continue to operate only with INTOSC1? i.e. don’t switch to external XTAL?

    Have you probed X1/X2 pins to ensure the crystal is oscillating?

    Can you please program a simple GPIO toggling code in Flash (after disabling the WD) and see if the behavior persists? Please do this with INTOSC1 and XTAL as the clock source.

    Are you referring to the most recent version of the TRM, ? The behavior of the Missing Clock Detect circuitry has been significantly updated in this document compared to previous versions.
  • Yes, it happens after switching to external crystal.

    When debugging with the XDS110 the GPIO toggles at 540.5kHz, after removing the XDS110 and re-powering the microcontroller, the GPIO toggles at 33.8kHz. I'm running the following code:

        GpioDataRegs.GPATOGGLE.bit.GPIO16 = 1;
        asm(" RPT #25 || NOP");

    Running the same code on INTOSC1 (PLLCR=8, and DIVSEL=2), the GPIO toggles at 555.6kHz with the XDS110 debug probe. Without the debug probe the GPIO pin sometimes toggles at 555.6kHz, sometimes 277.8kHz. Powering off/on the microcontroller it's random if the GPIO toggles at 555.6kHz or 277.8kHz.

    If I probe the X1/X2 pins the microcontroller does not start (GPIO pin always low, with and without debugger). I'm using a 11.1pf probe with ~1cm ground wire. I don't see any oscillations in the range of 20MHz.

    I'm using an identical crystal with a 28374D on the same board and this works all the time.

    I'm using the TRM from December 2018

  • Increasing the delay after turning on the XTALOSC from 1ms to 10ms is helping.

    SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 0;     // Turn on XTALOSC
    // 10mS delay to ensure crystal oscillator is up and running.
    // Adjust as needed.
    SysCtrlRegs.CLKCTL.bit.XCLKINOFF = 1;      // Turn off XCLKIN
    SysCtrlRegs.CLKCTL.bit.OSCCLKSRC2SEL = 0;  // Switch to external clock

    Thanks for your help!

  • Yes, that delay is needed to account for the startup time of the crystal oscillator.