Enable and Disable in Interrupts


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    ENABLE and DISABLE are really compiler directives and NOT run-time program executable commands.

    What this means is that during COMPILE, additional code for checking and jumping to your PICBASIC interrupt will not be inserted between your code statements between the DISABLE and ENABLE pair. So the example you show is valid.

    The use of PICBASIC interrupts makes your program very code hungry (and slows it down) because of the way additional statements are inserted between your code, so the best way is only to have them enabled ONLY when you really want them. And because they don't get executed immediately (as can be now seen they're only jumped to BETWEEN your PICBASIC statements, this means that your PICBASIC commands will complete in the normal way BEFORE any interrupt jump is encountered... but if you understand what's going on inside your PIC you can handle this. Go search the forum for OLYMPIC TIMER for an example of PICBASIC interrupt usage.

  2. #2


    Did you find this post helpful? Yes | No

    Talking THAT'S WHAT I WANTED TO HEAR.... (read)

    Melanie,

    You you hit the nail on th head. That's what I wanted. It makes sense now. I just want to know and understand every line in my projects.

    Is there a list of these "compiler" directives anywhere?

    Thanks for the tip Jumper. I will look into it.


    Thanks for the en lighting answer.

Similar Threads

  1. Microcode studio - PIC16F877A Interrupts
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th January 2009, 06:10
  2. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  3. 16F876A CCP1 Capture/Interrupt Question
    By TDonBass in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th January 2008, 03:25
  4. too many interrupts
    By trying in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd February 2006, 13:38
  5. Interrupts and Disable 16f877
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th April 2005, 21:08

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