can someone supply a complete working example of an API or RTI   ISR() ?

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

can someone supply a complete working example of an API or RTI   ISR() ?

1,723件の閲覧回数
checkers
Contributor III

I am trying to use Processor Expert to enable the API interrupt, but it does not work. It seems that the ISR is never called.

 

So, is there a complete working example somewhere that I can try?

ラベル(1)
0 件の賞賛
返信
7 返答(返信)

1,261件の閲覧回数
checkers
Contributor III

Ok. I allowed PE to generate the ISR code in events.c

The TimerInt component name is LoopTimer.

The name of the ISR is LoopTimer_OnInterrupt()

I have also selected RTIfree as the periodic interrupt source.

I compile and load to the product, When I debug this and single step through the ASM code, the product resets as soon as the _IE() statement is executed.

Does this mean that there is some other ISR missing? Vtri is defined in Vectors.c. What else is missing?

Oddly, this problem only exists when I have fully defined all pins on the micro using PE. I can get this to work if it is the only PE component. So, there must be some interaction with another component in my product configuration.

Can you provide any guidance here?


0 件の賞賛
返信

1,261件の閲覧回数
checkers
Contributor III

Well, I decided to start over. This time I started with TimerInt and added all of the other components. After I added each, I tested to see if it was broken. I went through the entire configuration and now there is no problem at all.

So, what really went wrong? Is it that important to define the TimerInt component first or is this a bug in the Processor Expert.

0 件の賞賛
返信

1,261件の閲覧回数
RadekS
NXP Employee
NXP Employee

Here you can find two example codes for API timer.

https://community.freescale.com/docs/DOC-93814

Note: Example codes are for S12G, but it could be simple modify for S12P.

Example codes didn’t use PE (just C code).

G240-API-CW51.ZIP contains example code for trimming API timer to 10kHz (API isn't factory trimmed).

G240-API+STOP-CW51.ZIP contains example code for enter to stop mode and periodical wakeup by API interrupt,


0 件の賞賛
返信

1,261件の閲覧回数
checkers
Contributor III

Thank you for the example, but I need more. I have tried to write an ISR for the RTI but can't seem to get it right. Do you have the actual ISR that goes with this example? (my_rti_isr)

0 件の賞賛
返信

1,261件の閲覧回数
checkers
Contributor III

I would also like to know where it should be stored. Does it go in the same file with main()?

0 件の賞賛
返信

1,261件の閲覧回数
vfilip
NXP Employee
NXP Employee

Hello,

I think the best way is to let PEx to generate it. Go to ProcessorExpert option and set Generate ISR option to Yes. After that the ISR will be generated into Events.c file.

However you can also put the ISR into main.c (without this option enabled):

ISR(my_rti_isr){

}

best regards

Vojtech Filip

Processor Expert Support Team


0 件の賞賛
返信

1,261件の閲覧回数
vfilip
NXP Employee
NXP Employee

Hello,

please find the attached screen-shot that should help you to get set-up API interrupt work on your side.

Note:

Please post future ProcessorExpert related question on Processor Expert Software forum:

Processor Expert Software


best regards

Vojtech Filip

Processor Expert Support Team


0 件の賞賛
返信