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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
2,971件の閲覧回数
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.


ラベル(1)
0 件の賞賛
返信
1 解決策
2,841件の閲覧回数
BlackNight
NXP Employee
NXP Employee
0 件の賞賛
返信
2 返答(返信)
2,842件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hi Nancy,

maybe this article can help you:

Tutorial: User Interrupts with Processor Expert | MCU on Eclipse

Erich

0 件の賞賛
返信
2,841件の閲覧回数
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 件の賞賛
返信