RTI Interrupt does not enter ISR -- 9S12XDP512

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

RTI Interrupt does not enter ISR -- 9S12XDP512

1,333 次查看
dfrancis
Contributor I

Hello All,

 

I am using Codewarrior v 5.7.0 and am working on an application that requires an RTI to update graphics to an LCD. I have scanned the forums throughly and came up with this scheme for my RTI. I am using the 9S12XDP512 on an ADAPT9S12XD board over a serial RS232 connection. 

 

 

#include <hidef.h>      /* common defines and macros */#include <mc9s12xdp512.h>     /* derivative information */#pragma LINK_INFO DERIVATIVE "mc9s12xdp512"#pragma CODE_SEG __NEAR_SEG NON_BANKEDinterrupt void RTI_ISR(void) {      PTP = 0x80; //turns on an onboard LED     CRGFLG = 0x80;}#pragma CODE_SEG DEFAULTvoid RTIinit(void) {   RTICTL = 0x63;   CRGINT = 0x80;   CRGFLG = 0x80;}void main(void) {   DDRP = 0xFF; //Set Port P to Output   RTIinit();    EnableInterrupts;  for(;;) {} /* wait forever */}

 

VECTOR ADDRESS 0xFFF0 RTI_ISR  //in my .prm file

 

 

This code is not turning on the LED as expected meaning it never enters the ISR. Any help or suggestions would be greatly appreciated. Thanks!

标签 (1)
0 项奖励
7 回复数

659 次查看
CrasyCat
Specialist III

Hello

 

I tested this code on my CodeWarrior HC12 V5.1 (The current release for HCS12X).

 

I set a breakpoint at the beginning of the function RTI_ISR and  the interrupt is generated.

 

Did you try setting a BP in the interrupt? Is application stopping?

 

CrasyCat

0 项奖励

659 次查看
dfrancis
Contributor I

Thanks for the reply. I did attempt a BP at the ISR and it appears to stop the application from running when it enters the ISR. Any code attempted after initializing the RTI does not run and I lose connection to the 9S12X. Is this a possible issue with the placement of my code (_Startup is at $B100)?

0 项奖励

659 次查看
kef
Specialist I

What is memory model? _Startup at b100 is wrong, unless memory model is small.

0 项奖励

659 次查看
dfrancis
Contributor I

Hello Kef,

 

I am using a banked memory model. The code originally had a startup at $C000, but code would not run at that place (application failed) so I moved it in order for it to work (I see now that was wrong). I have only began to run into problems implementing interrupts, as before I was using SCI, ATD etc with no issues. This is my first experience with banked memory model as previously I have only used the HC12B32. Where should my _Startup be initialized and do I need to manipulate GPAGE and/or PPAGE? Thank you so much

0 项奖励

659 次查看
kef
Specialist I

Just restore prm file to original state. Default nonbanked ROM segment should start at 0xC000.

0 项奖励

659 次查看
dfrancis
Contributor I

I have created a fresh project file with the prm (untouched except for the interrupt vector) having nonbanked ROM enter at $C000. This only code I am running is the original interrupt scheme seen above. The application does not run when I use $C000 as the _Startup address. I have even tried simply turning on a pin with no interrupt to no avail. I am using the ubug12x program to connect serially to my uC board and giving the command GO $C000. Am I using the banked memory incorrectly to run programs? I apologize for my lack of familiarity with this uC. Thanks in advance.

0 项奖励

659 次查看
kef
Specialist I

Is program really loaded to target MCU using ubug12x? BTW is it BDM pod?

If you load program "serially", then as I understand it, there is some program running on target MCU, which accepts program sent over SCI and writes it to flash. If it is so, then there must be some restrictions and requirements for where and how should you place and specify your interrupt vectors. For example your ubug stuf may require initializing some jump table in RAM. Check the docs. Anyway 0xC000 address should be perfectl for _Startup routine.

0 项奖励