1 Introduction
Test Name: CPU_REGISTER_RESET_STATE_CHECK
Purpose of test: Checks registers at start-up. Description: This diagnostic test performs an initialization time check of the default value (expected Reset state) of all CPU control and status registers. It helps detect incorrect Reset or default states of individual bits or registers. If the Reset state of any register is found incorrect, the function reinitializes the register with its correct default value. The return value is a simple PASS/FAIL result.CPU registers considered for RESET state check are:
-
STATUS
-
WREG
-
FSR0H
-
FSR0L
-
FSR1H
-
FSR1L
-
FSR2L
-
FSR2H
-
PRODL*
-
PRODH*
-
PCLATH
-
PCLATU
-
BSR
-
TABLAT
-
TBLPTRU
-
TBLPTRH
-
TBLPTRL
These registers are supported only for the PIC18(L)FxxK42 device family. Some user-requirements and limitations of this diagnostic API are listed below:
(a) Execute this diagnostic prior to any other diagnostic on start-up to avoid incorrect operation of other diagnostics or application initialization code due to unexpected initial register values.
(b) Do not enable any interrupts before executing this diagnostic test.
(c) The PCL, STKPTR, TOSU, TOSH and TOSL registers are not tested in this diagnostic mechanism, because the C run-time start-up environment would initialize and modify these registers, thereby making their states unpredictable. Furthermore, the PRODH and PRODL are not supported for other devices, except the K42 family for the same reason.
Note:
API Documentation:
CPU Registers Reset State Check Follow the AoUs listed in the Assumption of Use to ensure correct operation of the diagnostic APIs.