Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

LIST P 16F877A INCLUDE : Cblock 0X20 X Variables para La Tabla y T1 Variables de Tiempo T2 T3 Endc

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 5

LIST P=16F877A

INCLUDE <P16F877A.INC>
CBLOCK 0X20
X

; Variables para la tabla

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

; Tiempo de 0.2 seg.

MOVWF T1
LAZO1:

CALL T100MS
DECFSZ T1,F
GOTO LAZO1
RETURN

T100MS: MOVLW .100

; 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'

; DT 0X80, 0XC0, 0XE0,

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

You might also like