Interruptus Frustratus


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Enable/Disable are for PBP ON INTERRUPT GOTO

    For DT-INTS you have
    @ INT_ENABLE IntSource
    and
    @ INT_DISABLE IntSource

    You could disable all interrupt by clearing INTCON GIE too. Used with care this could work.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Enable/Disable are for PBP ON INTERRUPT GOTO

    For DT-INTS you have
    @ INT_ENABLE IntSource
    and
    @ INT_DISABLE IntSource

    You could disable all interrupt by clearing INTCON GIE too. Used with care this could work.
    AHA! Thanks Steve!

    When using @ INT_DISABLE to protect a subroutine, does it also protect nested gosubs, or do I need to disable interrupts in each nested subroutine to protect them all from interrupt?

    Thanks!

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    It protect what's in between DISABLE and ENABLE, so yes if your Gosub are in between them, they will be "protected" as well.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    It protect what's in between DISABLE and ENABLE, so yes if your Gosub are in between them, they will be "protected" as well.
    Excellent. Thanks!




    Steve

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Woohoo! Go TEAM Go!

    And just to add more info ...
    When a 16F PIC is servicing an interrupt, no other interrupts can occur until the current one is finished. The GIE bit is cleared automatically by hardware at the start of the interrupt. Global ints are then re-enabled when it executes a RETFIE (return from interrupt) at the end of the handler.

    So there's no need to try to keep a handler from being interrupted, because it can't.

    With ON INTERRUPT, the actual Hardware INTERRUPT was serviced long before it gets to the handler, so you need to disable/enable with those.
    DT

  6. #6
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    Shucks, last week I cudnt even spel PIC, and now I are programin one!

    Data Sheets and Application Notes are wonderful things, but sometimes there's no substitute for a good teacher(s) to help explain things, fill in the details, or to just shove me over a hurdle that I can't find my way around...

    I really appreciate ALL the folks who've taken time to help... but especially Darrel for creating good things like DT_INTS and then having the patience to put up with all the silly questions we newbies will certainly have about it!
    THANKS!

    It's been a good day. I learned a lot.


    Steve

  7. #7
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default

    Hi all,
    I've been working in a project similar to byte_butcher's but using PBP only (I don't know any MPASM). My touch buttons work nicely but when I try to use GOSUB inside the ISR routine somehow PBP doesn't like it. I have my sub-routines outside the Disable-Enable of the ISR routine but it doesn't work.

    Am I missing something here?? Darrel said it is posible to call sub-routines when the interrupts are disable.

    Thanks in advance for any help.

    Robert

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