PIC18 interrupt handler, where to save W etc?


Closed Thread
Results 1 to 17 of 17

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I'll take that as a NO.

    No reason to have ONLY Low Priority interrupts. (suggested in post #4).
    DT

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


    Did you find this post helpful? Yes | No

    Default

    I'll take that as a NO.
    Yep. I don't see any reason to even have priority levels enabled unless you have one interrupt that needs to interrupt another. I should have said NO priority levels VS LOW priority...

    My point was just to let the OP know he didn't need to enable priority interrupts, or use a high pri interrupt just to use the fast return with auto context restore because this;
    One nice thing about 18F's is that you don't have to save W, BSR and STATUS when using High Priority Interrupts.
    Made it sound like he did.
    Last edited by Bruce; - 16th May 2010 at 20:56.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    I agree, Thanks.

    I just want to make sure I'm not purposely avoiding something that should be in DT_INTS-18. (getting lazy)

    If there were a reason, now would be the time to mention it.
    Since I'm updating it.

    Anyone?
    DT

  4. #4
    Join Date
    Apr 2010
    Location
    Walnut Creek, CA
    Posts
    17


    Did you find this post helpful? Yes | No

    Smile Thanks again Guys!

    Your responses are very helpful and greatly appreciated. It's pretty incredible to get this quality of help.

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


    Did you find this post helpful? Yes | No

    Default

    I can think of a couple scenarios where it might come in handy to use only low priority interrupts.

    A. If you need the first few code locations for initialization code that would exceed location 0x08, it would be nice to recover this space by forcing all interrupts to vector to 0x18 after initialization.

    B. If you need just a few more words code space, this would free up room between the high/low vectors. GOTO somewhere at 0x00 with GOTO or BRA at 0x08 leaves several words of code space unused between the reset vector & low pri vector.

    For B of course you could just make everything high priority, bump it up to 0x08, but you still have a few words not used from reset to 0x08.

    So I guess in some extreme cases it might be nice to have the option.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    Excellent!

    I knew I was talking to the right guy.

    Reason A. is a perfectly "Valid" need to have only Low Priority Interrupts.
    Albeit, an infrequent need.

    I will now attempt to add it to the update.

    Way to go Bruce!
    DT

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


    Did you find this post helpful? Yes | No

    Default

    All the back and forth with bruce, I forgot to say ...

    ImAnEE,

    I'm glad it helps, interrupts can be very confusing.
    I've tried to reduce the confusion with DT_INTS, but am still working on it.
    If you're short on time, it's probably the Quickest way though.

    Fortunately for me, there's more and more people answering DT_INTS questions around here.
    So dive in, helps not far away.

    Best regards,
    DT

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