Re:How do I catch interrupts on general purpose I/O pins of PIC32?
You can generate interrupts on CNx pins, INTx pins and ICx pins. The reference manuals go into the specifics about these peripherals. There are some examples I believe included in the C32 installation directory to get you started. The Microchip Application Library (MAL) - Google it - also might include something of the sort, but in general, your best bet is looking in the C32 installation directory. So, you cannot in general pick some arbitrary pin without understanding what HW is behind it to generate an interrupt.
My directory structure for the example using the CNx (Change Notice) is as follows:
Another example for ICx (Input Capture):
You get the idea. Don't be scared to explore the directories of the compiler's install location. You're going to need to be familiar with a lot of things the more you get into programming with PIC's.
Also, take a look at the pin-out of your particular device to see which pins are associated with which peripherals. This will help you make some important decisions.