Multiple Interrupts using TMR0 and Interrupt On Change (IOCB) simultaneously


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: Multiple Interrupts using TMR0 and Interrupt On Change (IOCB) simultaneously

    Hi,

    Why don't you use Darrel's interrupts? It's a lot easier than ON INTERRUPT GOTO ISR.

    Also, it is much easier to include a line in your MAIN routine that monitors the state of a switch. You can use the pullup resistors in PORTB, a switch, and a line of code with an IF statement to do what you want. Of course, you need to de bounce the switch.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Multiple Interrupts using TMR0 and Interrupt On Change (IOCB) simultaneously

    If you look into the PBP manual, you will notice that PBP does not handle interrupts like they are meant to be. They are polled. So, there is a lot of latency involved.

    "Using ON INTERRUPT, when an interrupt occurs PBP simply flags the event and immediately goes back to what it was doing. It does not immediately vector to your interrupt handler. Since PBP statements are not re-entrant (PBP must finish the statement that is being executed before it can begin a new one) there could be considerable delay (latency) before the interrupt is handled."
    You should get used to using assembler interrupts in PBP. Much more power and deterministic. Read "interrupts in Assembler" in the manual. Better still, use Darrels' interrupt code as suggested by rsocor01

  3. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default Re: Multiple Interrupts using TMR0 and Interrupt On Change (IOCB) simultaneously

    If you look into the PBP manual, you will notice that PBP does not handle interrupts like they are meant to be. They are polled. So, there is a lot of latency involved.

    "Using ON INTERRUPT, when an interrupt occurs PBP simply flags the event and immediately goes back to what it was doing. It does not immediately vector to your interrupt handler. Since PBP statements are not re-entrant (PBP must finish the statement that is being executed before it can begin a new one) there could be considerable delay (latency) before the interrupt is handled."
    You should get used to using assembler interrupts in PBP. Much more power and deterministic. Read "interrupts in Assembler" in the manual. Better still, use Darrels' interrupt code as suggested by rsocor01

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: Multiple Interrupts using TMR0 and Interrupt On Change (IOCB) simultaneously

    Thanks a lot for your info.

    For the time being, I'll try to keep it as simple as possible, correct my current code according to Richard's and Roscor's remarks
    Roger

Similar Threads

  1. 18F2420, instant interrupts, and TMR0
    By dhickman in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 18:33
  2. 18F2620 tmr0 and interrupts
    By astouffer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th March 2009, 00:56
  3. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  4. 3 Timer Interrupts Running simultaneously
    By emavil in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th February 2007, 03:49
  5. Programming Multiple PICs Simultaneously
    By Archangel in forum General
    Replies: 13
    Last Post: - 16th January 2007, 19:42

Members who have read this thread : 0

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

Posting Permissions

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