1 Introduction

Test Name: CPU Self-Test Diagnostic  

Purpose of Test: Verify the functional correctness of all CPU instructions and core features.  

Acceptable Measure: Functional Test.  

Setup: Disable interrupts completely during the execution of each test subset function.  

Description: The CPU Self-test is intended to periodically verify that all CPU core features are working correctly during run-time. The test is divided into three subsets and each subset tests different parts of the CPU core. During test execution, each subset will store register context to SRAM, perform a series of tests and the results are stored in the CPU registers R0-R31. Intermediately, the register values are compared with the expected values to verify correctness of instructions.  

If this test passes, the 16-bit passing signature is incrementally built and the test continues to the next part of the subset until it reaches the end of the test. If the registers do not contain the expected values, the test is aborted and will skip the rest of the subset. At the end of each subset, the register context is restored so that the application can continue, this happens even if the subset fails.

Error Reporting: Each test subset generates a unique 16-bit numerical test result, which can be compared to the corresponding expected result value. Any mismatch between the generated and expected result can be flagged by the application software as an error condition for that specific test subset.  

 

If the entire subset was executed as anticipated, the 16-bit passing signature will be finalized and the test will conclude under normal conditions, signifying a passed test. If the test encounters a failure at any stage, it will be aborted. Consequently, the passing signature will remain incomplete upon exit, denoting a failed test.  

Refer to the PIC® Instruction Set Manual for a complete list of instructions available for the device. Refer to the device Safety Manual for more details of the test.

Notes:
  1. The SLEEP and SPM instructions are not tested due to not being recommended for use in a safety application.  

  2. The functionality of the WDR instruction is tested by the WDT simple and WDT window test.  

  3. Interrupt functionality is not tested in the CPU_SELF_TEST_LIB, but is covered by the INTERRUPT_FREQUENCY_TEST.  

     

    API Documentation: SW_CPU_SELF_TEST_LIB_01

Assumptions of Use:

  • AoU-SW_CPU_SELF_TEST_LIB_01: Intermediate Result Bank Start Address and End Address should not exceed 0xFFF.  

    Reason: PIC18F CPU self-test Subset-1 tests the MOVFF instruction. This instruction has a twelve bit address range. This range can only contain addresses between 0x00-0xFFF. Failing to configure the address between the mentioned range will lead to failure of Subset-1.