G
gokcercakir
Guest
Ovaj program je stvaran vrijeme timera.to je 4 otkriti i da će ići u korist u svakom 10 mseconds.Sve se čini ok, ali postoji problem.želim dodati da neke prekida.ja pokušao, ali svaki način ja mogao.Može bilo tko pomoć mene sa ovaj problem.žalostan za moj engleski jezik.Koda sam dodao su napisane podebljano.A ja dalek koda su pisane italic.JA stvarno potreba pomoć o tome.Hvala.
DISPLAY1 EQU 31h
DISPLAY2 EQU 32h
DISPLAY3 EQU 34h
DISPLAY4 EQU 35H
OVERBIT EQU 36
OVERBIT2 EQU 37
OVERBIT3 EQU 38
ORG2004hJMP ISRTFOORG 2100h
MOV P2, # 00h
MOV P1, # 00h
MOV DPTR, # tablo
MOV R1, # 00h
MOV R2, # 00h
MOV R3, # 00h
MOV R4, # 00h
MOV IE, # 82HMOV TH0, # 0DBhMOV TL0, # 0FFhMOV TMOD, # 81hMOV SP, # 70hSETB TR0
:
MainOZIV SEND_TIMEGLAVNI JMPCLR EATCON MOV, # 10hMOV TMOD, # 81hMain:MOV TH0, # 0DBhMOV TL0, # 0FFhPOZIV MOV_TIMETIMEROZIV SEND_TIMEJNB TCON.5, TIMERCLR TF0GLAVNI JMP
;================================================= =======
MOV_TIME:
MOV, R1
MOVC, @ DPTR
MOV DISPLAY1,
INC R1
CJNE R1, # 0Ah, disp1
MOV R1, # 00h
SETB OVERBIT
NOP
disp1:
MOV, R2
MOVC, @ DPTR
MOV DISPLAY2,
JNB OVERBIT, ovr
INC R2
CLR OVERBIT
ovr:
CJNE R2, # 0Ah, disp2
MOV R2, # 00h
SETB OVERBIT2
NOP
disp2:
MOV, R3
MOVC, @ DPTR
MOV DISPLAY3,
JNB OVERBIT2, ovr2
INC R3
CLR OVERBIT2
ovr2:
CJNE R3, # 0Ah, disp3
MOV R3, # 00h
SETB OVERBIT3
NOP
disp3:
MOV, R4
MOVC, @ DPTR
MOV DISPLAY4,
JNB OVERBIT3, ovr3
INC R4
CLR OVERBIT3
ovr3:
CJNE R4, # 0Ah, disp4
MOV R4, # 00h
disp4:
RET
;================================================= =======
SEND_TIME:
MOV P1, # 00h
SETB P2.3
MOV P1, DISPLAY1
POZIV DELAY
CLR P2.3
MOV P1, # 00h
POZIV DELAY
SETB P2.2
MOV P1, DISPLAY2
POZIV DELAY
CLR P2.2
MOV P1, # 00h
SETB P2.1
MOV P1, DISPLAY3
POZIV DELAY
CLR P2.1
MOV P1, # 00h
SETB P2.0
MOV P1, DISPLAY4
POZIV DELAY
CLR P2.0
RET
;================================================= ================
ODGODA:
MOV R0, # 0FAh
WAIT:
NOP
NOP
DJNZ R0, pričekajte
RETISRTF0:MOV tho, # 0DBhMOV TL0, # 0FFhCLR TF0POZIV MOV_TIMEReti;================================================= ================
Tablo:
DB 0C0h
DB 0F9h
DB 0A4h
DB 0B0h
DB 99H
DB 92H
DB 82H
DB 0F8h
DB 80h
DB 90h
END
Mislim da je problem oko prekinuti ili početak adresa mjesta.Ali kao JA znati T0 je prekinuti adressed na 2004H u 8051 mikrokontrolera.Please help
DISPLAY1 EQU 31h
DISPLAY2 EQU 32h
DISPLAY3 EQU 34h
DISPLAY4 EQU 35H
OVERBIT EQU 36
OVERBIT2 EQU 37
OVERBIT3 EQU 38
ORG2004hJMP ISRTFOORG 2100h
MOV P2, # 00h
MOV P1, # 00h
MOV DPTR, # tablo
MOV R1, # 00h
MOV R2, # 00h
MOV R3, # 00h
MOV R4, # 00h
MOV IE, # 82HMOV TH0, # 0DBhMOV TL0, # 0FFhMOV TMOD, # 81hMOV SP, # 70hSETB TR0
:
MainOZIV SEND_TIMEGLAVNI JMPCLR EATCON MOV, # 10hMOV TMOD, # 81hMain:MOV TH0, # 0DBhMOV TL0, # 0FFhPOZIV MOV_TIMETIMEROZIV SEND_TIMEJNB TCON.5, TIMERCLR TF0GLAVNI JMP
;================================================= =======
MOV_TIME:
MOV, R1
MOVC, @ DPTR
MOV DISPLAY1,
INC R1
CJNE R1, # 0Ah, disp1
MOV R1, # 00h
SETB OVERBIT
NOP
disp1:
MOV, R2
MOVC, @ DPTR
MOV DISPLAY2,
JNB OVERBIT, ovr
INC R2
CLR OVERBIT
ovr:
CJNE R2, # 0Ah, disp2
MOV R2, # 00h
SETB OVERBIT2
NOP
disp2:
MOV, R3
MOVC, @ DPTR
MOV DISPLAY3,
JNB OVERBIT2, ovr2
INC R3
CLR OVERBIT2
ovr2:
CJNE R3, # 0Ah, disp3
MOV R3, # 00h
SETB OVERBIT3
NOP
disp3:
MOV, R4
MOVC, @ DPTR
MOV DISPLAY4,
JNB OVERBIT3, ovr3
INC R4
CLR OVERBIT3
ovr3:
CJNE R4, # 0Ah, disp4
MOV R4, # 00h
disp4:
RET
;================================================= =======
SEND_TIME:
MOV P1, # 00h
SETB P2.3
MOV P1, DISPLAY1
POZIV DELAY
CLR P2.3
MOV P1, # 00h
POZIV DELAY
SETB P2.2
MOV P1, DISPLAY2
POZIV DELAY
CLR P2.2
MOV P1, # 00h
SETB P2.1
MOV P1, DISPLAY3
POZIV DELAY
CLR P2.1
MOV P1, # 00h
SETB P2.0
MOV P1, DISPLAY4
POZIV DELAY
CLR P2.0
RET
;================================================= ================
ODGODA:
MOV R0, # 0FAh
WAIT:
NOP
NOP
DJNZ R0, pričekajte
RETISRTF0:MOV tho, # 0DBhMOV TL0, # 0FFhCLR TF0POZIV MOV_TIMEReti;================================================= ================
Tablo:
DB 0C0h
DB 0F9h
DB 0A4h
DB 0B0h
DB 99H
DB 92H
DB 82H
DB 0F8h
DB 80h
DB 90h
END
Mislim da je problem oko prekinuti ili početak adresa mjesta.Ali kao JA znati T0 je prekinuti adressed na 2004H u 8051 mikrokontrolera.Please help