Beginning with XC16 v1.22, an interrupt service list for each device can be found in the <Compiler-DIR>/docs/vector_docs folder. A convenient index can be found in <Compiler-DIR>/docs/vector_index.html.
The 16-bit devices allow interrupts to be generated from many interrupt sources. Most sources have their own dedicated interrupt vector.
Many 16-bit devices have two interrupt vector tables – a primary and an alternate table– each containing several interrupt vector locations.
The interrupt vector names for a particular device are under the device-specific linker script file (GLD). The interrupt vector name in the GLD file has double underscore (__) but while declaring the interrupt routine in the C source file, the interrupt vector should only have a single underscore (_).
You can refer to the device-specific linker file (GLD) for the PIC24F family under the <Compiler-DIR>\support\PIC24F\gld folder.
Legacy Syntax
Example 1:
UART1 receive interrupt service routine is called whenever a byte of data is received in UART receive buffer.
Device used: dsPIC33EP512GM710
Example 2:
UART1 transmit interrupt service routine is called whenever a data is sent from UART1 transmit buffer.
Device used: dsPIC33EP512GM710
CCI Syntax
Common Compiler Infrastructure (CCI) syntax may be enabled from Project Properties > XC16-gcc > Preprocessing and messages.
With CCI syntax enabled, this is how the interrupt is written:
Example 1 with CCI Syntax Enabled
UART1 receive interrupt service routine is called whenever a byte of data is received in UART receive buffer.
Device used: dsPIC33EP512GM710
Example 2 with CCI Syntax Enabled
UART1 transmit interrupt service routine is called whenever a data is sent from UART1 transmit buffer.
Device used: dsPIC33EP512GM710