12.3.7.1 CFD Operation

The CFD feature detects a failed oscillator or clock source by checking for edges on the selected oscillator/clock. If no edges are detected within a specific time, a CFD condition is issued and triggers an interrupt or forces the device to switch to a stable internal clock source.

Figure 12-4. Clock Failure Detection Block Diagram

When the CFD feature is enabled, it will monitor the selected source from the Clock Failure Detection Source (CFDSRC) bit field in the Main Clock Control C (CLKCTRL.MCLKCTRLC) register. In sleep, the CFD will only be enabled if the selected source is active.

If a CFD condition occurs, the CFD interrupt flag in the Main Clock Interrupt Flags (CLKCTRL.MCLKINTFLAGS) register is set. If the interrupt is enabled, an interrupt request is issued. The Interrupt Type (INTTYP) bit in the Main Clock Interrupt Control (CLKCTRL.MCLKINTCTRL) register determines if a normal interrupt or a Non-Maskable Interrupt (NMI) will be issued. If the NMI is selected, and more than one interrupt source is set to NMI, it is necessary to check the vector to see which source experienced an interrupt.

If the monitored clock source is the main clock and it fails, everything running on it will stop. In this case, the CFD condition will overwrite the Clock Selection (CLKSEL) bit field in the Main Clock Control A (CLKCTRL.MCLKCTRLA) register to select the start-up clock source, which is changed back to its Reset frequency.

The start-up clock source is defined as the clock the system runs on after a Power-on Reset (POR). This start-up clock source is selectable by fuse(s).

When the CLKSEL is overridden by a CFD event, the CLKOUT signal will be disabled.

Figure 12-5. Clock Failure Detection Timing Diagram