16F676 Interupt on Change pin determination


Results 1 to 18 of 18

Threaded View

  1. #5
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    I tossed the code into MicroCode Studio to get a better look - think I see the problem...

    Code:
    	IF NEWPORTA.5 <> OLDPORTA.5 THEN
    ILOOP:
    		I = I + 1
    		IF I = 5 THEN
    			resume BASE
    		ENDIF
    		LOW LED : PAUSE 1000 : HIGH LED
    		PAUSE 1000
    		GOTO ILOOP
    	ENDIF
    
    	IF NEWPORTA.4 <> OLDPORTA.4 THEN
    		I = I + 1
    		IF I = 4 THEN
    			resume BASE
    		ENDIF
    		LOW LED : PAUSE 1000 : HIGH LED
    		PAUSE 1000
    		GOTO ILOOP  ; <<<<<<<<<< JUMPS BACK TO Iloop
    	ENDIF
    No matter which pin is interrupted, the code jumps back to "Iloop", which is in the middle of the "IF NEWPORTA.5 <> OLDPORTA.5 THEN" test. It loops there until done, blinking the LED as if A.5 were interrupted, no matter which pin actually caused it.

    Arch

    PS - on the erratic triggering, make sure your programmer is actually setting MCLR off, and check for 'floating' inputs.
    What value pullup/pulldowns are you using?
    Last edited by Archilochus; - 4th May 2006 at 01:27.

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. HELP !!! How change the voltage of a pin ????
    By stormdacta in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 21st August 2007, 20:55
  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. 16F676 Interupt
    By BGreen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th March 2006, 20:56

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