Membuat
flip-flop dengan berurutan
Berikut
ini sedikit pengembangan praktekum ke-2
Program assemblernya sbb
org 00h
counter_5ms equ 50h
ROM equ 100h
org ROM
ajmp start
start:
cpl p1.0
acall delay_500ms
cpl p1.1
acall delay_500ms
cpl p1.2
acall delay_500ms
cpl p1.3
acall delay_500ms
cpl p1.4
acall delay_500ms
cpl p1.5
acall delay_500ms
ajmp start
delay_500ms:
mov counter_5ms,#150
tunggu_500ms:
acall delay_5ms
djnz counter_5ms,tunggu_500ms
ret
delay_5ms:
PUSH TMOD
mov TMOD,#21h
mov th0,#0EDh
mov TL0,#0FFh
setB TR0
tunggu_5ms:
JBC tf0,sudah_5ms
AJMP tunggu_5ms
sudah_5ms:
CLR TR0
POP TMOD
ret
end
maka akan menghasilkan simulasi sbb:
Tidak ada komentar:
Posting Komentar