hi my dear friends
i want to make a micro controller program in assembly language and 16f84 pic
this program is when i click the button on RB4 it will drive a motor in a direction to open as example a door and there are two limit switches in the two ends of the door
so
when the RB4 is on the motor will be on until the limit switch gives one then stop the motor and make a delay time and then close the door until the second limit switch gives one then the motor will be off
i made the following program as follows but there are an error please help me
i want to make a micro controller program in assembly language and 16f84 pic
this program is when i click the button on RB4 it will drive a motor in a direction to open as example a door and there are two limit switches in the two ends of the door
so
when the RB4 is on the motor will be on until the limit switch gives one then stop the motor and make a delay time and then close the door until the second limit switch gives one then the motor will be off
i made the following program as follows but there are an error please help me
PHP:
LIST P=PIC16F84
#INCLUDE "P16F84.INC"
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
W_TEMP EQU 4Bh
STATUS_TEMP EQU 4Ah
COUNT1 EQU H'0C'
COUNT2 EQU H'0D'
ORG 0X00
goto MAIN
org 0X04
goto ISR
MAIN
bsf INTCON, 7
BSF INTCON, 3
BSF STATUS, 5
MOVLW H'FE' ;RESET COUNT1 TO 254
MOVWF COUNT1 ;
MOVLW H'FE' ;RESET COUNT2 TO 254
MOVWF COUNT2
MOVLW 0X00
MOVWF TRISB
BcF STATUS, 5
CLRF PORTB
ISR
MOVWF W_TEMP
MOVF STATUS, 0
MOVF STATUS_TEMP
BCF INTCON, 0
BTFSS PORTB, 4
retfie
CLRF PORTB
MOVLW B'00000001'
xorwf PORTB,1
BSF PORTB,2
LOOP1 BTFSS PORTB,6
GOTO LOOP1
CLRF PORTB
CALL DELAY
LOOP2 CLRF PORTB
MOVLW B'00000010'
xorwf PORTB,1
BTFSS PORTB,7
GOTO LOOP2
CLRF PORTB
RETFIE
DELAY
LOOP3 CLRWDT
DECFSZ COUNT1,1
GOTO LOOP3
DECFSZ COUNT2,1
GOTO LOOP3
RETURN
END