S12X RTI Interrupt vector, linker fails

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

S12X RTI Interrupt vector, linker fails

1,098 次查看
dfrancis
Contributor I

Hello All,

 

I am using CodeWarrior Vers 5.7.0. I am trying to initialize the RTI vector in my .prm file and keep being told that the following code is "under or overflow of vector value". I am new to the s12x and am used to the old HC12 interrupt vector table scheme. Am I initializing this vector to the proper address ( I got 0xFFF0 from the .header file produced by codewarrior)?

 

VECTOR ADDRESS 0xFFF0 RTIHndlr

 

As well, here is my C code for init and ISR of the RTI.

 

 

interrupt void RTIHndlr(void) {  if (count >= 9) {    ATD_In /= count;    count = 1;    ATD_Avg = ATD_In;    ATD_In = 0x00;      } else {    while((ATD0STAT0 & 0x8000) == 0x8000) {}  ATD_In += ATD0DR0H;       } count++;  CRGFLG = 0x80;}void RTIinit(void) { count = 1;    RTICTL = 0x87;   CRGFLG = 0x80;   asm cli;}

Thank you all so much (P.S. this is for an ATD application that averages a sample every predetermined time cycle)

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

630 次查看
kef
Specialist I

ISR's should be put to nonbanked memory. Add these pragmes above and below your ISR's:

 

#pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt void myISR(void)

{

}

#pragma CODE_SEG DEFAULT

0 项奖励
回复