Interrupt in pic16f886



THE BOOK of DT's INTERRUPTS is an organization of interrupt service routines and other works written by Darrel Taylor, RIP.

Interrupt routines are arranged per Darrel's original list. Darrel Taylor's Instant Interrupts are an extension of the work of Tim Box whom in October of 2002 wrote INT_CTRL.pbp

Many of the forum members felt this is a long overdue project.

THE BOOK of DT's INTERRUPTS
will be a valuable resource and a tribute to Darrel Taylor the "Fanatical Contributor".

THE BOOK of DT's INTERRUPTS is located at http://dt.picbasic.co.uk/

Interrupt in pic16f886

  1. vatsal
    vatsal
    Hii.. I am newbie to pic16f886...I am trying to toggle leds through external interrupt.. I have enable the GIE, INTF and configured as a edge interrupt...still i am not able to call ISR.Here is my code...



    .void interrupt ISR1(void)
    {
    INTF = 0; // clear the interrupt
    //if(INTF == 1) //If External Edge INT Interrupt
    //{
    UART_Transmit_String("IT is interrupt");
    RC0 = ~RC0; // Toggle RD0 pin
    delay_ms ( 1000 );

    //}
    }


    void main()
    {
    //OSCCON=0x60;
    //TRISC=0XC0; // PORTC data direction register
    init_uart();
    //mem_wr_rd();
    TRISB=0x01;
    TRISC0 = 0; // Make output
    //RC0 = 0;
    //delay_ms ( 1000 );
    //INTF=0;
    InitExternal_INT();
    while(1)
    {
    }
    }
    void InitExternal_INT(void)
    {
    OPTION_REG |= 0x40;
    //TRISB0 = 1; // Make RB0 pin as input
    // IOCB0=1;

    INTCON |= 0x90;
    GIE =1;
    INTE=1;
    PEIE |= 0;// Enable Global + INT interrupt
    // Make INT as posedge triggered
    }
  2. vatsal
    vatsal
    hiii..all...how do i use comparator in pic16f886??
Results 1 to 2 of 2