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