DT Instant interups - interupt while executing an interupt routine question


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1

    Default DT Instant interups - interupt while executing an interupt routine question

    High everyone.

    I'm writing a monitoring and feedback program, a watchdog of sorts.
    it's going to be running on an 18f4550 @ 48MHz.
    the main routine is an LCD update and proberbly a bit of maths...
    However, i'll be using RX_INT along with 4 timer interupts running at diferent speeds...

    The question is, what happens if a timer interupt goes off while it's in the middle of another interupt routine say recieving usart data?

    I'm hoping it will just run the int routine for the new interupt after it finishes the curent one...

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    You got it!
    That's what will happen.
    And the order they are executed will depend on the order in the INT_LIST.

    For instance ...
    With the INT_LIST below ..., INT_INT will be the first handler executed, if it's flag is set.
    Then it will do TMR0_INT next (if flagged).
    If another INT_INT happens while it's in TMR0_INT, then it will wait until TRM1_INT has also finished before it goes back around and handles INT_INT again.
    Code:
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
            INT_Handler   TMR0_INT,  _ToggleLED2,   PBP,  yes
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes
        endm
        INT_CREATE                ; Creates the interrupt processor
    ENDASM
    If the INT_INT really can't wait for TMR1_INT then you can add another INT_INT handler in-between so that it won't have to wait.
    Code:
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
            INT_Handler   TMR0_INT,  _ToggleLED2,   PBP,  yes
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes
        endm
        INT_CREATE                ; Creates the interrupt processor
    ENDASM
    It still calls the same handler for both of them.

    hth,
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default

    LOVELY!

    I was worried about 'colliding' interupts for TMR1,2 and 3 when using a single 32.7K lp xtal... would make a mess if it started executed interupt routines in the middle of an interupt routine... lol

    Thats DT and excelent work with inst ints...

    are you planning to do more on your website?

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    Always glad I can help...
    Quote Originally Posted by comwarrior View Post
    are you planning to do more on your website?
    Got lots of plans ... just not a whole lot of "doing" going on there.
    <br>
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Darrel,
    If their is anything i can do to help then give me a shout...

Similar Threads

  1. Timer0 Instant Interrupts Question
    By wmarchewka in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2009, 05:29
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT Instant Interrupt counting
    By jderson in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 9th March 2008, 22:47
  4. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21

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