Hi Mathew
You will need to post your project so that the reason can be looked into.
If you are starting on a project don't miss looking it to µTasker Kinetis TWR-K20D72M support
This gives you much more powerful features and also allows you to simulate the K20 and your board in real-time, whereby all operatiosn have been extensively tested and so there are no problems with parts that may or may not operate as expected.
For port interrupts you can assign an individual handler to every pin, each with different trigger property. An example is:
extern void fnConfigPinInterrupt(void)
{
INTERRUPT_SETUP interrupt_setup; // interrupt configuration parameters
interrupt_setup.int_type = PORT_INTERRUPT; // identifier to configure port interrupt
interrupt_setup.int_handler = fnPinInterrupt; // handling function
interrupt_setup.int_priority = 1; // interrupt priority level (low priority since not critical)
interrupt_setup.int_port = PORT_A; // the port that the interrupt input is on
interrupt_setup.int_port_bits = PORTA_BIT13; // the interrupt input
interrupt_setup.int_port_sense = (IRQ_FALLING_EDGE | PULLUP_ON); // interrupt falling edge sensitivity with internal pull-up connected
fnConfigureInterrupt((void *)&interrupt_setup); // configure interrupt
}
static void fnPinInterrupt(void) // button has been pressed
{
// Handling code here (in interrupt context and interrupt source has been cleared)
}
Regards
Mark
Kinetis: http://www.utasker.com/kinetis.html
K20: µTasker Kinetis TWR-K20D72M support / http://www.utasker.com/kinetis/FRDM-K20D50M.html / http://www.utasker.com/kinetis/TWR-K20D50M.html / http://www.utasker.com/kinetis/TEENSY_3.1.html
For the complete "out-of-the-box" Kinetis experience and faster time to market