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

Home Work

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Ministre de l’enseignement et de la recherche scientifique

Université M’HAMMED BOUGARA BOUMERDES


Faculté des technologies
Département : Electronique
Spécialité : Instrumentation biomédical

Réaliser par :

ABU AMRO ABDELRAHMAN

Année universitaire : 2023_2024


Schema:

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:

counter1 equ 0x20

counter2 equ 0x21

segcount equ 0x22

Start

BSF STATUS, 5

MOVLW b'0000'

MOVWF TRISA

ETQ1 BCF STATUS, 5

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

You might also like