INTERRUPT on RB5


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    RBIF: RB Port Change Interrupt Flag bit
    A mismatch condition will continue to set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared.

    With your LED on PORTB.1, that's exactly what you're doing with LOW LED. With your LED on PORTE, you're not performing a read-modify-write on RB, and the missmatch condition still exists.

    Just read PORTB in your interrupt routine, then clear RBIF, then return. Assuming you have your PORTE A/D turned off, it should work fine.

    The value read from PORTB in the interrupt handler will now be the new value that causes the interrupt once changed.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Samuel's Avatar
    Samuel Guest


    Did you find this post helpful? Yes | No

    Default WOW!! Thanks SOO MUCH!

    What would ppl like me do without ppl like you!

  3. #3
    Samuel's Avatar
    Samuel Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce
    Assuming you have your PORTE A/D turned off, it should work fine.
    How do i do that and how does it make a difference? Is it the ADCON register you are talking about?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    depending the PIC you're using it can be ADCON, ADCON0, ADCON1 refer to the datasheet.

    How can it make difference... roughly, you're checking a digital signal, if your analog converter are not turned off, you can have some odd/erratic results. a close to be low level signal can be considered as a high level and so on for the close to be high or high level. digital is digital, analog is analog. It's a common problem like some others, let's say RA4 to drive a source on many PIC
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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