LIST P 16F877A INCLUDE : Cblock 0X20 X Variables para La Tabla y T1 Variables de Tiempo T2 T3 Endc
LIST P 16F877A INCLUDE : Cblock 0X20 X Variables para La Tabla y T1 Variables de Tiempo T2 T3 Endc
LIST P 16F877A INCLUDE : Cblock 0X20 X Variables para La Tabla y T1 Variables de Tiempo T2 T3 Endc
INCLUDE <P16F877A.INC>
CBLOCK 0X20
X
y
T1
; Variables de tiempo
T2
T3
ENDC
ORG 0X2007
DW 0X3F7A
ORG 0X0000
BANKSEL TRISA
CLRF TRISB
BANKSEL PORTA
CLRF X
ABC:
MOVFW X
CALL TABLA
MOVWF PORTB
CALL DELAY
INCF X,F
GOTO ABC
DELAY:
MOVLW .2
MOVWF T1
LAZO1:
CALL T100MS
DECFSZ T1,F
GOTO LAZO1
RETURN
; Tiempo de 100mseg
MOVWF T2
LAZO2:
CALL T1MS
DECFSZ T2,F
GOTO LAZO2
RETURN
T1MS:
MOVLW .250
; Tiempo de 1mseg
MOVWF T3
LAZO3:
NOP
DECFSZ T3,F
GOTO LAZO3
RETURN
TABLA:
ADDWF PCL,F
RETLW B'10000000'
RETLW B'11000000'
RETLW B'11100000'
RETLW B'11110000'
RETLW B'11111000'
RETLW B'11111100'
RETLW B'11111110'
RETLW B'11111111'
RETLW B'11111110'
RETLW B'11111100'
RETLW B'11111000'
RETLW B'11110000'
RETLW B'11100000'
RETLW B'11000000'
RETLW B'10000000'
RETLW B'10000000'
RETLW B'11000000'
RETLW B'11100000'
RETLW B'11110000'
RETLW B'11111000'
RETLW B'11111100'
RETLW B'11111110'
RETLW B'11111111'
RETLW B'11111110'
RETLW B'11111100'
RETLW B'11111000'
RETLW B'11110000'
RETLW B'11100000'
RETLW B'11000000'
RETLW B'10000000'
RETLW B'10000000'
RETLW B'11000000'
RETLW B'11100000'
RETLW B'11110000'
RETLW B'11111000'
RETLW B'11111100'
RETLW B'11111110'
RETLW B'11111111'
RETLW B'11111110'
RETLW B'11111100'
RETLW B'11111000'
RETLW B'11110000'
RETLW B'11100000'
RETLW B'11000000'
RETLW B'10000000'
END