Exception Types

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

Table 3-3 of the PIC32MX795F512L Family Data Sheet lists the MIPS32® M4K® core exception types in order of priority:

Family Core Exception Types

PIC32MX exception handler entry point addresses are further explained on the PIC32MX Exception Entry Points page.

Statistically, the exception types that occur most often in a typical PIC32MX application are:

  • Reset Exception
  • Soft-Reset Exception
  • NMI (Non-Maskable Interrupt) Exception, covering things such 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 things such as:
    • Peripheral event
    • External pin-change
    • DMA event
  • Execution Exception, covering things such as:
    • Integer overflow
    • Divide by 0
    • Floating-Point or DSP ASE exception

The XC32 default exception handler functions (_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).

The general_exception_handler( ) application code must poll CP0 CauseEXCCODE to determine the source of an unexpected exception.

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