I need to create an interrupt with a PIC microcontroller so that when a pin is "high" the controller will stop what it is doing and do something else. How do I code this? Thanks for any help
LIST P=16F876
#INCLUDE<P16F876.INC>
__CONFIG _CP_OFF&_LVP_OFF&_BODEN_OFF&_PWRTE_ON&_WDT_OFF&_XT_OSC
ORG 0X00
GOTO INTIATION
ORG 0X04
;INTERRUPT SUBRUTINE
NOP ;any thing you want
BCF INTCON,INTF ;STOP THE INTERRUPT
RETFIE
INTIATION
;INTERRUPT INTIATION
MOVLW 0X90
MOVWF INTCON ;Enable External Interrupt & Enable Global Interrupt Gate
MOVLW 0X47
MOVWF OPTION_REG ;Intrrupt Start At Falling Edge
;INTIATION PORTS
MOVLW 0X01
TRIS PORTB
START
NOP ;the main program
GOTO START
END
BSF INTCON,GIE ;ALLOW OTHER INTERRUPT TO BE ABLE OCCUR
GOTO HELL ;joking :) , you can chose any place you want
by Robert Keim
by Jake Hertz
by Duane Benson
by Jake Hertz