Minh moi hoc vi xu ly nen nho cac ban giai thich tung doan lenh dum nha ,minh khong hieu may ,chi biet chep danh lenh khong ah.cam on nha.ghi ro va huong dan dum nha ,y nghia cua tung lenh ha.cam on nhieu lam.
CHUONG TRINH DIEU KHIEN 8 LED SANG TAT
KET NOI : 8 LED ->PORT 0(CO DEM DAO)
$MOD51
ORG 00H
CHOPTAT:
MOV P0,#00H ;LED TAT
LCALL DELAY500MS
MOV P0,#0FFH ;LED SANG
LCALL DELAY500MS
SJMP CHOPTAT ;QUAY LAI
DELAY500MS:;CHUONG TRINH CON TAO THOI GIAN TRE 500MS
PUSH 00H
MOV R0,#100
MOV TMOD,#01H
LOOP2:
MOV TH0,#0ECH
MOV TL0,#78H
SETB TR0
JNB TF0,$
CLR TR0
CLR TF0
DJNZ R0,LOOP2
POP 00H
RET
END
CHUONG TRINH DIEU KHIEN 8 LED SANG TAT
KET NOI : 8 LED ->PORT 0(CO DEM DAO)
$MOD51
ORG 00H
CHOPTAT:
MOV P0,#00H ;LED TAT
LCALL DELAY500MS
MOV P0,#0FFH ;LED SANG
LCALL DELAY500MS
SJMP CHOPTAT ;QUAY LAI
DELAY500MS:;CHUONG TRINH CON TAO THOI GIAN TRE 500MS
PUSH 00H
MOV R0,#100
MOV TMOD,#01H
LOOP2:
MOV TH0,#0ECH
MOV TL0,#78H
SETB TR0
JNB TF0,$
CLR TR0
CLR TF0
DJNZ R0,LOOP2
POP 00H
RET
END
Comment