Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by menta View Post
    Well,
    What if the interrupts are for the clock ?
    Disabling it will cause the clock not to keep going.
    Then add an RTC chip.

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


    Did you find this post helpful? Yes | No

    Default

    Hi menta,

    Any type of software timed commands like SERIN/OUT, OWIN/OUT, PAUSE, PULSIN/OUT etc, will be disturbed by these types of Interrupts.

    That's why there's an ON INTERRUPT GOTO statement. It reverses the situation, so that the PAUSE, SERIN/OUT etc trash the Interrupts instead, which seems more tolerable to people new to PBP, but just drove me crazy. And is why I ended up with DT_INTS.

    With Interrupts, you need to use HARDWARE solutions instead of the SOFTWARE timed commands, and in your case the 16F887 has a USART on-board that is NOT affected by interrupts.

    So just switch over to HSEROUT, and your problems will vanish.

    DT

  3. #3
    Join Date
    Jun 2008
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Great, will try this.

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi DT,

    This question is not related to the current ongoing subject but is about your int routine.

    Is it safe (or how safe) to call a subroutine inside your interrupt handler?

    Or inside PBP int handler?


    Thanks.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    I am not DT, but for sure it is not recommended in any way to do a call inside the int routine. Think of the delays to go forth and back plus whatever you are going to do inside the sub. Can you make it absolutely sure that the call will be a zap?

    I am sure there is another wayto implement your project.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    I agree with Ioannis.
    It's not really recommended, but it is possible.

    The worst case scenario is with a 16F PIC.
    They only have 8 stack levels, and some of PBP's commands can use 4 of them. Which is why you can only nest gosubs 4 levels deep in any 16F program.

    In your main program, it may already be 3-4 levels deep when an interrupt triggers. If you then ReEnter PBP, do a GOSUB and try to run a 4-level PBP command, the stack will definitely overflow.

    Using the Software Stack can eliminate that problem.

    With an 18F there are several more stack levels, so it's not as much of a problem. And of course, if you write the handlers and subroutines in ASM, it's even less of a problem.
    <br>
    DT

  7. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Thanks IO.
    I already knew about delay issues but it takes approx. 30 seconds for my code to complete int routine. So my code is not time sensitive.

    What I needed to know was DT's warnings about deep levels.

    Thanks DT, that is what I now need to consider.

    ---------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  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's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03: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