12.3.7.3.1 Testing the CFD Without Influencing the Main Clock
This mode is intended to use run-time. To not influence the main clock when writing to
the Clock Failure Detection Test (CFDTST) bit in the Main Clock Control C
(CLKCTRL.MCLKCTRLC) register, the Clock Failure Detection Source (CFDSRC) bit in
CLKCTRL.MCLKCTRLC must be configured to a clock source different than the main clock.
CFDSRC must be different from ‘0
’. The CFD interrupt flag in the Main
Clock Interrupt Flags (CLKCTRL.MCLKINTFLAGS) register will be set, but the main clock
will not change to the start-up clock source.
- Disable the clock failure
detector by writing a ‘
0
’ to the Clock Failure Detection Enable (CFDEN) bit in CLKCTRL.MCLKCTRLC, and change the source to the oscillator directly by writing a number other than a ‘0
’ to the CFDSRC bit. - Write a ‘
1
’ to the CFD interrupt flag in CLKCTRL.MCLKINTFLAGS to clear the flag. - Write a ‘
1
’ to the CFDTST bit and enable the clock failure detector again by writing a ‘1
’ to the CFDEN bit. - Wait for the CFD bit in CLKCTRL.MCLKINTFLAGS to be set to check that the clock failure works.
- Disable the clock failure
detector by writing a ‘
0
’ to the CFDEN bit, and change the source to the main clock again by writing a ‘0
’ to the CFDSRC bit. - Enable the clock failure detector
again by writing a ‘
1
’ to the CFDEN bit, and write a ‘0
’ to the CFDTST bit.