Interrupt only works in main loop, not in subroutines???


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    You might be getting a stack overflow due to missing resume at the end of intManagement routine when it finally does exit there . . .
    I have resume at the end of intManagement

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    That is one of the problems with ON INTERRUPT. Not sub routines but ON INTERRUPT waiting for certain commands to finish.

    From the manual
    When an interrupt occurs, it is flagged. As soon as the current PICBASIC PRO™ statement=s execution is complete, the program jumps to the BASIC interrupt handler at Label. Once the interrupt handler is complete, a RESUME statement sends the program back to where it was when the interrupt occurred, picking up where it left off.
    PBP will not enter the BASIC interrupt handler until it has finished executing the current statement. If the statement is a PAUSE or SERIN, it could be quite a while before the interrupt is acknowledged. The program must be designed with this latency in mind. If it is unacceptable and the interrupts must be handled more quickly, an assembly language interrupt routine must be used.
    So you will want to use ASM interrupts or DT's instant interrupts. DT basically makes ASM interrupts easy.

    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Last edited by mackrackit; - 30th November 2010 at 14:14.
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

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