title: XC8 Interrupt Configuration
body: <p>I am trying to write a timer interrupt for a pic16f887. I have checked on several websites and most of them recommend writing the interrupt subroutine as </p>
  
  <p>void interrupt Name (void)</p>
  
  <p>however my program says that by doing so I am conflicting my interrupt name with the Isr.
  main.c:42: error: (1375) multiple interrupt functions (_led and _isr) defined for device with only one interrupt vector</p>
  
  <p>This is a sample of my code.</p>
  
  <pre><code>/******************************************************************************/
  /* Files to Include                                                           */
  /******************************************************************************/
  
  #define _XTAL_FREQ 4000000
  
  #include &lt;xc.h&gt;
  #include &lt;stdint.h&gt;        /* For uint8_t definition */
  #include &lt;stdbool.h&gt;       /* For true/false definition */
  #include &lt;htc.h&gt;
  
  #include "system.h"        /* System funct/params, like osc/peripheral config */
  #include "user.h"          /* User funct/params, such as InitApp */
  #include "pic16f887.h"
  /******************************************************************************/
  /* User Global Variable Declaration                                           */
  /******************************************************************************/
  
  /* i.e. uint8_t &lt;variable_name&gt;; */
  
  /******************************************************************************/
  /* Main Program                                                               */
  /******************************************************************************/
  // CONFIG1
  #pragma config FOSC = INTRC_CLKOUT// Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN)
  #pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
  #pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
  #pragma config MCLRE = OFF      // RE3/MCLR pin function select bit (RE3/MCLR pin function is digital input, MCLR internally tied to VDD)
  #pragma config CP = OFF         // Code Protection bit (Program memory code protection is disabled)
  #pragma config CPD = OFF        // Data Code Protection bit (Data memory code protection is disabled)
  #pragma config BOREN = ON       // Brown Out Reset Selection bits (BOR enabled)
  #pragma config IESO = OFF       // Internal External Switchover bit (Internal/External Switchover mode is disabled)
  #pragma config FCMEN = OFF      // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
  #pragma config LVP = OFF        // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)
  
  // CONFIG2
  #pragma config BOR4V = BOR40V   // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
  #pragma config WRT = OFF        // Flash Program Memory Self Write Enable bits (Write protection off)
  
  void interrupt led(void)
  
  
  {
      PORTA = 0X00;`enter code here`
  
  }
  
  
  void main(void)
  {  
     OSCCON = 0b01110000;
  
      TRISA = 0X00;
      ANSEL = 0X00;
      ANSELH = 0X00;
  
      while(1)
      {
          PORTA = 0X03;
          __delay_ms(1000);
          PORTA = 0X01;
          __delay_ms(1000);
  
  
      }
  
  }
  </code></pre>