There are errors in the current Q40/Q41 datasheets and mplabx DFP device files (which are used to generate the SF device files).
The IRQ numbers for interrupt vectors 49-55 are incorrect (PIE6/PIR6/IRP6 show bit 1 is unused, and the IRQ's don't take this into account).
The device files should be:
Code: Select all
IRQ_INT1 = 48, // irq 48 - External Interrupt 1
// irq 49 = unused
IRQ_CWG1 = 50, // irq 50 - CWG Interrupt
IRQ_NCO1 = 51, // irq 51 - NCO1 Interrupt
IRQ_DMA2SCNT = 52, // irq 52 - DMA2 Source count Interrupt
IRQ_DMA2DCNT = 53, // irq 53 - DMA2 Destination count Interrupt
IRQ_DMA2OR = 54, // irq 54 - DMA2 Overflow Interrupt
IRQ_DMA2A = 55, // irq 55 - DMA2 Abort Interrupt
IRQ_I2C1RX = 56, // irq 56 - I2C1 Receive Interrupt