hi all
please help me in my problem that i began to write my first program in mplab which can change the state of the led on RB7 with the interrupt in RB0
my assembly code is as follows :-
and the proteus files in the attachments
my problem is that the change in the led state can be done in the first time only and i want it to make that with every interrupt change
please help me as I'm a beginner
please help me in my problem that i began to write my first program in mplab which can change the state of the led on RB7 with the interrupt in RB0
my assembly code is as follows :-
PHP:
LIST P=PIC16F84
#INCLUDE "P16F84.INC"
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
org 0x00
goto START
org 0x04
GOTO ISR
START
BSF STATUS,RP0
MOVLW 0X01
MOVWF TRISB
BCF OPTION_REG,INTEDG
BSF OPTION_REG,NOT_RBPU
BCF STATUS,RP0
CLRF PORTB
BSF PORTB,7
BSF INTCON,INTE
BSF INTCON,GIE
LOOP
GOTO LOOP
ISR
BCF INTCON,INTF
BTFSS PORTB,7
BSF PORTB,7
BCF PORTB,7
RETFIE
END
and the proteus files in the attachments
my problem is that the change in the led state can be done in the first time only and i want it to make that with every interrupt change
please help me as I'm a beginner
Attachments
Last edited: