How to use RB1(INT1) as an interrupt?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65

    Question How to use RB1(INT1) as an interrupt?

    Okay, I've been trying this all morning with absolutely no luck. Do any of you gracious, knowledgeable programming guru's have a snippet of code just to use RB1 (on the PIC 18F2525 in this instance) as an interrupt. I have tried everything I can think of, I've read countless posts to no avail. I've found info on using RB0 (which I'm using and having no problem with) and even RB4-RB7, but nothing on RB1.

    Some say to call out the registers before using the ON INTERRUPT command, the PBP manual and many codes on the forum put them after. Reading the datasheet, I think I set up RB1 as an active interrupt by:

    On Interrupt goto some_routine
    intcon = %10000000
    intcon3 = %00001000

    But when I push my momentary switch to simulate an interrupt (goes low), nothing happens. If I stick with the INT0 interrupt solely, everything works beautifully.

    My goal is to use two interrupts going to the same interrupt handler, but only have one on all the time. The other would be turned on and off within the program. I'm pretty sure I can figure that out if someone could just show me how to turn on the RB1 (INT1) interrupt. Thanks all!

  2. #2
    Join Date
    Apr 2005
    Location
    Virginia
    Posts
    65


    Did you find this post helpful? Yes | No

    Talking Silly me . . .

    Alright, after having someone look it and pull out a meter, I noticed I wasn't getting enough current through the switch. So, for anyone asking this question, here's some code. If it doesn't work, make sure the PIC is seeing at least 3V if it's supposed to be normally high.

    On Interrupt goto some_routine
    intcon = %10000000 ' Enable global interrupt (GIE)
    intcon3.3 = 1 ' Enable INT1 (on 18F2525 datasheet)

    Hope this helps someone.

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