8085a microprocessor controli.er for a 2 storey …
TRANSCRIPT
8085A MICROPROCESSOR CONTROLIER FOR A 2 STOREY ELEVATOR
SHAMSUDIN BIN BAHARUN
UNIVERSITI MALAYSIA SARAWAK 1997
11
7895 HS S528 1997
5
R13a
BORANG PENYERAHAN TESIS
JuduL 8085A Microprocessor Controller for a 2 storey Elevator
SESI PENGAJIAN 1996197
Saya SHAMSUDIN BIN BAHARUN
mengaku membenarkan tesis jui rusimpan ru Pusat Ilthidmat Maklumat Akademik Universiti Malaysia Sarawak dengan syarat-syarat kegunaan seperti berikut
1 Hakmilik keltas projek adalah ru bawall nama penulis melainkan penuhsan sebagai projek bersama dan dibiayai oleh UNIMAS hakmiliknya adalah kepunyaan UNlMAS
2 Naskah salinan ru dalam bentuk kertas atau mikro hanya boleh dibuat dangan kebenaraIl beltulis daripada penulis
3 Pusat Khidmat MakIumat Akademik UNIMAS dibenarkan membuat salinaIl uutuk pengajian mereka
4 Kertas projek hanya boleh ruterbitkan dengan kebenaran penulis Bayaran royalti adaJah mengikutkadar yang dipersetujui kelak Saya membenarkanltidal membenarkan Perpustakaan membuat salinan kertas projek ini sebagai bahan pertukaran ru aIltara insti tusi pengajiaIl tinggi
6 Sila tandakan (j)
D SULIT (Mengandungi makIumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSlA RASMI 1972)
D TERHAD (Mengandungi maklumat TEEHAD yang -dah ditentukan oleh organisasjJ oadan di mana penye1idikan dijalankan)
TIDAT TERHAD
(TANDATANGAll PENULIS)
Mamat tetap No 244 Felda Mayam ll300 T riWg Pahang
Tarikh 19 i 911997
CATATALl Potong yang tidak berkenaan
Disahkan oleh
(TANDATANGAN PENYELIA)
L middot l~dUU rogrrru E ktronik dan Telekom uOikasl
Kciuruteraan e Nama P enye1ia
Tarikb _------I~-t___fC(_-__(6I_ r
Jika Kertas Projek lui SULIT aau TERHAD sila lampirkan surat daripada pihak berkuaBaiorgauisasi berkenaan dengan menyertakan sekali tempoh kertas projek Ini diperluk= sebagai SULIT atau TERHAD
This thesis was read a nd approved by
Dr Mohamad Kadim Suaidi Date Supervisor
Pus1 Iohidmat ~llklumill kd~m~ dN1VERS1TI M lSI SRA~K
808M MICROPROCESSOR CONTROuER FOR A 2 STOREY ELEVATOR
SHAMSUDIN BIN BAHARUN
Tesis Dikemukakan Kepada Fakulti Kejuruteraan Universiti Malaysia Sarawak Sebagai Memenuhi Sebahagian daripada Syarat
PenganugerabaD Sarjana Muda Kejuruteraan Dengan kepujian (KejUlUteraan Elektronik dan TelekoDlUnikasi)
1997
For My Beloved Parents
II
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
5
R13a
BORANG PENYERAHAN TESIS
JuduL 8085A Microprocessor Controller for a 2 storey Elevator
SESI PENGAJIAN 1996197
Saya SHAMSUDIN BIN BAHARUN
mengaku membenarkan tesis jui rusimpan ru Pusat Ilthidmat Maklumat Akademik Universiti Malaysia Sarawak dengan syarat-syarat kegunaan seperti berikut
1 Hakmilik keltas projek adalah ru bawall nama penulis melainkan penuhsan sebagai projek bersama dan dibiayai oleh UNIMAS hakmiliknya adalah kepunyaan UNlMAS
2 Naskah salinan ru dalam bentuk kertas atau mikro hanya boleh dibuat dangan kebenaraIl beltulis daripada penulis
3 Pusat Khidmat MakIumat Akademik UNIMAS dibenarkan membuat salinaIl uutuk pengajian mereka
4 Kertas projek hanya boleh ruterbitkan dengan kebenaran penulis Bayaran royalti adaJah mengikutkadar yang dipersetujui kelak Saya membenarkanltidal membenarkan Perpustakaan membuat salinan kertas projek ini sebagai bahan pertukaran ru aIltara insti tusi pengajiaIl tinggi
6 Sila tandakan (j)
D SULIT (Mengandungi makIumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKTA RAHSlA RASMI 1972)
D TERHAD (Mengandungi maklumat TEEHAD yang -dah ditentukan oleh organisasjJ oadan di mana penye1idikan dijalankan)
TIDAT TERHAD
(TANDATANGAll PENULIS)
Mamat tetap No 244 Felda Mayam ll300 T riWg Pahang
Tarikh 19 i 911997
CATATALl Potong yang tidak berkenaan
Disahkan oleh
(TANDATANGAN PENYELIA)
L middot l~dUU rogrrru E ktronik dan Telekom uOikasl
Kciuruteraan e Nama P enye1ia
Tarikb _------I~-t___fC(_-__(6I_ r
Jika Kertas Projek lui SULIT aau TERHAD sila lampirkan surat daripada pihak berkuaBaiorgauisasi berkenaan dengan menyertakan sekali tempoh kertas projek Ini diperluk= sebagai SULIT atau TERHAD
This thesis was read a nd approved by
Dr Mohamad Kadim Suaidi Date Supervisor
Pus1 Iohidmat ~llklumill kd~m~ dN1VERS1TI M lSI SRA~K
808M MICROPROCESSOR CONTROuER FOR A 2 STOREY ELEVATOR
SHAMSUDIN BIN BAHARUN
Tesis Dikemukakan Kepada Fakulti Kejuruteraan Universiti Malaysia Sarawak Sebagai Memenuhi Sebahagian daripada Syarat
PenganugerabaD Sarjana Muda Kejuruteraan Dengan kepujian (KejUlUteraan Elektronik dan TelekoDlUnikasi)
1997
For My Beloved Parents
II
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
This thesis was read a nd approved by
Dr Mohamad Kadim Suaidi Date Supervisor
Pus1 Iohidmat ~llklumill kd~m~ dN1VERS1TI M lSI SRA~K
808M MICROPROCESSOR CONTROuER FOR A 2 STOREY ELEVATOR
SHAMSUDIN BIN BAHARUN
Tesis Dikemukakan Kepada Fakulti Kejuruteraan Universiti Malaysia Sarawak Sebagai Memenuhi Sebahagian daripada Syarat
PenganugerabaD Sarjana Muda Kejuruteraan Dengan kepujian (KejUlUteraan Elektronik dan TelekoDlUnikasi)
1997
For My Beloved Parents
II
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
Pus1 Iohidmat ~llklumill kd~m~ dN1VERS1TI M lSI SRA~K
808M MICROPROCESSOR CONTROuER FOR A 2 STOREY ELEVATOR
SHAMSUDIN BIN BAHARUN
Tesis Dikemukakan Kepada Fakulti Kejuruteraan Universiti Malaysia Sarawak Sebagai Memenuhi Sebahagian daripada Syarat
PenganugerabaD Sarjana Muda Kejuruteraan Dengan kepujian (KejUlUteraan Elektronik dan TelekoDlUnikasi)
1997
For My Beloved Parents
II
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
For My Beloved Parents
II
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
ACKNOWLEDGEMENT
Directly and indirectly many people have been involved in the
preparation of this thesis I will begin by acknowledging the Dean of Faculty
Engineering who over the years have taught me much Also I wisb to thank
my supervisor Dr Mohamad Kadim Suaidi for his concern effort and
knowledge to me
r wish to extend a special word of thanks to my colleague Wan Mohd Soli
Wan Salim for his help valuable suggestions and bis contr ibution m
completing this thesis
I would also like to thanks t he laboratory assistants and technicians En
Wan Abu Bakar E n Masri and En Ryer for their unflagging supports during
completing my project
Finally I would like to thank my classmates for their upport and
encouragement
iii
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
ABSTRACT
Using microprocessor 8085A trainer this project was build by the
combination of the microprocessor 8085A and three external electronic circuiQ
The three external circuits that a re stepper motor circui~ for controlling door
stepper motor for controlling elevator and seven segment display circuit for
display the position of the elevator All of this circuits are connected to tbe 1I0
interface that already fixed on the microprocessor 8085A trainer
Understanding and familiarizing with the basic microprocessor B085A is
necessary before starting this project A literature review have been done by
us befure developlllg this project for the purpose to understand the process of
developing a real elevator Further more an analysis have also been done to
determine an appropria te exter nal circuits that suitable wilh the project before
start on designing the assembly La nguage This project has been build in the
form of model to show the result of our project that we have done
At the end of this thesis some recommendations are given for those who
are interested to expand on this project
IV
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
ABSTRAK
Melalui penggunaan bantuan mikroprosessor 8085A projek ini dapat
dibina dengan gabungan antara microprocessor 8085A dan 3 litar elektronik
luma n Litar luaran itu adalah litar motor pe langkah untuk mengawal pintu
motor pelangkah untuk mengawal pergerakkan lif dan lita r paparan tujuh
segmen untuk memaparkan kedudukan lif Kesemua litar ini disambungkan
kepada antaramuka masukanlkeluaran yang sedia ada pada bantuan
mikroprosessor 8085A
Pe mahaman da n membiasakan diri dengan asasasas mikroprosessol
8085A adalah merupakan satu kemestian sebelum memulakan projek ini Satu
tinjauan terhadapat kajian terdahulu dilakukan oleh kami terlebih dahu lu
sebelum membina projek ini bagi tujuan unt-uk memahami operas membma lif
yang sebenarnya Seterusnya satu analisis telah diJakukan bagi menentukan
li tar luar yang sesuai untuk projek kami sebelum mula untuk membentuk
perisian bahasa penghimpun Proiek ini akhirnya dibina dalam bentuk model
bagi menggambarkan hasil ke rja yang telah siap dijalankan
Pada penghujung penulisan tesis ini beberapa cada ngan diberikan k has
untuk mereka yang berminat untuk mengembangkanlagi proiek in
v
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
hi 1 C oj
Iusat Ihidnat I U bull c ~RA M(
1 sn1 MAL S1 tI Ji
CONTENT
Page
DEDICATION II
ACKNOWLEDGEMENT 1ll
TABLELI T
ABSTRACT IV
ABSTRAK V
CONTENT VI
Xl
FIGURE LIST xu
ABREVIATIONS xiv
FLOWCHART LIST xv
APPENDIX LIST XVI
Chapter
1 INTRODUCTION 1
10 Introduction 1
11 Overview of the project 2
111 Operation 2
12 Objectives of the thesis 4
VI
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
- - ---- -----
2 INTRODUCTION TO 808SA MICROPROCESSOR 6
20 Introductwn 6
21 What is a Microprocessor 7
2 11 Duties of the microprocessor 8
22 Buses system 8
221 Address Bus 9
222 Data Bus 9
223 Control Bus 9
23 The Memory System 9
24 riO section lO
241 Duties of the VO section 10
242 Input Port 10
243 Output Port 11
25 In terna l Architecture Of The 8085A Microprocessor 11
26 8085A System Hardware 13
261 8085A Pin Definitions 13
262 The PIA 8155 13
2621 Pin out ofthe 81 55 PIA 14
2622 Command Register Command Word 15
26 23 The 8155 common address 15
2624 Programming the 8155 PIA 16
27 Microprocessor 8085 trainer system 17
271 Technical Description 17
272 Description of the PROGRAMMING UNIT board 18
Vll
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
(type 3515)
273 Starting the MICROPROCESSOR TECH NOLOGY 21
TRAIrgtER SYSTEM (type 3515)
27al Keypad of the PROGRAMMlNG UNIT 22
2732 Working with the Programming Unit in System 7 22
27 33 Entenng a program 23
3 LITERATURE REVIEW 24
30 In troduction 24
31 A State Machine Controller for a Two-storey Elevator 25
HARDWARE AND SOFrWARE DEVELOPMENT 37
40 Introduction 37
41 Hardware development 37
4 11 Step motor circuit 38
4 12 Components 39
413 Circuit operation 39
414 Stepper motor principle 40
415 Testing the circuit 40
4 1 6 Problem Encounter 41
417 Problem Solving 41
42 Software development 42
421 Writing Assembly Language and Machine Language 42
Programs
422 Programming the stepper motor 42
viii
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
4221 First stage 43
42211 Flowchart 44
42212 Assembly language 45
422 2 Second stage 47
4223 Third s tage 47
42231 Flowchart 47
4223 2 Assembly language 48
4224 Fourth stage 50
42241 Flowchart 51
42242 Assembly language 51
I) FINAL ASSEMBLY 53
50 Introduction 53
51 Overview ofthe overall elevator operation 53
511 First possibility 54
512 Second possibility 54
5 13 Third possibility 55
5 14 Fourth possibility 55
515 Fifth possibility 55
52 Flowchart 56
53 Assembly Ian age 64
54 ~acbine language 71
55 Testing the program 71
56 Block Diagram 71
ix
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
- ---- - ---- -----
6 CONCLUSION
60
61
APPENDIX A- F
BIBLIOGRAPHY
72
Recommendation 72
Condusion 73
74
86
x
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
- - ----- ---
TABLE LIST
Table Page
1 Specifications of this project 2
2 Address for PIA functions 15
XI
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
Figure
1
2
3
4
5
6
7
8
9
10
11
12
13
FIGURE LIST
8085A Microprocessor chip
8085A CPU functiona l block diagram
The 8085A microprocessor pin configuration
PIA 8155 Pin Configuration
A command register structure
A pmgram for using 8155
Microprocessor 8085A Trainer
Keypad
Cutaway view showing controls buttons and
sensors
Block diagram of controller
Firs t state diagram for elevator controller
Circuits used to debounce and latch the
UPORCALL2 DNORCALLl and OPEN s ignals
for the elevator controller
(a) Circuit for debouncing elevator position
signal ARRIVE2 (b) and (c) Circuits for
producing door position signals DOOROPEN1
XJ l
Page
8
11
13
14
15
16
17
22
25
26
27
30
31
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
-------------- --
and DOOROPEN2
14 Second version of state diagram
controller showing condition which
transition
15 Final versIOn of state diagram
controller
for elevator 33
cause state
for e levator 35
16 Block diagram of complete elevator controller 36
showing output Decoder signals
17 Stepper motor circuit 38
18 Assembly language for rotation 1 revolution in 46
counter clockwise
19 A program for rotation in counter clockwise and 49
follow by clockwise
20 A program using input key to activate motor 52
21 A complete Assembly la nguage for this project 70
22 Complete block diagram for elevator sys tem 71
X III
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
-- - --- -- - - -
ALE
ALU
CE
CMOS
CPU
DIP
DRAiV1
EPROM
10
IC
LED
MPU
NMOS
PAL
PIA
RAM
ROM
SID
SOD
SRAM
ABBREVIATIONS
Address latch enable
Arithmetic logic uni t
Chip enable
Complementary metal oxide semiconductor
Central Processing Unit
Dual In-Line package
Dynamic random-access memory
Erasable programmable read only memory
Llp ut Output
Integrated Circuit
Light emitting diode
Microprocessor processing Unit
Non-complementary metal oide semiconductor
Programmable array logic
Peripheral Interface Adapter
Random-access Memory
Read-only memory
Seli al input data
Serial outp u l da ta
Static random- ceess memory
XIV
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
FLOWCHART LIST
Flowchnrl Page
1 Rotation 1 revolution in counter clockwise 44
2 Rotation in counter clockwise and fo llow by 47
clockwise
3 Stepper motor rotate to left when a key 51
pressed
4 Main flowchart 56
4a Elevator moves down with condition 57
4b Elevator moves down 58
4c E levator moves up with colldcon 59
4d Elevator moves up 60
4e Open and Close door 6]
4f Steps delay 62
4g Delay after door opened 63
xv
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
APPENDIX LIST
Appendi Page
A 8085A functional pin definitions 74
B StructUIf) of memory area 0000l6 FFFFI6 80
C Structure of port address OOlBFF 81
D Technical Data of the Stepper motor P3I0 82
E List of commands 83
F Truth table for AND and OR gate 85
xvi
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
CHAPTER 1
INTRODUCTION
10 Introduction
Functions of the computer from day to day become important a nd useful
because of the ability to do certain task that difficult to be done by human being
However behind of the computer powerfulness it is always related to the
microprocessor that its used
From the history the microprocessors were through a great evolution
sinoe the used of VLSI (Very Large Scale Integrated) chip Cannot be denied
that a semiconductor industry also helps the computer indust ry to gro-y th
Today the microprocessor is widely used in other applications Without
our realizing which many things or systems we used or we have seen were
controlled by a microprocessor Some of the things which use a microprocessor
as the controller are like calculators movable display boards automatic airshy
condition washing machine mobile phone elevators and others
Although microprocessor can do a task that sometime cannot be done by
ordinary human beings such as calculating arithmetic problems very fast do a
repetitive works constantly and accurate in long time period and so on but it
can be very useless if this chip is not connected to other devices All type
microprocessor need software instruction in order to perform certain fu nctions
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
11 Overview of the project
111 O pe ration
After we have made a consideration that there are sufficie nt facilities
are provided for making this project then we decided to build one project base
on microprocessor application that is 8085A microprocessor controller for a 2
storey elevator
This project was designed so that it will behave as a norma l elevator
opera tion Table 1 describes the specifications of this project
Processor 8085A
Voltage supply 5VDC
Input port Programming Uni ts Keypa d
Keypads assign
GO key assigned for second level button
BS key assigned for fIrst level button
Output port PIA 8155
Language Assembly language for 8085A
External circuits L Seven segment display
2 Circuit for elevator motor controller
3 Circuit for door motor controller
P rototype size High 40 em
Length 25 em
Wide 3cm
Table I SpeclficatlOIls of thlS project
2
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
Initially the elevator will addressed at the fITst level aftel the program
run with the door closed and number 1 displayed at the seven segment display
to show that the elevator is at the first floor
The elevator will start function if the two but tons either at the first floor
or second floor pressed If the elevator is located a t which the key is pressed (i e
elevator at second level button at second level pressed) the elevator will move
to the next level just after the door operation completed Wh en the elevator
arrived at which level the door will open and close
If the elevator is not located at which the key pressed (i e elevator at
second level button at fIrst level pressed) firstly the elevator will move to the
level at which the button pressed b Zore it move back to the next level after
completing door operation The door will operate every time when the elevator
completely arr ives at the destination level
The seven segments always dis)~y 8 location of the elevator Je
transition of the level indication starts when the elevator nea rly rrrives ~Le
destina tion level
Inside the elevator there are no button and seven8(~gment dilay We
can say that the user only has to press one key to go to the next level
The primary different between this elevator and t he normal elevator is
the motor In here we use s tepper motor to open and close the door and to carry
up a nd down the elevator Actually for two storeys elevator must have three
motor one for second level door operation one for fixst level door operation and
one for moving t he elevator But for our project we just use two motors One for
moving the elevator and one motor use for represent two doors operation The
circuit operations fo r the door either at second or fi rst floor are same The
3
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
------ -
different only in a timing to open and close the door for first level and second
leveL
At the end of our project we build an elevator prototype so that we can
really see how this project works The prototype was build by using polystyrene
12 O bjectives of the thesis
The 8085A Microprocessor Controller for a 2 Storey Elevator is the
project for that are implemented for several objective from studies of Electronics
and Telecommunications Engineering course The objectives of this project are
bull Understand a basic of microprocessor-based system and manipulate in to a
real situation
bull Converted the knowledge and understanding from microprocessor Motorola
6809 into Intel 8085A
bull Relate the knowledge in electricll electronics and computer based system
where the application involves some kind ofinputJoutput devices
bull Implementation of assembly language in the designing of rea) devices
bull Combined the digita l electronics theory with the hardware and software
requirements needed to interface with the outside via the most commonly
used microprocessor support integrated CilCuit ie 8155 chip
bull Develop a solution to a complete application of a microprocessor-based
system for performing a special task in which is both practical and visua lly
stimulating
bull An alysing testing troubleshooting and designing microprocessor-based
system
4
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5
Note
This project is developed by two person that means this is the combination
project where I do a certain part of the designing and the other part will be
doing by my partner Wan Mobd Soli Wan Saljm and we came out with one
final project
5