19.3.2.4.1 Fault Injection

The Control B (CTRLB) register controls fault injection into VMON. The VMON Diagnostic Mode (DMODE) bitfield controls the type of fault injected (correct voltage, undervoltage or overvoltage). Writing DMODE to UNDER or OVER brings VMON into diagnostic mode, triggering a fault injection. Writing DMODE to NO brings VMON out of diagnostic mode. A successful error injection will set the VOV or VUV flags in the INTFLAGS register but will not trigger a Machine Check Reset. When the VMON has entered diagnostic mode, the VMON Has Entered Diagnostic Mode (VDENTER) flag in the INTFLAGS register is set. This flag can also be used to detect if VMON has entered the diagnostic mode in error.

Note: Use the diagnostic mode only when the device runs with the voltage regulator in normal mode (VREGCTRL.PMODE = AUTO), and the power mode is Maximum Performance (see the Voltage Regulator Configuration section for details). Do not use the diagnostic mode when OSC32K is the only active clock source.

When VMON enters diagnostic mode, an internal diagnostic timer in VMON starts. If the VMON has not transitioned to normal mode before the timer reaches its timeout value (TDIAGNOSTIC in the figure below), VMON is automatically transitioned to normal mode. To manually end diagnostic mode, write DMODE to NO. The application is expected to manually end diagnostic mode once the diagnostic has been completed with the expected result, enabling maximum system protection as soon as possible. The automatic transition to normal mode upon timeout is intended as a safety mechanism in case a fault in the system somehow prevents manual exit from diagnostic mode.

During the diagnostic cycle, the VUV and VOV flags in the INTFLAGS register are updated as appropriate. The flags can be polled or interrupts enabled for VUV and VOV to detect that the diagnostic is successful. A failed diagnostic, meaning VUV and/or VOV not being set as expected, can be detected by the diagnostic timer reaching its timeout value and the VMON Has Exited Diagnostic Mode (VDEXIT) flag in the INTFLAGS register being set. The VDEXIT flag is also set if VMON transitions to normal mode by writing the DMODE bit field of the CTRLB register to NO.

VMON has an internal fault injection state machine with two states: NOTDIAG and DIAG. The following timing diagram shows a manually terminated diagnostic.
Figure 19-2. Manually Terminated Diagnostic
The following timing diagram shows a diagnostic terminated by the timeout mechanism, where VUV and VOV did not get set, potentially due to a failed diagnostic.
Figure 19-3. Diagnostic Terminated by Timeout