Kinetis K20D72M development kit - Unable to generate Interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kinetis K20D72M development kit - Unable to generate Interrupt

791 Views
mathewjmanavala
Contributor II

Hi all, 

I have a Kinetis K20D72M development kit and im trying out some basic Bareboard stuff with it. I am trying to configure an interrupt to be triggered by one of the switches present on the board (SW1). I used Processor Expert to configure the pin “PTC1/DSPI0_PCS3/SCI1_RTS/FTM0_CH0/FBA_AD13/LCD_P21/ADC0_SE15/TSI0_CH14” as interrupt. I get an ISR generated in the Events.c file. 

I run the code and press the switch but the code doesn’t enter the ISR. 

Am I missing something here ? I have not modified a single line of code. I am using whatever code the Processor Expert has generated. 

Any help is appreciated. 

Thanks and Regards,

Mathew

Labels (1)
Tags (1)
0 Kudos
4 Replies

633 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Please download and refer TWR-K20D72M board example software from here.

Wish it helps.


Have a great day,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

633 Views
mathewjmanavala
Contributor II

Hi,

This sample set was very useful. The interrupt works in the demo_gpio sample. I have something to move forward with. Still I would like to know what was missing in the configuration I did with the Processor Expert.

Thank you sir,

Regards,
Mathew

0 Kudos

633 Views
mjbcswitzerland
Specialist V

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

633 Views
mathewjmanavala
Contributor II

HI Mark,

Thanks for the pointers. I am a beginner with the platform and I am simply trying to configure the interrupt using a bareboard project. The configuration for the interrupt was purely done using the Processor Expert alone. Any tips/docs on using the PE will be highly appreciated (apart from the document that comes with the CodeWarrior installation).

I have uploaded the project files. Will share the link as soon as i can.

Thanks,

Mathew

0 Kudos