Program returns to beginning at interupt


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Fayetteville Arkansas
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    By the way, I did notice some of my comments are not up to date. All interupts are on rising edge and some of the timing has been revised from the comments. Hope this didn't cause any confusion.

  2. #2
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hi Butch,
    Have not gone over the code carefully, but there are a few things that don't look quite right...

    It looks like OPTION_REG is set for falling edge trigger (though I guess you mentioned that already).

    Pullups are ENABLED, but the WPU register is not configured to set which pins have pullups enabled.

    Can't find "SENSOR" GPIO.2 set as input. Don't know what it defaults to in the '629.

    There should be a DISABLE instruction before your interrupt service routines, with an ENABLE to restart interrupts when needed.
    You might try tossing the interrupt service sub-routines up at the top of your code before the "ON INTERRUPT" command is first used. Than just jump around them with a "GOTO StartHere". Others prefer to put the subs at the end of their code.

    There's a "RESUME BASE" at the end of your "REFRESH" section. Since you jumped to REFRESH with a "GOTO", the RESUME is not needed (don't know if including it would actually cause problems or not).

    Arch

  3. #3
    Join Date
    Oct 2004
    Location
    Fayetteville Arkansas
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Arch, thanks for the reply. I ended up redefining a few things and moving a couple of things around and got it to work.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 10:54
  2. Help! My 'interupt', erhm ...only interupts the one time?!!!
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd November 2009, 13:49
  3. Replies: 1
    Last Post: - 23rd May 2009, 10:22
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 15:30

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