To enable a peripheral interrupt, perform the following steps:
- Disable interrupts globally (DINT or SETC INTM).
- Enable the PIE by setting the ENPIE bit of the PIECTRL register.
- Write the ISR vector for each interrupt to the
appropriate location in the PIE vector table, which can be found in Section 3.4.6.
- Set the appropriate PIEIERx bit for each
interrupt. The PIE group and channel assignments can be found in Section 3.4.6.
- Set the CPU IER bit for any PIE group containing enabled interrupts.
- Enable the interrupt in the peripheral.
- Enable interrupts globally (EINT or CLRC INTM).
Step 4 does not apply to the Timer1 and Timer2 interrupts, which connect directly to the CPU.