Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PORTA EQU
TRISB EQU
PORTB EQU
STATUS EQU
UNIDADES
PDel0 EQU
PDel1 EQU
PDel2 EQU
DECENA EQU
0x85
0x05
0x86
0x06
0x03
EQU 0x0C
0x0D
0x0E
0x0F
0x10
BSF
MOVLW
MOVWF
CLRF
STATUS,5
; Acceso al Banco 1.
b'00010000'
PORTA
PORTB
; Las lneas del Puerto B se configuran como salid
BCF
CLRF
CLRF
CLRF
UNIDADES
DECENA
PORTB
a.
STATUS,5;
BOTON
BTFSC
PORTA,4
GOTO
INCREMENTO
GOTO
DECREMENTO
RETRUN
;------------------------------------------------------------PDelay movlw
.14
; 1 set number of repetitions (C)
movwf
PDel0
; 1 |
PLoop0 movlw
.72
; 1 set number of repetitions (B)
movwf
PDel1
; 1 |
PLoop1 movlw
.247
; 1 set number of repetitions (A)
movwf
PDel2
; 1 |
PLoop2 clrwdt
; 1 clear watchdog
decfsz
PDel2, 1 ; 1 + (1) is the time over? (A)
goto
PLoop2
; 2 no, loop
decfsz
PDel1, 1 ; 1 + (1) is the time over? (B)
goto
PLoop1
; 2 no, loop
decfsz
PDel0, 1 ; 1 + (1) is the time over? (C)
goto
PLoop0
; 2 no, loop
PDelL1 goto PDelL2
; 2 cycles delay
PDelL2 clrwdt
; 1 cycle delay
return
; 2+2 Done
;------------------------------------------------------------END