Peder Alm

XAGTE CPU stops working after EnableInterrupts;

Discussion created by Peder Alm on Sep 13, 2006
Latest reply on Sep 15, 2006 by Peder Alm
I'm using MC9S12XDT256, but can't get it to work with interrupts. I'm trying to use the CAN module and want the receiver interrupt to work with this function
#pragma CODE_SEG NON_BANKEDvoid interrupt CAN4RxISR(void) {    unsigned char length, index;    unsigned char rxdata[8];    length = (CAN4RXDLR & 0x0F); for (index=0; index<length; index++)       rxdata[index] = *(&CAN4RXDSR0 + index); /* Get received data */    CAN4RFLG = 0x01;   /* Clear RXF */}#pragma CODE_SEG DEFAULT

 I added the row VECTOR ADDRESS 0xFF92 CAN4RxISR in my .prm file (right address??). In main I added:
void main(){CanInit();while(!(CAN4CTL0&0x10));  /* Wait for Synchronization */   CAN4RFLG = 0xC3;          // Reset Receiver FlagsCAN4RIER = 0x01;          // Enable Receive Buffer Full InterruptEnableInterrupts;for(;;)

After executing the "EnableInterrupts;" row the processor freaks out and no other code executes. What's wrong? I'm not using the XGATE functions nor have I written any code to disable it (do I have to)?