ON INTERRUPT problem


Closed Thread
Results 1 to 5 of 5
  1. #1
    juszuf's Avatar
    juszuf Guest

    Default ON INTERRUPT problem

    Hi!

    I'm using PIC18F4620 controller, and i would like to ask if i can call sub-routine from basic ISR routine (the lenght of the code is 40 KB). -is it possible?-
    Please advise me, if you can! Thanks.
    By: Toth Jozsi

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


    Did you find this post helpful? Yes | No

    Default

    Hi juszuf,

    That's the only good thing about "ON INTERRUPT"'s.

    You can use any Basic statements inside an ISR, including GOSUB.
    <br>
    DT

  3. #3
    juszuf's Avatar
    juszuf Guest


    Did you find this post helpful? Yes | No

    Default Hi Darrel!

    Thanks for your help, but i cannot use gosub, probably because i want to call another page, page15. Every time the program restarts or freezes. Do you think that it may be the poblem?

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


    Did you find this post helpful? Yes | No

    Default

    If you're trying to gosub to something in "Page 15", then it might be a problem. &nbsp; With the 18F processors, there aren't any Pages. Program Memory is just one big block of Flash. There is a BANK 15, but that's RAM.

    If things are freezing, or restarting, it could be from a "Stack Over/Underflow", or Interrupt Loop.

    Some things to check ...
    Use DISABLE before, and ENABLE after the ISR. AND, any subroutines that you GOSUB to from the ISR.

    The ISR must "RESUME", not RETURN.

    Make sure you reset the Interrupt Flag(s) before resume-ing.

    Never jump out of a Subroutine using GOTO, always RETURN

    Here's some more Stack information from Bruce.
    http://www.picbasic.co.uk/forum/showthread.php?p=2686
    <br>
    DT

  5. #5
    juszuf's Avatar
    juszuf Guest


    Did you find this post helpful? Yes | No

    Default Finally....

    I was able to fix the program, i did not use disable before ISR, so thanks a LOT for your advise!!!

    Bye!

Similar Threads

  1. problem using GOSUB under interrupt
    By fobya71 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 5th March 2010, 19:52
  2. Problem with Interrupt on PIC18F4620 PORTB
    By rookie in forum Off Topic
    Replies: 1
    Last Post: - 22nd March 2007, 01:34
  3. Interrupt Problem
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th November 2005, 20:58
  4. Interrupt stack overflow problem with Resume {label}
    By Yuantu Huang in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd May 2005, 01:17
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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