esta es mi programación
y aquí os muestro el los errores que me salen
Código:
LIST P=16F876
#INCLUDE <P16F876.INC>
__CONFIG _XT_OSC & _PWRTE_ON & _BODEN_OFF &_CP_OFF & _WDT_OFF ;& _RPD_OFF & _PGD_OFF
;DEFINICION DE REGISTROS
CBLOCK 20
ENDC
MENSTABLA EQU 21H
AUXA EQU 22H
AUXB EQU 23H
AUXC EQU 24H
REG_LCD EQU 25H
ROTA EQU 26H
TECLA EQU 27H
COLUMNA EQU 28H
DATALCD EQU 29H
FLAGCLAVE EQU 30H
C1 EQU 31H
C2 EQU 32H
C3 EQU 33H
C4 EQU 34H
I1 EQU 35H
I2 EQU 36H
I3 EQU 37H
I4 EQU 38H
FILA EQU 39H
#DEFINE ENABLE PORTA,0
#DEFINE RS PORTA,1
;PARA VISUALISAR MENSAJES EN LCD
VISMENSLCD MACRO TABLA
LOCAL MENSAJE,FIN
CLRF MENSTABLA
MENSAJE MOVF MENSTABLA,W
CALL TABLA
XORLW 1BH
BTFSC STATUS,2
GOTO FIN
MOVF MENSTABLA,W
CALL TABLA
CALL WRITE_DATO
INCF MENSTABLA,F
GOTO MENSAJE
;FIN NOP
ENDM
;MACRO PARA LEER TECLA PULSADA
CAPT_TECLA MACRO REG
LOCAL CICLOTECLA
MOVLW .20
MOVWF TECLA
CICLOTECLA CALL TECLADO
MOVF TECLA,W
XORLW .20
BTFSC STATUS,2
GOTO CICLOTECLA
MOVF TECLA,W
MOVWF REG
ENDM
;...............................................................................
ORG 000H
GOTO MAIN
ORG 006H
;TABLAS DE MENSAJE LCD
CLAVEOK
ADDWF PCL,F
RETLW 'C'
RETLW 'L'
RETLW 'A'
RETLW 'V'
RETLW 'E'
RETLW ' '
RETLW 'I'
RETLW 'G'
RETLW 'U'
RETLW 'A'
RETLW 'L'
CLAVEERROR
ADDWF PCL,F
RETLW 'C'
RETLW 'L'
RETLW 'A'
RETLW 'V'
RETLW 'E'
RETLW ' '
RETLW 'E'
RETLW 'R'
RETLW 'R'
RETLW 'A'
RETLW 'D'
RETLW 'A'
RETLW 1BH
INGRESODECLAVE
ADDWF PCL,F
RETLW 'I'
RETLW 'N'
RETLW 'G'
RETLW 'R'
RETLW 'E'
RETLW 'S'
RETLW 'E'
RETLW ':'
RETLW ' '
RETLW 1BH
ALMACENARCLAVE
ADDWF PCL,F
RETLW 'A'
RETLW 'L'
RETLW 'M'
RETLW 'A'
RETLW 'C'
RETLW 'E'
RETLW 'N'
RETLW 'A'
RETLW 'R'
RETLW ' '
RETLW 'C'
RETLW 'L'
RETLW 'A'
RETLW 'V'
RETLW 'E'
RETLW ':'
RETLW 1BH
;..................................................................................
;TABLAS PARA RUTINAS DE TECLADO
COLUMNA_1 ADDWF PCL,F
RETLW 'A'
NOP
NOP
NOP
RETLW '3'
NOP
RETLW '2'
RETLW '1'
RETURN
COLUMNA_2 ADDWF PCL,F
RETLW 'B'
NOP
NOP
NOP
RETLW '6'
NOP
RETLW '5'
RETLW '4'
RETURN
COLUMNA_3
ADDWF PCL,F
RETLW'C'
NOP
NOP
NOP
RETLW '9'
NOP
RETLW '8'
RETLW '7'
RETURN
COLUMNA_4
ADDWF PCL,F
RETLW'D'
NOP
NOP
NOP
RETLW '#'
NOP
RETLW '0'
RETLW '*'
RETURN
CONFIG_PIC
BANKSEL TRISB
MOVLW b'10000111'
MOVWF ADCON1
MOVLW b'00000000'
MOVWF TRISB
MOVLW b'11110000'
MOVWF TRISC
MOVLW b'11111100'
MOVWF TRISA
BANKSEL PORTB
CLRF PORTB
CLRF PORTC
RETURN
;......................................................................
;RUTINA DE RETARDO PARA LA ACTIVACION LCD
DELAY1 MOVLW .8
MOVWF AUXA
LOOP1 MOVLW .200
MOVWF AUXB
LOOP2 MOVLW .250
MOVWF AUXC
LOOP3 NOP
NOP
DECFSZ AUXC,F
GOTO LOOP3
NOP
DECFSZ AUXB,F
GOTO LOOP2
NOP
DECFSZ AUXA,F
GOTO LOOP1
NOP
RETURN
;...........................................................................
;RUTINA DE RETARDO PARA ENVIO DE INFORMACION A LCD
DELAY2 MOVLW .3
MOVWF AUXA
LOP11 MOVLW .255
MOVWF AUXB
LOP22 DECFSZ AUXB,F
GOTO LOP22
DECFSZ AUXA,F
GOTO LOP11
NOP
RETURN
;............................................................................
;RUTINA DE ESCRITURA DE INSTRUCCIONES O DATOS EN EL LCD
WRITE_INST MOVWF REG_LCD
BCF RS
GOTO CONTINUAR
WRITE_DATO MOVWF REG_LCD
BSF RS
NOP
NOP
CONTINUAR MOVF REG_LCD,W
MOVWF PORTB
BSF ENABLE
NOP
NOP
NOP
BCF ENABLE
CALL DELAY2
RETURN
;CONFIGURACION INICIAL DE LCD
INI_LCD CALL DELAY1
MOVLW b'00111000'
CALL WRITE_INST
MOVLW b'00001100'
CALL WRITE_INST
MOVLW b'00000110'
CALL WRITE_INST
RETURN
SCAN_FIN
BSF STATUS,C
MOVF PORTC,W
ANDLW 0x0F0
XORLW 0x0F0
BTFSS STATUS,2
GOTO SCAN_FIN
RETURN
ROTAR RLF ROTA,F
MOVF ROTA,W
MOVWF PORTC
BTFSC ROTA,4
RETURN
TECLADO CALL ROTAR
MOVF PORTC,W
ANDLW 0F0;11110000
MOVWF COLUMNA
SWAPF COLUMNA,F
MOVF COLUMNA,W
XORLW 0XF
BTFSC STATUS,2
RETURN
BTFSS PORTC,0
GOTO FILA_1
BTFSS PORTC,1
GOTO FILA_2
BTFSS PORTC,2
GOTO FILA_3
GOTO FILA_4
FILA_1 MOVLW .07
SUBWF COLUMNA,W
CALL COLUMNA_2
MOVWF TECLA
CALL SCAN_FIN
RETURN
FILA_2 MOVLW .07
SUBWF COLUMNA,W
CALL COLUMNA_2
MOVWF TECLA
CALL SCAN_FIN
RETURN
FILA_3 MOVLW .07
SUBWF COLUMNA,W
CALL COLUMNA_3
MOVWF TECLA
CALL SCAN_FIN
FILA_4 MOVLW .07
SUBWF COLUMNA,W
CALL COLUMNA_4
MOVWF TECLA
CALL SCAN_FIN
RETURN
;RUTINA DE COMPARACION DE CLAVES
COMPCLAVES
BCF FLAGCLAVE,0
MOVF C1,W
XORWF I1,W
BTFSS STATUS,2
RETURN
MOVF C2,W
XORWF I2,W
BTFSS STATUS,2
RETURN
MOVF C3,W
XORWF I3,W
RETURN
MOVF C4,W
XORWF I4,W
BTFSS STATUS,2
RETURN
BSF FLAGCLAVE,0
RETURN
;PROGRAMA PRINCIPAL
MAIN
CALL CONFIG_PIC
CALL INI_LCD
VISMENSLCD ALMACENARCLAVE
MOVLW b'11000001'
CALL WRITE_INST
CAPT_TECLA C1
MOVLW '*'
CALL WRITE_DATO
CLAVE1
CAPT_TECLA C2
MOVLW '*'
CALL WRITE_DATO
CLAVE2
CAPT_TECLA C3
MOVLW '*'
CALL WRITE_DATO
CLAVE3
CAPT_TECLA C4
MOVLW '*'
CALL WRITE_DATO
CLAVE4
CALL DELAY1
CICLOMAIN
MOVLW b'00000001'
CALL WRITE_INST
VISMENSLCD INGRESOCLAVE
CAPT_TECLA I1
CALL WRITE_DATO
CAPT_TECLA I2
CALL WRITE_DATO
CAPT_TECLA I3
CALL WRITE_DATO
CAPT_TECLA I4
CALL WRITE_DATO
MOVLW b'11000001'
CALL WRITE_INST
CALL COMPCLAVES
BTFSS FLAGCLAVE,0
GOTO ERRORC
VISMENSLCD CLAVEOK
CALL DELAY1
GOTO CICLOMAIN
ERRORC
VISMENSLCD CLAVEERROR
CALL DELAY1
GOTO CICLOMAIN
END
Código:
Message[302] C:\USERS\PROPIETARIO\CERRADURA PIC 16F876\CERRAR.ASM 184 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[113] C:\USERS\PROPIETARIO\CERRADURA PIC 16F876\CERRAR.ASM 38 : Symbol not previously defined (INGRESOCLAVE)
Error[113] C:\USERS\PROPIETARIO\CERRADURA PIC 16F876\CERRAR.ASM 43 : Symbol not previously defined (INGRESOCLAVE)
Warning[206] C:\USERS\PROPIETARIO\CERRADURA PIC 16F876\CERRAR.ASM 350 : Found call to
Última edición por un moderador: