2.1.2.1 DIAG_CPU_Registers()
diag_result_t DIAG_CPU_Registers (void )
Validates CPU registers for stuck bits and neighboring Coupling Faults. This diagnostic writes a checkerboard pattern and an inverse checkerboard pattern to the testable bits in the CPU registers (R0-R31), Status Register (SREG) and the Stack Pointer (SP). If an error is detected, the registers are restored before the test result is returned.
-
The Global interrupts status is backed up and disabled.
-
The CPU register context is pushed to the stack.
-
The Zero Flag of the Status Register is tested to ensure that branching is working correctly.
-
The R16 CPU register is tested as it is used for the rest of the test.
-
The remaining CPU registers are tested (R0 to R15 and R17 to R31).
-
The SREG is tested, except for the Global Interrupt Enable Bit.
-
The SP is backed up, tested and restored.
-
The CPU register context is restored from the stack.
-
Global interrupts status is restored.
-
The test result is returned.
Parameters: None.
