PIC32MZ Exception Types

Last modified by Microchip on 2023/11/10 11:08

Table 7.1 in the "PIC32MZ Embedded Connectivity with Floating Point Unit (EF) Family Data Sheet" lists the MIPS32® M5150 MPU core exception types in order of priority, as well as the handler entry points (vector addresses), CP0 Statusxxx bits, CP0 CauseEXEC code, and default XC32 handler identifiers:

MIPS M-class microprocessor core exception types table

MIPS M-class microprocessor core exception types table part 2

PIC32MZ exception handler entry point addresses are elaborated on the "PIC32MZ Exception Entry Points" page.

Statistically, the following exception types will occur most often in a typical PIC32MZ application:

  • Reset Exception
  • Soft-Reset Exception
  • NMI (Non-Maskable Interrupt) Exception, covering such things as:
    • Deadman Timer Time-out
    • Watchdog Timer Time-out (either when the CPU is in run or sleep mode)
    • Clock-Fail (FSCM) detection
  • Interrupt Exception, covering such things as:
    • Peripheral event
    • External pin-change
    • DMA event
  • Execution Exception, covering such things as:
    • Integer overflow
    • Divide by 0
    • Floating-Point or DSP ASE exception

The XC32 default exception handler functions listed in Table 7.1 (_general_exception_handler( )_nmi_handler( ), and _on_reset( )) are weak functions (i.e., they can be overridden by defining your own version in your source code).

Basic PIC32MZ exception & interrupt handling in C is covered on the "PIC32MZ Interrupt and Exception Usage" page.

The _general_exception_handler( ) application code must poll CP0 CauseEXCCODE to determine the source of an unexpected exception. This is covered on the "PIC32MZ Interrupt and Exception Usage" page.