medadnoki
18-05-2011, 01:29
سلام ! من باید پروژه دماسنج رو با lm35 درست کنم....برنامش رو نوشتم ولی جواب نمیگیرم:cry::cry::cry::cry:
نمیدونم چی کار کنم!!!!!!!!!!!!!!!!!!!!
راهنمایی کنید
برنامه :
;********** in the name of god *****************
ORG 00H
MOV A,#38H
CALL instruction
MOV A,#01H
CALL instruction
MOV A,#0CH
CALL instruction
MOV DPTR,#row
CALL LFB
NOP
LFB: MOV A,#83h
CALL instruction
MOV A,#0EH ;on
CALL instruction
CALL delay
MOV A,#0CH ;off
CALL instruction
CALL delay
MOV A,#0EH ;on
CALL instruction
ACALL delay
MOV A,#0CH ;off
CALL instruction
ACALL delay
MOV A,#0EH ;on
CALL instruction
JOTH: CLR A
CALL delay
MOVC A,@A+DPTR
JZ ENDING
CALL display
INC DPTR
MOV A,#06H
CALL instruction
SJMP JOTH
ENDING: MOV A,#0CH
CALL instruction
SJMP main
;*************************** main program *******************
Main: NOP
SETB P2.4 ;WR
CLR P2.4
NOP
NOP
SETB P2.4
BACK3: JB P2.5,BACK3
CLR P2.5 ;INTR
CALL delay
MOV A,P1 ;read port 1
SETB P2.3 ;RD
SETB P2.5
MOV B,#10
DIV AB
MOV R7,B
MOV B,#10
DIV AB
MOV R6,B
MOV A,R7
ANL A,#0FH
ORL A,#30H
CALL DD1
MOV A,R6
ANL A,#0FH
ORL A,#30H
CALL DD2
SJMP Main
DD1: MOV R2,A
MOV A,#0C5H
CALL instruction
MOV A,R2
CALL display
RET
DD2: MOV R2,A
MOV A,#0DFH
CALL display
MOV A,#0C4H
CALL instruction
MOV A,R2
CALL display
RET
;************************************************* **********************;
instruction: CALL READY
MOV P3,A
CLR P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
display: ACALL READY
MOV P3,A
SETB P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
READY: SETB P3.7
CLR P2.0
SETB P2.1
BACK1: CLR P2.2
SETB P2.2
JB P3.7,BACK1
RET
;****************** delay ********************
delay: MOV R6,#40
L8: MOV R7,#50
L7: MOV R5,#30
L6: DJNZ R5,L6
DJNZ R7,L7
DJNZ R6,L8
RET
;************************************************
row: DB 'Temperature',0
;
end
فایل پروتوس :
You can see links before reply
دانلود فایل پروتوس :
You can see links before reply
نمیدونم چی کار کنم!!!!!!!!!!!!!!!!!!!!
راهنمایی کنید
برنامه :
;********** in the name of god *****************
ORG 00H
MOV A,#38H
CALL instruction
MOV A,#01H
CALL instruction
MOV A,#0CH
CALL instruction
MOV DPTR,#row
CALL LFB
NOP
LFB: MOV A,#83h
CALL instruction
MOV A,#0EH ;on
CALL instruction
CALL delay
MOV A,#0CH ;off
CALL instruction
CALL delay
MOV A,#0EH ;on
CALL instruction
ACALL delay
MOV A,#0CH ;off
CALL instruction
ACALL delay
MOV A,#0EH ;on
CALL instruction
JOTH: CLR A
CALL delay
MOVC A,@A+DPTR
JZ ENDING
CALL display
INC DPTR
MOV A,#06H
CALL instruction
SJMP JOTH
ENDING: MOV A,#0CH
CALL instruction
SJMP main
;*************************** main program *******************
Main: NOP
SETB P2.4 ;WR
CLR P2.4
NOP
NOP
SETB P2.4
BACK3: JB P2.5,BACK3
CLR P2.5 ;INTR
CALL delay
MOV A,P1 ;read port 1
SETB P2.3 ;RD
SETB P2.5
MOV B,#10
DIV AB
MOV R7,B
MOV B,#10
DIV AB
MOV R6,B
MOV A,R7
ANL A,#0FH
ORL A,#30H
CALL DD1
MOV A,R6
ANL A,#0FH
ORL A,#30H
CALL DD2
SJMP Main
DD1: MOV R2,A
MOV A,#0C5H
CALL instruction
MOV A,R2
CALL display
RET
DD2: MOV R2,A
MOV A,#0DFH
CALL display
MOV A,#0C4H
CALL instruction
MOV A,R2
CALL display
RET
;************************************************* **********************;
instruction: CALL READY
MOV P3,A
CLR P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
display: ACALL READY
MOV P3,A
SETB P2.0
CLR P2.1
SETB P2.2
CLR P2.2
RET
READY: SETB P3.7
CLR P2.0
SETB P2.1
BACK1: CLR P2.2
SETB P2.2
JB P3.7,BACK1
RET
;****************** delay ********************
delay: MOV R6,#40
L8: MOV R7,#50
L7: MOV R5,#30
L6: DJNZ R5,L6
DJNZ R7,L7
DJNZ R6,L8
RET
;************************************************
row: DB 'Temperature',0
;
end
فایل پروتوس :
You can see links before reply
دانلود فایل پروتوس :
You can see links before reply