基于单片机的电梯控制系统毕业论文(完整)概要 下载本文

模拟电梯控制系统设计

JB P1.3,FOU CLR P2.3

FOU: JB P1.4,FIV LCALL YS10MS JB P1.4,FIV CLR P2.4

FIV: JB P1.5,SIX LCALL YS10MS JB P1.5,SIX CLR P2.5

SIX: JB P1.6,SEV LCALL YS10MS JB P1.6,SEV CLR P2.6

SEV: JB P1.7,XUN LCALL YS10MS JB P1.7,XUN CLR P2.7 LJMP XUN

;;;;;;;;;;;;;;;;中断程序;;;;;;;;;;;;;;;;;;;;;; INT0X: MOV TH0,#3CH MOV TL0,#0B0H INC TCOUNT MOV A,TCOUNT

CJNE A,#5,ZHUAN2 ;50MS*5=250MS MOV TCOUNT,#00H JB F0,ZHUAN LJMP ZHUAN1

ZHUAN: LJMP XIAJIANG ZHUAN1: MOV P3,#0F8H ; MOV A,CENG

CJNE A,#00H,SS2 MOV P0,#06H ; JB P2.0,SS1_1 INC 30H MOV A,30H

CJNE A,#1,SSX1_1 CLR P3.4 ;

SSX1_1: CJNE A,#2,SSX1_2 SETB P3.4 ; SSX1_2: CJNE A,#16,SSX1_3

第- 29 –页 共33 页

运城学院计算机科学与技术系毕业论文

CLR P3.4 ;

SSX1_3: CJNE A,#17,ZHUAN2 ;16*250MS=4S MOV 30H,#0

SETB P3.4 ; SETB P2.0 ; SS1_1: INC 31H MOV A,31H

CJNE A,#9,ZHUAN2 ;8*250MS=2S MOV 31H,#0 INC CENG

SS2: MOV A,CENG CJNE A,#01H,SS3 MOV P0,#5BH ; JB P2.1,SS2_1 INC 32H MOV A,32H

CJNE A,#1,SSX2_1 CLR P3.4 ;

SSX2_1: CJNE A,#2,SSX2_2 SETB P3.4 ; SSX2_2: CJNE A,#16,SSX2_3 CLR P3.4 ;

SSX2_3: CJNE A,#17,ZHUAN2 ;16*250MS=4S MOV 32H,#0

SETB P3.4 ; SETB P2.1 ; SS2_1: INC 33H MOV A,33H

CJNE A,#9,ZHUAN2 ;8*250MS=2S MOV 33H,#0 LJMP ZHUAN3 ZHUAN2: LJMP HDJ ZHUAN3: INC CENG SS3: MOV A,CENG CJNE A,#02H,SS4 MOV P0,#4FH JB P2.2,SS3_1 INC 34H MOV A,34H

CJNE A,#1,SSX3_1 CLR P3.4

第- 30 –页 共33页

模拟电梯控制系统设计

SSX3_1: CJNE A,#2,SSX3_2 SETB P3.4

SSX3_2: CJNE A,#16,SSX3_3 CLR P3.4

SSX3_3: CJNE A,#17,ZHUAN2 MOV 34H,#0 SETB P3.4 SETB P2.2 SS3_1: INC 35H MOV A,35H

CJNE A,#9,ZHUAN2 MOV 35H,#0 INC CENG SS4: MOV A,CENG CJNE A,#03H,SS5 MOV P0,#66H JB P2.3,SS4_1 INC 36H MOV A,36H

CJNE A,#1,SSX4_1 CLR P3.4

SSX4_1: CJNE A,#2,SSX4_2 SETB P3.4

SSX4_2: CJNE A,#16,SSX4_3 CLR P3.4

SSX4_3: CJNE A,#17,ZHUAN2 MOV 36H,#0 SETB P3.4 SETB P2.3 SS4_1: INC 37H MOV A,37H

CJNE A,#9,ZHUAN2 MOV 37H,#0 INC CENG SS5: MOV A,CENG CJNE A,#04H,SS6 MOV P0,#6DH JB P2.4,SS5_1 INC 38H MOV A,38H

CJNE A,#1,SSX5_1

第- 31 –页 共33 页

运城学院计算机科学与技术系毕业论文

CLR P3.4

SSX5_1: CJNE A,#2,SSX5_2 SETB P3.4

SSX5_2: CJNE A,#16,SSX5_3 CLR P3.4

SSX5_3: CJNE A,#17,ZHUAN4 MOV 38H,#0 SETB P3.4 SETB P2.4 SS5_1: INC 39H MOV A,39H

CJNE A,#9,ZHUAN4 MOV 39H,#0 INC CENG SS6: MOV A,CENG CJNE A,#05H,SS7 MOV P0,#7DH JB P2.5,SS6_1 INC 3AH MOV A,3AH

CJNE A,#1,SSX6_1 CLR P3.4

SSX6_1: CJNE A,#2,SSX6_2 SETB P3.4

SSX6_2: CJNE A,#16,SSX6_3 CLR P3.4

SSX6_3: CJNE A,#17,ZHUAN4 MOV 3AH,#0 SETB P3.4 SETB P2.5 SS6_1: INC 3BH MOV A,3BH

CJNE A,#9,ZHUAN4 MOV 3BH,#0 INC CENG SS7: MOV A,CENG CJNE A,#06H,SS8 MOV P0,#07H JB P2.6,SS7_1 INC 3CH MOV A,3CH

第- 32 –页 共33页