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.
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,
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.