Google Search

Thursday, October 13, 2011

ELEVATOR INTERFACE MICROPROCESSOR AND MICROCONTROLLER LAB MANUAL



ELEVATOR INTERFACE

; elevator interface
; assume the interface is connected to J2 of the trainer
; the trainer can be in keyboard mode or serial mode

SEG
EQU
0E8H
P2
EQU
0A0H
DPL
EQU
82H
DPH
EQU
83H


ADDER
OPCODE
LABEL
MNEMONICS
8000
75 A0 E8
START:
P2 # SEG
8003
78 82 03

MOV R0, #03H
8005
74 82

MOV A, #82H
8007
F2

MOV X, @R0, A
8008
E4

CLR A
8009
F8

MOV R0, A
800A
F9

MOV R1, A
800B
E9
LOOP1:
MOV A, R1
800C
44 F0

ORL A, #0F0H
800E
78 00

MOV R0, #00H
8010
F2

MOV X @R0, A
8011
90 80 61

MOV DPIR, #FLOOR
8014
08

INC R0
8015
E2
LOOP2:
MOV X A1, #0F0H
8016
44 F0

ORL A, #0F0H
8018
FA

MOV RL, A
8019
04

INC A
801A
60 F9

JZ LOOP2
801C
EA
LOOP3:
MOV A, R2
801D
13

RRC A
801E
FA

MOV R2, A
801F
50 03

JNZ DECIDE
8021
A3

INC DPIR
8022
80 F8

SJMP LOOP3
8024
12 80 4E
DECIDE:
LCALL DELAY
8027
E4

CLR A
8028
93

MOV C A, @A+DPIR
8029
B5 01 02

CJNE A, 1, L1
802C
80 14

SJMP RESET
802E
40 09
L1:
JC DOWN
8030
09
4P:
INC R1
8031
E9

MOV A, R1
8032
44 F0

ORL A, #0F0H
8034
78 00

MOV R0, #00H
8036
F2

MOV X @R0, A
8037
B0 EB

SJMP DECIDE
8039
19
DOWN:
DEC R1
803A
E9

MOV A, R1
803B
44 F0

ORL A, #0F0H
803D
78 00

MOV R0, #00H
803F
F2

MOV X @R0, A
8040
80 E2

SJMP DECIDE
8042
74 05
RESET:
MOV A, #05H
8044
25 82

ADD A, DPL
8046
F5 82

MOV DPL, A
8048
E4

CLR A
8049
F8

MOV R0, A
804A
93

MOV C A, @A+DPIR
804B
F2

MOV X @R0, A
804C
80 BD

SJMP LOOP1
804E
C0 83
DELAY:
PUSH DPH
8050
C0 82

PUSH DPL
8052
90 00 00

MOV DPIR, #00H
8055
A3
DELAY1:
INC DPTR
8056
E5 83

MOV A, DPH
8058
45 82

ORL A, DPL
805A
70 F9

JNZ DELAY1
805C
D0 82

POP DPL
805E
D0 83

POP DPH
8060
22

RET
8061
00 03 06
FLOOR:
DB 00H, 03H, 06H
8064
09 00 E0

DB 09H, 00H, 0E0H
8067
D3 B6 79

DB 003H, 0B6H, 79H

Result: Thus elevator is interfaced with micro controller 8051.

0 comments:

Post a Comment