DT-INTs What's legal in an INT handler?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Bruce, could you please explain your comment to me? I would think that PBP knows what bank it is in, and keeps track of that - even in an interrupt handler. Is that not true?
    And what constitutes "outside the interrupt handler"? Must all the handler code be placed between the INT entry point and the INT_RETURN?
    I have to admit, I have violated your "rule" and it hasn't caused problems. Am I lucky?
    Please explain.
    Charles Linquist

  2. #2


    Did you find this post helpful? Yes | No

    Default

    ? toggle command is only good for port pins ?

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Smile

    Oh my gosh, you're right! I don't know why I thought that would work for a bit. That fixed it.

    THANKS Michael.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Bruce, could you please explain your comment to me? I would think that PBP knows what bank it is in, and keeps track of that - even in an interrupt handler. Is that not true?
    And what constitutes "outside the interrupt handler"? Must all the handler code be placed between the INT entry point and the INT_RETURN?
    I have to admit, I have violated your "rule" and it hasn't caused problems. Am I lucky?
    Please explain.
    __________________
    Charles Linquist
    Hi Charles,

    Would be happy to answer if you could point me to the inital post...
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    This is a cut-and-paste from post #2 above.





    With DT_INTS using a PBP type interrupt, pretty much anything goes. I.E. use as many
    PBP instructions as you like in the int handler.

    That's the really cool part of using DTs' int program. He's done all the work for you.

    Just don't GOSUB outside the interrupt handler - or it will go-like-splat...
    __________________
    Charles Linquist

  6. #6
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I wanted to clarify a point just to possibly help somebody else...

    Unfortunately, TOGGLE does work to change the state of a BIT variable, even though this is an incorrect use of the command! It also quite possibly clobbers some other unsuspecting variable, in this case a LONG. It would be nice if the compiler would flag it, but it doesn't so BEWARE!!

    Thanks again, Michael.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Charles,

    What I meant was -- you don't want to jump outside an interrupt handler routine - without
    returning to it.

    I.E. if you GOSUB outside the interrupt routine, and don't re-enter it before your return, you might
    experience major problems.

    DT_INTS needs to exit from DT_INTS. If you jump outside of this routine, and try to return
    from the interrupt on-your-own, you're going to have a problem.

    Exit from an interruppt requires a lot of regitsers to be restored.

    If you jump outside of the int routine, and return on-your-own, you will for sure see a problem.
    Last edited by Bruce; - 29th January 2010 at 07:00.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. DT instant int error
    By mel4853 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th January 2010, 16:12
  2. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 01:01
  3. DT Ints work around for IOCA Register?
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th January 2010, 01:20
  4. Problem with Dt Ints Interrupts
    By Quin in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th July 2008, 19:21
  5. Replies: 1
    Last Post: - 2nd November 2006, 23:24

Members who have read this thread : 1

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