To prevent spurious interrupts from the PORT event while configuring the sources, the following steps must be performed: Disable interrupts on the PORT event (through INTENCLR.PORT). Configure the sources (PIN_CNF[n].SENSE). Clear any potential event that could have occurred during configuration (write 0 to EVENTS_PORT). Enable interrupts (through INTENSET.PORT).