文件名称:基于单片机的电梯仿真
文件大小:29KB
文件格式:RAR
更新时间:2014-07-04 17:55:27
电梯仿真
利用protues进行单片机电梯仿真 ORG 0000H SJMP MAIN ORG 0003H SJMP INT0 ORG 0030H MAIN: CLR IT0 SETB EX0 SETB EA MOV 40H,#1 MOV R0,#1 ; MOV R1,#1 LOOP: ACALL DISPLAY1 SJMP LOOP INT0: CLR EA PUSH PSW PUSH ACC JNB P1.0,S1 JNB P1.1,S2 JNB P1.2,S3 JNB P1.3,S4 JNB P1.4,S5 JNB P1.5,S6 JNB P1.6,S7 JNB P1.7,S8 RETUP: POP ACC POP PSW ;CLR IT0 ;SETB EX0 SETB EA RETI S1: MOV R0,#1 ACALL DISPLAY AJMP RETUP S2: MOV R0,#2 ACALL DISPLAY AJMP RETUP S3: MOV R0,#3 ACALL DISPLAY AJMP RETUP S4: MOV R0,#4 ACALL DISPLAY AJMP RETUP S5: MOV R0,#5 ACALL DISPLAY AJMP RETUP S6: MOV R0,#6 ACALL DISPLAY AJMP RETUP S7: MOV R0,#7 ACALL DISPLAY AJMP RETUP S8: MOV R0,#8 ACALL DISPLAY AJMP RETUP DISPLAY: MOV 30H,40H MOV 40H,R0 MOV R0,30H DISPLAY1: MOV P2,#00H CLR P3.0 CLR P3.1 MOV DPTR,#TAB LOOP11: MOV A,R0 MOV 42H,A MOVC A,@A+DPTR MOV P2,A SETB P3.1 CALL DELAY CLR P3.1 MOV A,42H CJNE A,40H,QQ RET QQ: JNC QQ1 INC R0 SJMP LOOP11 QQ1: DEC R0 SJMP LOOP11 TAB: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H DELAY: MOV R7,#250 DEL1: MOV R6,#250 DEL2: MOV R5,#4 DEL3: DJNZ R5,DEL3 DJNZ R6,DEL2 DJNZ R7,DEL1 RET END
【文件预览】:
电梯实验
----Last Loaded DITISHIYAN.DBK(81KB)
----Untitled.DSK(3KB)
----DITISHIYAN.ASM(2KB)
----DITISHIYAN.DSN(81KB)
----DITISHIYAN.BIN(215B)
----DITISHIYAN.PWI(742B)
----DITISHIYAN.HEX(535B)