What's the interrupt latency and/or overhead when using DT-Ints?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: What's the interrupt latency and/or overhead when using DT-Ints?

    Please do and post the results.
    It's going to be slightly worse on an old 14bit device since they don't have automatic context save/restore like the 18F devices do for high priority interrupts.

    /Henrik.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: What's the interrupt latency and/or overhead when using DT-Ints?

    Exactly because of that I am sure it will be much worse. Soon...

    Ioannis

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: What's the interrupt latency and/or overhead when using DT-Ints?

    Finally I did the test on a 16F887 at 8MHz, and came up with a 49 usec to enter ISR and around 45 to exit.

    Name:  Latency.JPG
Views: 33988
Size:  46.3 KB

    The code I used is this:

    Code:
    wsave   var byte $70 system
    wsave1   var byte $A0 system
    wsave2   var byte $120 system
    wsave3   var byte $1A0 system
    
    
    INCLUDE "DT_INTS-14.bas"
    INCLUDE "ReEnterPBP.bas"
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR0_INT,  _TimezUp,   PBP,  yes
        endm
        INT_CREATE              ; Creates the interrupt processor
    ENDASM
    
    TRISB = %00000000           ' PortB.0 and PortB.1 are outputs.
    
    @ INT_ENABLE  TMR0_INT      ; Enable INT0 interrupts
    
    Main:
        portB.4 = !portb.4        ' Toggle PortB.1 as fast as we can
    Goto Main
    
    TimezUp:
        ' Create a short pulse on PortB.0
        portb.5 = 1
        PAUSEUS 15
        portB.5 = 0
    @ INT_RETURN
    It seems that comparing to 25K20, the 887 executes less instructions...? Is it possible?

    Ioannis
    Last edited by Ioannis; - 28th August 2016 at 10:50.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: What's the interrupt latency and/or overhead when using DT-Ints?

    It seems that comparing to 25K20, the 887 executes less instructions...? Is it possible?
    Apparently....
    First of all, as pedja pointed out, the number of instructions will vary slightly depending on what commands are being used by the actual code. DT-Ints saves many variables by default and some more if they're being defined. DT-Ints 14 seems to allocate 41 bytes for storing context (including W, STATUS, PCLATH and FSR) while DT-Ints 18 allocates 68 bytes.
    Out of the 68 bytes allocated 22 is never used if LONGs are NOT enabled. So if I'm not mistaken worst case for 14bit devices is 41 bytes and for 16bit devices (without LONGs) it's 46 bytes so yeah...I don't think there's anything wrong with your test.

    What surprised me a bit though is that the entry is slower than the exit, while on the 18F it's the other way around. Also, in order to be truly accurate you really need to count instructions in the listing since measuring it like this can cause it to differ a couple of instructions. But visualizing it like this is easier :-)

    /Henrik.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: What's the interrupt latency and/or overhead when using DT-Ints?

    I tested and measured it many times and it was consistent exactly as you observed. Entry always takes longer.

    Ioannis

Similar Threads

  1. DT-Ints latency and other interrupt conciderations
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 12th March 2010, 18:27
  2. DT-INTs Interrupt handler question
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th January 2010, 00:06
  3. Issue with Array causing PauseUS to have 16uS overhead
    By bcd in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th November 2007, 08:41
  4. USART and interrupt latency - not a problem
    By barkerben in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th January 2005, 22:57
  5. Interrupt Latency - ASM vs. Basic
    By barkerben in forum General
    Replies: 5
    Last Post: - 1st January 2005, 21:09

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