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
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
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
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?
If you're trying to gosub to something in "Page 15", then it might be a problem. 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.Here's some more Stack information from Bruce.
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
http://www.picbasic.co.uk/forum/showthread.php?p=2686
<br>
DT
I was able to fix the program, i did not use disable before ISR, so thanks a LOT for your advise!!!
Bye!
Bookmarks