Interrupts

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

Interrupts

3,631 Views
ernestsnaith
Contributor I
I am having difficulties with the interrupt vector table.
 
I have blagged some code (C) and cant work out how the interrupts work. One example is
 
interrupt 38 void CANRECEIVE()
interrupt 56 void PORTP()
 
In datasheet i cant match the 38, where does it come from?
 
datasheet quotes vector adress (+ base) and XGATE channel ID.
 
Please could someone explain the base address and how the numbering works
 
Many thanks
 
 
Labels (1)
0 Kudos
2 Replies

442 Views
CrasyCat
Specialist III

Hello

Basically it works in the following way:

interrupt number 0 is the reset vector (located at 0xFFFE in the vector table).

interrupt number 1 is the vector located at address 0xFFFC in the vector table.

and so on.

I hope this helps.

CrasyCat

0 Kudos

442 Views
CCandido
Contributor V
Hi,
PORT=P0
 
void  __interrupt 56 EInt1_Interrupt(void) {
 
code.....................
 }
//--------------------------------------------
void EInt1_Enable_Disable(uchar ED){
     
      HPRIO = 142;
        PIFP = 1;                             /* Clear flag */
 if(ED)
        PIEP_PIEP0 = 1;                   /* Enable interrupt */
 else
        PIEP_PIEP0 = 0;                    /* Disable interrpt */
}
//--------------------------------------------
Edited by Carlos Candido.
0 Kudos