Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Can nested gosubs be used from within PBP instant Interrupt

    Hi,

    I need to call a subroutine from within a low priority PBP instant interrupt on a PIC 18F452. I am using both High Priority and Low Priority Interrupts.

    I need to know whether PBP uses a software stack for its gosub calls or use the PIC18 stack pointer. I am concerned if calling a nested gosub from within a PBP InstInt would cause stack overflow.
    Regards

    Sougata

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


    Did you find this post helpful? Yes | No

    Default

    PBP uses the hardware Stack. But with 31 levels on the 18F's, you have to be pretty sloppy to overflow it.

    The PIC itself uses the Hardware Stack to handle an interrupt. But, DT_INTS does NOT use the Hardware Stack. It essentially uses a 2-level software stack. 1 for High Priority, and 1 for Low.

    Once in an interrupt, it's OK to call a subroutine, as long as both HIGH and LOW priorities can never call the same routine at the same time.

    HTH,
    DT

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Thumbs up Thanks Darrel

    Dear Darrel,

    Thank you for the reply. I am using ASM interrupts on your system for the the high priority and your system already uses the shadow register for HP (retfie fast).

    My main routine has deep calls and in the low priority interrupts I am using PBP. I was actually overflowing the stack causing a MCU reset (configured for reset under STACK Over/underflow). I have re-structured my code to handle it already.

    I must thank you once again for the great job you have done. It is not only about using PBP in Interrupts it is more manageable than asm.
    Regards

    Sougata

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 6

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts