Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Codigo de Teclado Matricial Con Pulsadores
Codigo de Teclado Matricial Con Pulsadores
bsf STATUS,5
movlw b'11110000'
movwf TRISB
movlw 00h
movwf TRISC
bcf STATUS,5
movlw b'00000000'
movwf PORTC
Main
Call INICIAL
Call Anti
goto Main
Anti ; Anti
btfsc PORTB,4
goto Anti
btfsc PORTB,5
goto Anti
btfsc PORTB,6
goto Anti
btfsc PORTB,7
goto Anti
return
INICIAL
Fila1
movlw b'00000100'
movwf PORTB
Siete
btfss PORTB,4
goto Ocho
movlw b'00000111'
movwf PORTC
movlw d'7'
movwf ditito
return
Ocho
btfss PORTB,5
goto Nueve
movlw b'01111111'
movwf PORTC
movlw d'8'
movwf ditito
return
Nueve
btfss PORTB,6
goto Fila2
movlw b'01100111'
movwf PORTC
movlw d'9'
movwf ditito
return
Fila2
movlw b'00000010'
movwf PORTB
Cuatro
btfss PORTB,4
goto Cinco
movlw b'01100110'
movwf PORTC
movlw d'4'
movwf ditito
return
Cinco
btfss PORTB,5
goto Seis
movlw b'01101101'
movwf PORTC
movlw d'5'
movwf ditito
return
Seis
btfss PORTB,6
goto Fila3
movlw b'01111101'
movwf PORTC
movlw d'4'
movwf ditito
return
Fila3
movlw b'00000001'
movwf PORTB
Uno
btfss PORTB,4
goto Dos
movlw b'00000110'
movwf PORTC
movlw d'1'
movwf ditito
return
Dos
btfss PORTB,5
goto Tres
movlw b'01011011'
movwf PORTC
movlw d'2'
movwf ditito
return
Tres
btfss PORTB,6
goto Fila4
movlw b'01001111'
movwf PORTC
movlw d'3'
movwf ditito
return
Fila4
movlw b'00001000'
movwf PORTB
asterisco
btfss PORTB,4
goto Cero
movlw b'01000000'
movwf PORTC
call guardar
return
Cero
btfss PORTB,5
goto numeral
movlw b'00111111'
movwf PORTC
movlw d'10'
movwf ditito
return
numeral
btfss PORTB,6
goto Fila1
movlw b'00001000'
movwf PORTC
guardar
clrw
btfsc cantidad,0
goto ddos
addwf ditito,0
movwf primero
bsf cantidad,0
return
ddos
btfsc cantidad,1
goto dtres
addwf ditito,0
movwf segundo
bsf cantidad,1
return
dtres
btfsc cantidad,2
goto dcuatro
addwf ditito,0
movwf tercero
bsf cantidad,2
return
dcuatro
addwf ditito,0
movwf cuarto
movlw b'00000000'
movwf cantidad
call comprobar
goto Main
comprobar
clrw
addwf primero,0
addlw b'11111110' ;;;3
movwf primero
clrw
addwf segundo,0
addlw b'11111101' ;;;;;4
movwf segundo
clrw
addwf tercero,0
addlw b'11111100' ;;;;;5
movwf tercero
clrw
addwf cuarto,0
addlw b'11111111' ;;;;;;2
movwf cuarto
decfsz primero,1
goto erro
decfsz segundo,1
goto erro
decfsz tercero,1
goto erro
decfsz cuarto,1
goto erro
movlw b'01110111'
movwf PORTC
call Retardo
call Retardo
return
erro
movlw b'01111001'
movwf PORTC
call Retardo
call Retardo
goto Main
Retardo ; retadooo
movlw b'01111111'
movwf cont1
movlw b'01111111'
movwf cont2
movlw b'00000001'
movwf cont3
delay
decfsz cont1,1
goto delay
decfsz cont2,1
goto delay
decfsz cont3,1
goto delay
return
END