Interrupt


Closed Thread
Results 1 to 2 of 2

Thread: Interrupt

  1. #1
    Join Date
    Dec 2012
    Location
    Türkiye
    Posts
    103

    Default Interrupt

    Hi

    I've got a question about the interrupts
    Why in a code , "DISABLE" command is used right before the "LABEL" when pic branches in case of an interrupt . Because in case of an interrupt , pic branches directly to the "LABEL" and runs the codes in the programme block written within the LABEL so it is supposed to SKIP the "DISABLE" command then ....

    AND
    Why "ENABLE" Command is used right before the "RESUME" command ? Because by "RESUME" the programme is supposed to branch where it was before the interrupt , so PIC can not run "ENABLE" command in this order ...

    An example code ... and it works fine ...

    Thanks in advance



    ON INTERRUPT GOTO INT

    OPTION_REG=%0000000
    INTCON=%10010000

    TRISB=%00000001
    TRISA=%00000000

    PORTA=0

    SYMBOL LED=PORTA.0


    START:
    PAUSEUS 100
    GOTO START

    DISABLE
    INT:
    TOGGLE LED
    INTCON.1=0
    RESUME
    ENABLE
    END
    Last edited by gunayburak; - 26th December 2012 at 00:14.

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


    Did you find this post helpful? Yes | No

    Default Re: Interrupt

    DISABLE, ENABLE, and RESUME are key words used by the compiler.

    As it says in the good book
    are more like pseudo-ops in that they give the compiler directions, rather than actually generate code. See ON DEBUG and ON INTERRUPT for more information.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. I need help on ADC interrupt
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 24th December 2011, 08:02
  2. Interrupt Or I Am Going To Die
    By kunguz in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 1st November 2006, 05:41
  3. do I need an interrupt?
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st July 2006, 15:13
  4. ASM Interrupt
    By mikep in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd November 2004, 20:06
  5. Replies: 0
    Last Post: - 27th August 2004, 07: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