;******************************************************* ;** ** ;** SECUENCIADOR PARA LUCES NAVIDEŅAS ** ;** POR CARLOS DIAZ ** ;** ** ;******************************************************* CUENTA1 equ 0Ch CUENTA2 EQU 0DH CUENTA3 EQU 0EH STATUS EQU 03H PORTA EQU 05H PORTB EQU 06H TRISA EQU 05H TRISB EQU 06H F EQU 1 W EQU 0 #DEFINE ON1 BSF PORTB,0 #DEFINE ON2 BSF PORTB,1 #DEFINE ON3 BSF PORTB,2 #DEFINE ON4 BSF PORTB,3 #DEFINE ON5 BSF PORTB,4 #DEFINE ON6 BSF PORTB,5 #DEFINE ON7 BSF PORTB,6 #DEFINE ON8 BSF PORTB,7 #DEFINE ON9 BSF PORTA,0 #DEFINE ON10 BSF PORTA,1 #DEFINE ON11 BSF PORTA,2 #DEFINE ON12 BSF PORTA,3 #DEFINE ON13 BSF PORTA,4 #DEFINE ONTODO CALL ENCIE #DEFINE OFF1 BCF PORTB,0 #DEFINE OFF2 BCF PORTB,1 #DEFINE OFF3 BCF PORTB,2 #DEFINE OFF4 BCF PORTB,3 #DEFINE OFF5 BCF PORTB,4 #DEFINE OFF6 BCF PORTB,5 #DEFINE OFF7 BCF PORTB,6 #DEFINE OFF8 BCF PORTB,7 #DEFINE OFF9 BCF PORTA,0 #DEFINE OFF10 BCF PORTA,1 #DEFINE OFF11 BCF PORTA,2 #DEFINE OFF12 BCF PORTA,3 #DEFINE OFF13 BCF PORTA,4 #DEFINE OFFTODO CALL APAGA #DEFINE ESPERA CALL DELAY #DEFINE ESPERA1 CALL DELAY1 #DEFINE ESPERA2 CALL DELAY2 #DEFINE ESPERA3 CALL DELAY4 #DEFINE ESPERA4 CALL DELAY3 #DEFINE INVIERTE CALL INV ORG 00H CLRF PORTA CLRF PORTB BSF STATUS,5 CLRF TRISA CLRF TRISB BCF STATUS,5 INICIO ;******************************************************************************************** ;********A PARTIR DE AQUI ESCRIBE TU SECUENCIA*********************************************** ;-------------------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------------------- ;****************FIN DE LA SECUENCIA********************************************************* ;******************************************************************************************** GOTO INICIO DELAY3 MOVLW 80H ;4SEG GOTO DEL DELAY4 MOVLW 60H ;3SEG GOTO DEL DELAY2 MOVLW 40H ;2SEG GOTO DEL DELAY1 MOVLW 20H ;1SEG GOTO DEL DELAY MOVLW 010H ;.5SEG DEL MOVWF CUENTA1 ACA1 MOVLW 0FFH MOVWF CUENTA2 ACA DECFSZ CUENTA2 GOTO ACA DECFSZ CUENTA1 GOTO ACA1 RETURN APAGA CLRF PORTA CLRF PORTB RETURN ENCIE MOVLW 0FFH MOVWF PORTA MOVWF PORTB RETURN INV MOVLW 0FFH XORWF PORTA,F XORWF PORTB,F RETURN END