Educacion
8 “A”
chuchito
[Escribir el nombre de la compañía]
8 “A”
ANTONIO MORALES CASILLAS
SANTIAGO LOPEZ SAN EMETERIO
DANIEL AVALOS YAÑEZ
PAUL MONTAÑO GARCIA
GUSTAVO SANCHEZCALLEJAS
Programacion de contador de 0-99
include <p16F877A.inc>
CBLOCK 0X21
PDel0
PDel1
PDel2
ENDC
org 00H
goto inicio
PDelay movlw .14 ; 1 set number ofrepetitions (C)
movwf PDel0 ; 1 |
PLoop0 movlw .72 ; 1 set number of repetitions (B)
movwf PDel1 ; 1 |
PLoop1 movlw .247 ; 1 set number ofrepetitions (A)
movwf PDel2 ; 1 |
PLoop2 clrwdt ; 1 clear watchdog
decfsz PDel2, 1 ; 1 + (1) is the time over? (A)
goto PLoop2 ; 2 no, loopdecfsz 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
inicio
bsf STATUS,5
clrf TRISD
clrf TRISB
movlw 0FFHmovwf TRISA
bcf STATUS,5
clrf PORTD
clrf PORTB
contador
movlw b'10111111'
movwf PORTD
movlw b'10111111'
movwf PORTB
call PDelay
movlw b'10001100'
movwf PORTB
call PDelaymovlw b'11011011'
movwf PORTB
call PDelay
movlw b'11011110'
movwf PORTB
call PDelay
movlw b'11101100'
movwf PORTB
call PDelay
movlw b'11110110'
movwf PORTB
call PDelaymovlw b'11110111'
movwf PORTB
call PDelay
movlw b'10011100'
movwf PORTB
call PDelay
movlw b'11111111'
movwf PORTB
call PDelay
movlw b'11111100'
movwf PORTB
call PDelaymovlw b'10001100'
movwf PORTD
movlw b'10111111'
movwf PORTB
call PDelay
movlw b'10001100'
movwf PORTB
call PDelay
movlw b'11011011'
movwf PORTB
call PDelay
movlw b'11011110'...
Regístrate para leer el documento completo.