calling subroutine triggers interrupt


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: calling subroutine triggers interrupt

    I think Steve meant to clear the flag before the GOSUB TEST, not before the ON INTERRUPT GOTO.

    It GOSUB's from an area that is DISABLEd to one that is ENABLED.
    If the flag is set, it will jump to the ISR.
    It may jump, even if it's not set.

    The ISR should verify that the flag is set before doing anything.
    Last edited by Darrel Taylor; - 19th May 2011 at 14:43.
    DT

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: calling subroutine triggers interrupt

    Without INTCON.7 set before ON INTERRUPT, it's going to jump to your interrupt vector all the time in any code section where interrupt code is inserted. If you just set INTCON.7 it should never jump there until the hardware interrupt clears INTCON.7 automatically.

    INTCON = %10000 doesn't set INTCON.7 - so the ON INTERRUPT code inserted always assumes an interrupt condition exists.
    Last edited by Bruce; - 19th May 2011 at 18:28.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Dec 2009
    Location
    Canada
    Posts
    68


    Did you find this post helpful? Yes | No

    Smile Re: calling subroutine triggers interrupt

    Darrel, Bruce,

    Thank you!

    I tried to move "On interrupt goto" to the very top and also check flag in the interrupt handler, either one works just fine.

    Will play with INTCON.7 tomorrow morning.

    Thanks again, the problem seems to be solved

    Alexey

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