Hot to handle multiple interrupt sources?


Results 1 to 18 of 18

Threaded View

  1. #1
    Join Date
    Apr 2013
    Posts
    32

    Default Hot to handle multiple interrupt sources?

    Hi guys, I'm working on a project and using PIC16F877A. I need to use multiple interrupts sources as TMR0, TMR1, RB0 etc. but i don't know how to proccess them in different interrupt routines. Is there any way to direct them to releated interrupt routine other than polling their interrupt flags?
    I mean, I know following codes won't work but is there a way to use interrupts like following codes,

    Code:
    ON TMR0 INTERRUPT GOTO tmr0_int
    ON TMR1 INTERRUPT GOTO tmr1_int
    ON RB0 INTERRUPT GOTO rb0_int
    Or do I must use polling methode like following

    Code:
    ON INTERRUPT GOTO INTCHCK
    ....
    ....
    INTCHCK:
    IF INTCON.2=1 THEN
    GOTO tmr0_int
    ENDIF
    IF PIR.0=1 THEN
    GOTO tmr1_int
    ENDIF
    IF INTCON.0=1 THEN
    GOTO rb0_int
    ENDIF
    PS: I would not prefer polling methode since it will lose time while checking flags, it would be great if there is a way to run releated interrupt subroutine directly like some other microcontroller models
    Last edited by elcrcp; - 21st April 2013 at 04:24.

Similar Threads

  1. port handle
    By kumara in forum Code Examples
    Replies: 6
    Last Post: - 2nd October 2012, 23:32
  2. Two interrupt sources in one program
    By Art in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2012, 15:12
  3. Hot Servos
    By The Master in forum Off Topic
    Replies: 37
    Last Post: - 6th August 2010, 18:32
  4. Multiple interrupt source determination
    By PickyBiker in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th April 2010, 17:32
  5. PIC16F887 cant handle HIGH and LOW?
    By xobx in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 16th October 2007, 04:46

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts