Help with PORTB Interrupt On Change Please


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,651


    Did you find this post helpful? Yes | No

    Default Re: Help with PORTB Interrupt On Change Please

    one way



    oldportb var byte
    pbchange var byte


    in main before isr enabled
    oldportb=portb





    in isr {portb must have changed to get here}


    pbchange = portb ^ oldportb ; xor portb with last known state and set bits that changed

    oldportb=portb ;update state
    pbchange=pbchange>>4 ; shift result to low byte

    int returm
    Warning I'm not a teacher

  2. #2
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Help with PORTB Interrupt On Change Please

    Thanks Richard.

    It was the xor process that I was missing.

    Cheers
    Barry
    VK2XBP

Similar Threads

  1. PORTB + PORTC Interrupt-On-Change
    By Aussie Barry in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 26th March 2014, 13:02
  2. PortB Change Interrupts
    By backstabber in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 8th October 2011, 03:52
  3. Replies: 6
    Last Post: - 12th March 2011, 13:11
  4. Returning from Int on PortB change
    By sheryl in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th December 2008, 18:09
  5. Interrupt portb
    By tazntex in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 18th August 2008, 21:05

Members who have read this thread : 1

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