How do I make CodeWarrior for MCUs generate a skeleton for an ISR in events.c with a specific pin associated with it?

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

How do I make CodeWarrior for MCUs generate a skeleton for an ISR in events.c with a specific pin associated with it?

Jump to solution
1,143 Views
NNeff
Contributor III

I'm using CodeWarrior for MCUs v. 10.6, creating an application for the Kinetis FRDM-KE06Z with Processor Expert.  I have used the TimerUnit_LDD and CAN interrupts successfully. Now I want to identify a particular pin (PTI0/IRQ/UART2_RX) which has been configured by our hardware engineer to be used for interrupts on discrete inputs. I can't find a component for a user-defined interrupt: when I try to create an InterruptVector component, it tries to create a NMI and I get the error messages shown in the attachment.  CodeWarrior always generates an events.c that has as its first ISR void Cpu_OnNMI(void) without an InterruptVector component, but for this I can't see how to assign the pin that the discretes are connected to--there doesn't seem to be a component for that, it's the CPU itself I'd guess. When I enable maskable interrupts in the CPU, it builds successfully but there's no corresponding skeleton-function in events.c.  If I create an InterruptVector component and change the interrupt vector to INT_IRQ, for example, there's no place to specify the pin this interrupt would be associated with. I can't find any info in the MCU FAQ manual.  I understand the theory of how interrupts work but I've never created an interrupt "from scratch", only via the built-in components in CW PE, so I'm not entirely sure I've looked in the right places for this. Could someone point me in the right direction to get started?  Thanks.


Labels (1)
0 Kudos
1 Solution
1,013 Views
BlackNight
NXP Employee
NXP Employee
0 Kudos
2 Replies
1,014 Views
BlackNight
NXP Employee
NXP Employee

Hi Nancy,

maybe this article can help you:

Tutorial: User Interrupts with Processor Expert | MCU on Eclipse

Erich

0 Kudos
1,013 Views
NNeff
Contributor III

Thank you Erich!  It seems to be working using an ExtInt_LDD.  I won't get hardware for a couple of weeks to actually test it, but I do have an "_OnInterrupt" event in my events.c now, so I can continue coding.

Just FYI, the tutorial was written for CW 10.4; in 10.6, there is no "Interrupts" section for the Init_GPIO component, so I couldn't figure out how to use that, even though the tutorial says that Init_GPIO is preferred when one needs to set those values. I expect I can write directly to the applicable registers (when I figure out what they are) to get the correct settings for the pull-resistor, etc.

Thanks again.

0 Kudos