Safely getting out of an interrupt


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Safely getting out of an interrupt

    A safer approach is to simply have the interrupt set a flag and return. You main program can be a tight loop that checks flags. When to detects the flag, it GOSUBs to the new location.

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Safely getting out of an interrupt

    Code:
    ;Interrupt Processor:
    ASM
    INT_LIST  macro    ; IntSource,  Label,     Type, ResetFlag? 
            INT_Handler   INT_INT,   _OK,       PBP,  yes   ;USART CS
            INT_Handler   AT1_INT,   _Fire,     PBP,  yes   ;Fires Coil
            INT_Handler   IOC_INT,   _Wipe,     PBP,  yes   ;Fires Output
            INT_Handler   RX_INT,    _Grab,     PBP,  yes   ;USART Transmission Received
            INT_Handler   T1G_INT,   _Get_RPM,  PBP,  yes   ;Count Pulses to Determine RPM
            INT_Handler   TMR3_INT,  _Stall,    PBP,  yes   ;RPM Below Limits of TMR1
        endm
        INT_CREATE                      ;Creates the interrupt processor
    ENDASM
    This is a typical DT_INT Declaration. As you can see, when an external interrupt occurs the program jumps to a Label called "OK". When an Angular Timer Interrupt occurs it jumps to "Fire". Each Interrupt has a different Label the DT_INT INCLUDE will sent the PC to. An IOC INT directs the PC to "Wipe", and so forth. This may be the part you missed based on your comment,

    "All I'm after is to transfer to a location other than where the INT occurred."

Similar Threads

  1. Replies: 0
    Last Post: - 27th August 2004, 08:20

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