Microcontroladores

Disponível somente no TrabalhosFeitos
  • Páginas : 2 (391 palavras )
  • Download(s) : 0
  • Publicado : 21 de novembro de 2011
Ler documento completo
Amostra do texto
Errorlevel-302;
list p=16F877;
include<P16F877.inc>;

CONTADOR_1 EQU 20h;
CONTADOR_2 EQU 21h;
CONTADOR_3 EQU 22h;

BSF STATUS,RP0;
CLRF INTCON;
CLRF OPTION_REG;
MOVLW 0FFh;
MOVWFTRISB;
MOVLW 00h;
MOVWF TRISC;
MOVWF TRISD;
BCF STATUS,RP0;
MOVLW 00h;
MOVWF PORTC;
MOVWF PORTD;

INICIO
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO INICIO;

BOLA
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 7Ch;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 38h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 77h;
MOVWF PORTC;
CALL TEMPO;
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;

DADO
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWFPORTD;
MOVLW 0F7h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;
CALL TEMPO;
BTFSS PORTB,0;
CALL BOLA;BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;

CASA
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 0EEh;
MOVWF PORTC;CALL TEMPO;
MOVLW 0B6h;
MOVWF PORTD;
MOVLW 0EEh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;
CALLTEMPO;
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;

FITA
MOVLW 0Eh;
MOVWFPORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWF PORTD;
MOVLW 0F7h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF...
tracking img