thanks..i have a problem...
i have sets of subroutines.however,im having the error of error113:symbol not defined.. please help.
ORG 0X00 GOTO start
start
CALL door_lock_init ;CONFIGURE USART FOR RECEPTION CALL metal_detect_init ;AFTER RESET STATE,PROGRAM STARTS METAL DETECTION UNIT CALL user_prompt_toggle0 CALL metal_detect; OUTPUT IS A CLOSED DOOR ;NOW USE THE DTR AS TOGGLE FUNCTION,OPEN/CLOSE CALL user_prompt_toggle0
end
;METALDETECT INITIALIZATION ASSUMES A HIGH LEVEL TONE FROM THE DETECTOR
metal_detect_init BCF STATUS, RP0 ; BCF STATUS, RP1 ; Bank0 CLRF PORTA ; Initialize PORTA by clearing output data latches CLRF PORTB ; CLEAR ALL CONTENTS BSF STATUS, RP0 ; Select Bank 1 CVRCON/CMCON/TRISA BSF TRISB,0 ; RB0 output to door motor BCF TRISB,1 ; RB1 input from dtr(toggle) MOVLW '00000111' ; MOVWF TRISA ; SET R5-R4 OUTPUTS,R3-R0 INPUTS ; RA1-RTS(INPUT UC,START METAL DETECTION) ; RA3-CTS(OUTPUT UC,METAL STATUS) ; NOTE: DTR(PIN4,INPUT)WILL RESET/OPEN DOOR,hardwired to lock motor MOVLW '00000110'; MOVWF CMCON ; SET RAO AS COMPARATOR INPUT MOVLW '11101100'; MOVWF CVRCON ; SET 2.5V,RA2 REF DIVIDER PIN ;MAKE 4-5v RETURN
;DOORLOCKINIT ;NORMALLY OPEN,'0' RB0
door_lock_init BCF STATUS, RP0 ; BSF STATUS, RP1 ; Bank1 BCF TRISB,0 ; set RB0 OUTPUT BCF STATUS,RP1 ; bank 0 BCF PORTB,0 ; CLEAR RB0,NORMALLY OPEN DOOR(LOW LEVEL,0V) RETURN
metal_detect ; BTFSC PORTA,5 ; IF IT IS SET, METAL ACTIVE,DOOR AUTOMATICALLY ; CLOSES SINCE RA4/C1OUT AUTOMATICALLY ACTIVATED ; or you may read cmcon c1out contents BCF STATUS, RP0 ; BSF STATUS, RP1 ; Bank1 BTFSC CMCON,6 ; IF C1OUT CLEAR,DOOR IS OPEN, SKIP GOTO metal_detect ; DOOR STATUS IS OPEN,NO METAL DETECTED GOTO door_close ; METAL DETECTED CLOSE DOOR RETURN
door_close BCF STATUS, RP0 ; BCF STATUS, RP1 ; Bank0 BSF PORTB,0 ; automatically close door! BSF PORTA,2 ; UC WILL NOW SEND POSITIVE ALARM TO RS232 THROUGH CTS LINE ; VB will read the cts buffer and call audio warning/closed ; door should remain closed unless prompted from vb ; status change for vb program RETURN
door_open BCF STATUS, RP0 ; BCF STATUS, RP1 ; Bank0 BCF PORTB,0 ; open door!nothing to input to vb so no status change! RETURN
user_prompt_toggle0 BCF STATUS, RP0 ; BCF STATUS, RP1 ; Bank0 BTFSC PORTB,1 ; IF RB1 IS clear,NO TOGGLE INPUT,SO REMAIN DOOR STATUS STATUS COMF PORTB,0 ; TOGGLE ACTIVE,SO COMPLEMENT DOOR STATUS RETURN