How to know what pin triggered an interrupt?


Results 1 to 20 of 20

Threaded View

  1. #12
    sheepdog's Avatar
    sheepdog Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    My guess is that your original code a couple of posts above would be faster... There's a lot of bit shuffling that goes on with REV and NCD.
    Also, what happens if none of the pins are hit? If more than one pin is hit?

    "reversed_a = a REV 8 'reverse 8 bits of variable a in which I mirrored PORTA register"
    B0 = portx
    B1 = ^ B0 ' Reverse state of bits of B0
    B0 = NCD B1
    select case etc

    Bruces would probably be the fastest way, I have an affliction for making thinks more complex than perhaps need be. Did not realise pins default high etc.
    All the best
    Last edited by sheepdog; - 7th October 2008 at 23:25. Reason: not needed after hit detection

Similar Threads

  1. 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
  2. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  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