Home Work
Home Work
Home Work
Réaliser par :
Codes:
start
COUNTER1 EQU 0X20
COUNTER2 EQU 0X21
Org 0x00
Main:
BSF STATUS, 5;
MOVLW b'0000'
MOVWF TRISA;
MOVLW b'0000'
MOWF TRISB;
BCF STATUS, 5;
MOVLW b'0000'
MOVWE PORTA
MOVLW b’0000’
MOVWF PORTB
call delay
TURNON:
MOVLW b'00000001’
MOVWF PORTA
MOVLW b'00000000’
MOVWF PORTB
Call delay
MOVLW b'00001111’
MOVWF PORTA
MOVLW b'00001110’
MOVWF PORTB
Call delay
MOVLW b'00000001’
MOVWF PORTA
MOVLW b'00000000’
MOVWF PORTB
Call delay
GOTO TURNON
delay:
MOVLW d'200'
MOVWF COUNTER1
LOOP1:
MOVLW d'100'
MOVWF COUNTER2
LOOP2:
NOP
DECF COUNTER2
BNZ LOOP2
DECF COUNTER1
BNZ LOOP1
RETURN;
END;
TP2 :
Schema:
Codes:
Start
BSF STATUS, 5
MOVLW b'0000'
MOVWF TRISA
MOVLW b'0000'
MOVWF PORTA
CALL TEMPO
BSF STATUS, 5
MOVLW b'0000'
MOVWF TRISB
BSF STATUS, 5
ETQ2 MOVWF b
MOVWF PORTB
CALL TEMPO
CLRF segcount
CALL TEMPO
BCF STATUS, 5
MOVLW b'00111111'
MOVWF PORTB
CALL TEMPO
MOVLW b'00000110'
MOVWF PORTB
CALL TEMPO
MOVLW b'01011011'
MOVWF PORTB
CALL TEMPO
MOVLW b'01001111'
MOVWF PORTB
CALL TEMPO
MOVLW b'01100110'
MOVWF PORTB
CALL TEMPO
MOVLW b'01101101'
MOVWF PORTB
CALL TEMPO
MOVLW b'01111101'
MOVWF PORTB
CALL TEMPO
MOVLW b'000000111'
MOVWF PORTB
CALL TEMPO
MOVLW b'011111111'
MOVWF PORTB
CALL TEMPO
INCF PORTA
MOVLW 7
SUBWF PORTA,0
BTFSC STATUS,Z
GOTO ETQ1
MOVLW b'01101111'
MOVWF PORTB
CALL TEMPO
INCF PORTA
GOTO ETQ2
TEMPO
MOVLW d '200'
MOVWF COUNTER1
LOOP1
MOVLW d'250'
MOVWF COUNTER2
LOOP2
NOP
DECF COUNTER 2
BNZ LOOP2
DECF COUNTER 1
BNZ LOOP1
RETURN
END
OR ANOTHER CODE