Michael Geer

MC9S08JM16 Interrupt Vector in C

Discussion created by Michael Geer on Aug 14, 2012
Latest reply on Aug 15, 2012 by Erich Styger

Once again, a rediculously easy task in ASM and I'm lost in C.

 

I have searched and found 3 methods to add an Interrupt Vector in C, none seem to work.

 

http://www.freescale.com/files/microcontrollers/doc/app_note/AN2616.pdf

 

This is in Start_08.c:

PTBDD_PTBDD5 = 0;KBIES_KBEDG5 = 1;KBIPE_KBIPE5 = 1;KBISC_KBIE = 1;

   I tried putting this ISR in main.c AND Start_08.c:

void _MyInterrupt(){    // do something}

 and tried adding this to the .prm file:

VECTOR ADDRESS 0xFFCC _MyInterrupt

I removed the above line of code from the PRM and I have renamed the ISR to:

interrupt void _MyInterrupt(void)

 and:

interrupt 25 void _MyInterrupt(void)

and:

interrupt VectorNumber_Vkeyboard void _MyInterrupt(void)

and I have tried all of the above with:

__interrupt

(Can someone tell me the difference of adding the two underscores?)

 

and I made sure I added in my main.c:

EnableInterrupts;

 I get an error in the debugger:

Code loading overlap detected in range 0x0000FFCC...0x0000FFFF

 

I also mixed and matched a dozen combinations of the above methods, nothing has worked.

 

Can someone PLEASE tell me from scratch, in a BRAND NEW PROJECT in C (CodeWarrior 6.x), what do I type where to get a Keyboard Interrupt on Pin 19 (PTB5/KBIP5) that calls the ISR "void _MyInterrupt()"???

 

Thanks in advance, much appreciated!!!

 

-Mike

Outcomes