I wanted to make a program with pic 16f84 as follows :-
I will put to sensors out of door and two sensors in my house behind the door and the description of the circuit as follows :-
when any one move towards the door from out then the two sensors will send a signal to RB4 & RB5 then the door will open and when this person enters home the other two sensors will send a signal to RB6 & RB7 then the door will be closed and the opposite if this person wants to go out from home.
my assembly program is as follows please help me as there is errors
my program :-
and the error was as follows :-
I will put to sensors out of door and two sensors in my house behind the door and the description of the circuit as follows :-
when any one move towards the door from out then the two sensors will send a signal to RB4 & RB5 then the door will open and when this person enters home the other two sensors will send a signal to RB6 & RB7 then the door will be closed and the opposite if this person wants to go out from home.
my assembly program is as follows please help me as there is errors
my program :-
PHP:
LIST P=PIC16F84
#INCLUDE "P16F84.INC"
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
W_TEMP EQU 4Bh
STATUS_TEMP EQU 4Ah
ORG 0H
goto MAIN
org 4H
goto ISR
MAIN
bsf INTCON, GIE
BSF INTCON, RBIE
BSF STATUS, RP0
MOVLW 0X0F
MOVWF TRISB
BSF STATUS, RP0
CLRF PORTB
ISR
MOVWF W_TEMP
MOVF STATUS, W
MOVF STATUS_TEMP
BCF INTCON, RBIF
BTFSS PORTB, 4
GOTO MAIN
BTFSS PORTB, 5
GOTO SECOND_ISR
CALL OPEN_DOOR
LOOP1
BTFSS PORTB, 6
GOTO LOOP1
LOOP2
BTFSS PORTB, 7
GOTO LOOP2
CALL CLOSE_DOOR
SECOND_ISR
LOOP3
BTFSS PORTB, 6
GOTO LOOP3
LOOP4
BTFSS PORTB, 7
GOTO LOOP4
CALL OPEN_DOOR
LOOP5
BTFSS PORTB, 4
GOTO LOOP5
LOOP6
BTFSS PORTB, 5
GOTO LOOP6
CALL CLOSE_DOOR
END
OPEN_DOOR
MOVLW 0X04
MOVWF PORTB
RETURN
CLOSE_DOOR
MOVLW 0X08
MOVWF PORTB
RETURN
and the error was as follows :-
PHP:
----------------------------------------------------------------------
Debug build of project `D:\PIC\examples\door\door.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Sun Feb 08 04:50:01 2009
----------------------------------------------------------------------
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F84 "door.asm" /l"door.lst" /e"door.err" /o"door.o" /d__DEBUG=1
Warning[205] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 7 : Found directive in column 1. (ORG)
Warning[203] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 8 : Found opcode in column 1. (goto)
Warning[205] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 9 : Found directive in column 1. (org)
Warning[203] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 10 : Found opcode in column 1. (goto)
Message[302] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 16 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[305] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 22 : Using default destination of 1 (file).
Error[113] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 28 : Symbol not previously defined (OPEN_DOOR)
Error[113] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 37 : Symbol not previously defined (CLOSE_DOOR)
Error[113] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 45 : Symbol not previously defined (OPEN_DOOR)
Error[113] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 52 : Symbol not previously defined (CLOSE_DOOR)
Warning[205] D:\PIC\EXAMPLES\DOOR\DOOR.ASM 53 : Found directive in column 1. (END)
----------------------------------------------------------------------
Debug build of project `D:\PIC\examples\door\door.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Sun Feb 08 04:50:05 2009
----------------------------------------------------------------------
BUILD FAILED