I need help with Interrupt


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Ontario Canada
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Hi Dave thanks for your help. I have tried your suggestions and still have the same problem. I even copied your code directly and still no fix. You said you have it counting. I can only get it to count to one and then it stops. You said when you pushed the button to ground, it would count. Did you have it counting pass one? Another thing is the Option_Reg bit 6 is set for "Rising edge". You said you pushed the button low. It should not work if the bit is set for rising edge.
    I guess I should also disclose that I am using the "EasyPic4 Development Board". I wonder if that is my problem.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If you want it to interrupt when RB0 goes high, comment out the OPTION_REG line and use external resistor from RB0 to ground.

    With the OPTION_REG set as you have it "pull-up""set" the pin will need to go LOW to trigger the interrupt. No external resistor.
    From data sheet.
    External interrupt on the RB0/INT pin is edge triggered,
    either rising, if bit INTEDG (OPTION_REG<6>) is set,
    or falling, if the INTEDG bit is clear.
    I counted to 255 then of course it rolls back to 0 and starts over.
    I guess I should also disclose that I am using the "EasyPic4 Development Board". I wonder if that is my problem.
    Not sure, never used the "EasyPic".

    I am using Ubuntu (linux) for an OS, running MPLAB with PBP as the language set via Wine hooked to a PICSTART PLUS rigged as an ICSP.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2005
    Location
    Ontario Canada
    Posts
    30


    Did you find this post helpful? Yes | No

    Default

    Thank for you suggestion JOE.S I will have to try the other Inputs as well, 4-7. Thank you to mackrackit. I have found the problem. There is a jumper on the board that was set for "Pull down" and I had the "Pull up" set in Option_Reg. They were fighting each other. I disabled the Option_Reg and it works very well. Thanks very much for your input. All that you said was spot on.

    This is fun.
    Wildbilly.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by wildbilly View Post
    This is fun.
    Wildbilly.
    That is all that matters!
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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