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.

Missing clock logic for TMS320F28027

In case of missing clock there are tow methods

1. NMI interrupt to enable and handle it in interrupt routine to switch over to oscillator 1

2. Check missing clock flag status (if SysCtrlRegs.PLLSTS.bit.MCLKSTS != 0 )

There are two case his will happen

1. When normal program is running and suddenly the clock fails

2. During reset (that is program start from first line after main) the clock is failed

Questions.

A. In above two cases how to switch over to internal oscillator 1 from external oscillator. As when MCU gets reset we have configured (InitSysCtrl();) for external oscillator only, However, that clock is failed then how the switch over will occur. As  we configured NMI interrupt   later in the main program code.

B. Also, after switch over to oscillator 1 is it require to reconfigure PLL.

C. Moreover, even without using NMI inteeupt can we switchover to internal oscillator for clockfail condition when program is in normal operation. If yes please tell the process

  • Ashutosh,

    B. Yes, on a missing clock condition user needs to reconfigure the PLL.

    A, C. If you don't want to use NMI ISR to do clock switching. All you need to is don't turn off INTOSC1. When missing clock condition happens with external oscillator as input clock, the input clock automatically switches to INTOSC1. But, it upto the user to reconfigure PLL as PLL gets bypassed on missing clock condition.

    Regards,
    Manoj
  • Dear Manoj,
    1. Do u mean we can keep both crystal and internal oscillator ON. If it is so how MCU will decide which is activated.
    2. If there is automatic switchover to internal oscillator 1. Why pll is required to re configure.
    3. If automatic switchover happens then how we will know that switchover has happened and we need to reconfigure PLL
  • Ashutosh,

    1) Yes, both crystal and internal osc should be ON. which clock will be used as OSCCLK (input clock to PLL) will be decided by CLKCTL register settings.

    2) When a CLOCKFAIL condition happens, PLL gets bypassed and OSCLK switches over to INTOSC1 automatically

    3) CLOCKFAIL condition triggers NMI. You can re-configure PLL in ISR routine.


    For more details, please refer pg 44

  • Please close this thread if your question is resolved / answered. This will help future community people to better utilize the forum.