S12X RTI Interrupt vector, linker fails

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

S12X RTI Interrupt vector, linker fails

725 Views
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)

Labels (1)
0 Kudos
1 Reply

257 Views
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 Kudos