Professional Documents
Culture Documents
Submitted By: Name Harshit Jain Roll No. 2233 Enrollment No. SGUV081020440
Electronics & Communication Dept.
Gyan-Vihar University
This is to certify that the project entitled, Metro-Train Proto-Type, which is being submitted herewith for the award of B.Tech., is the result of the work completed by Mr. Harshit Jain (VII Semester) from Suresh Gyan-Vihar University at Dynamica India under the supervision of the project manager Mr. Manoj Kumar and the same has not been submitted elsewhere for the award of any degree. Date: Place: Jaipur
Page | 2
Gyan-Vihar University
List of Contents
Preface Acknowledgement
1. Profile of Company 1.1 About Dynamica 1.2 Dynamica Philosophy 1.3 Company Training Partner - Ducat India 1.4 Services 1.5 Solutions 2. Embedded System 2.1 Embedded System 2.2 Variety of Embedded System 2.3 User Interface 3. Microcontroller 3.1 Introduction 3.2 Definition of a Microcontroller 3.3 Pin Configuration 3.4 Reset Circuit
Page | 3
1 2 3 3 4 4 4 5 6 7 7 8 9 9 9 11 13
Electronics & Communication Dept.
Gyan-Vihar University
3.5 Ram Architecture 3.6 Microcontrollers v/s Microprocessors 3.7 Central Processing Unit 3.8 Bus 3.9 Input Output Unit 3.10 Serial Communication 3.11 Timer Unit 4. LCD Interfacing 4.1 Pin description 4.2 DDRAM - Display Data RAM 4.3 BF - Busy Flag 4.4 Instruction Register (IR) and Data Register (DR) 4.5 Commands and Instruction set 4.6 Sending Commands to LCD 5. DC Motor Interfacing 5.1 Push-pull four channel driver 5.2 Block Diagram 5.3 Features 6. Keyboard Interfacing
Page | 4
14 18 18 19 20 20 22 24 24 25 25 25 25 26 27 27 27 28 29
Electronics & Communication Dept.
Gyan-Vihar University
6.1nterfacing the key board with 8051 6.2 Scanning & Identifying the Key 6.3 Grounding Rows & Reading the Columns 7. Project Description 7.1 Introduction of Project 7.2 Circuit Diagram of Metro Train Prototype 7.3 Project Methodology 7.4 Procedure 7.5 General Working 8. Future Scope 9. References and Bibliography 10. Appendix: List of diagrams 11. Coding
29 29 30 32 32 33 34 35 35 36 37 38 39
Page | 5
Gyan-Vihar University
Preface
This training report is all about the embedded systems and its application in various fields of real world. We are living in the Embedded World. We are surrounded with many embedded products and our daily life largely depends on the proper functioning of these gadgets. Television, Radio, CD player, Washing Machine or Microwave Oven in our kitchen, Card readers, Access Controllers, Palm devices of our work space enable us to do many of our tasks very effectively. Apart from all these, many controllers embedded in our car take care of car operations between the bumpers. All kinds of magazines and journals regularly dish out details about latest technologies, new devices; fast applications which make us believe that our basic survival is controlled by these embedded products. Now we can agree to the fact that these embedded products have successfully invaded into our world. What is this Embedded System? Theoretically, an embedded controller is a combination of piece of microprocessor based hardware and the suitable software to undertake a specific task. I have made a Project based on Microcontroller that is a Prototype of Metro Train. This training report covers all about introduction to Embedded System, the microcontroller 8051 and project description. In this project I have implemented the Prototype of Metro Train that is describing a small application of microcontroller.
Page | 6
Gyan-Vihar University
Acknowledgement
I would like to express my sincere gratitude to DYNAMICA INDIA for giving me an opportunity to undergo my Industrial Training for six weeks (45 days) as well as DUCAT for providing me the knowledge of Embedded System. I would also like to thank to all the technical experts, engineers and executives for explaining practical aspects of the theoretical knowledge. My greatest debt in creating this project goes to the technical experts Miss Priyanka Priyadarshani and Mr. Manoj Kumar. I am deeply indebted to my HOD Mr. Rashid Hussain Sir whose help, stimulating suggestions and encouragements was always with me. Thank you to Sir for encouraging me every step of the way.
Page | 7
Gyan-Vihar University
Gyan-Vihar University
1.4) Services
At DYNAMICA, we offer you a myriad of services. Whatever be your requirement, we have a solution for you. You could be an IT company or a non-IT company; a large business house with a number of group companies or a small and medium scale enterprise (SME), we can cater to all your IT requirements. Through our services we help you to implement enterprise-wide technology advances that enhance your core processes. We aim to provide solutions to your business and technology needs in a manner that it adds value to your enterprise as well as adheres to a fixed-price and fixed-time frame. DYNAMICA brings together strategic and technological expertise, a flexible and costeffective global delivery model and rich domain experience to provide solutions that fit your needs.
Page | 9
Gyan-Vihar University
1.5) Solutions
What makes us the obvious choice as a information technology outsourcing consultant and provider, apart from our evident knowledge, expertise and sheer devotion to our work, is the fact that our solutions go beyond being a mere means to an end. We believe that any solution will be effective only when it perfectly complements existing business strategies, practices, structures and vision. Each project is unique in its requirements and our approach subsequently differs.
Page | 10
Gyan-Vihar University
2) Embedded System
One of the first recognizably modern embedded systems was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo project as it employed the then newly developed monolithic integrated circuits to reduce the size and weight. An early mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman missile, released in 1961. It was built from transistor logic and had a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits. This program alone reduced prices on quad nand gate ICs from $1000/each to $3/each, permitting their use in commercial products. Since these early applications in the 1960s, embedded systems have come down in price and there has been a dramatic rise in processing power and functionality. The first microprocessor for example, the Intel 4004, was designed for calculators and other small systems but still required many external memory and support chips. In 1978 National Engineering Manufacturers Association released a "standard" for programmable microcontrollers, including almost any computer-based controllers, such as single board computers, numerical, and event-based controllers. As the cost of microprocessors and microcontrollers fell it became feasible to replace expensive knob-based analog components such as potentiometers and variable capacitors with up/down buttons or knobs read out by a microprocessor even in some consumer products. By the mid-1980s, most of the common previously external system components had been integrated into the same chip as the processor and this modern form of the microcontroller allowed an even more widespread use. The integration of microcontrollers has further increased the applications for which embedded systems are used into areas where traditionally a computer would not have been considered. A general purpose and comparatively low-cost microcontroller may often be programmed to fulfill the same role as a large number of separate components. Although in this context an embedded system is usually more complex than a traditional solution, most of the complexity is contained within the microcontroller itself. Very few additional components may be needed and most of the design effort is in the software. The intangible nature of software makes it much easier to prototype and test new revisions compared with the design and construction of a new circuit not using an embedded processor.
Page | 11
Gyan-Vihar University
Page | 12
Gyan-Vihar University
Automobiles, electric vehicles, and hybrid vehicles are increasingly using embedded systems to maximize efficiency and reduce pollution. Other automotive safety systems include anti-lock braking system (ABS), Electronic Stability Control (ESC/ESP), traction control (TCS) and automatic four-wheel drive. Medical equipment is continuing to advance with more embedded systems for vital signs monitoring, electronic stethoscopes for amplifying sounds, and various medical imaging (PET, SPECT, CT, MRI) for non-invasive internal inspections. Embedded systems are especially suited for use in transportation, fire safety, safety and security, medical applications and life critical systems as these systems can be isolated from hacking and thus be more reliable. For fire safety, the systems can be designed to be have greater ability to handle higher temperatures and continue to operate. In dealing with security, the embedded systems can be self sufficient and be able to deal with cut electrical and communication systems.
Page | 13
Gyan-Vihar University
3) MICROCONTROLLERS
3.1 Introduction
Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about.
Page | 14
Gyan-Vihar University
A Timer module to allow the microcontroller to perform tasks for certain time periods. A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller. An ADC to allow the microcontroller to accept analogue input data for processing.
Figure 3.1: Showing a typical microcontroller device and its different subunits
Page | 15
Gyan-Vihar University
Vcc
P1 P0
RESET RXD TXD INT0 INT1 T0 T1 RD WR XTAL1 XTAL2 GND P2 EA PSEN ALE
P3
Page | 16
Gyan-Vihar University
We have 4 ports in 8051 micro controller. They are port0, port1, port2, port3 which can be accessed as i/o ports. The pins of the micro controller are explained below.
Reset: It resets total 8051 micro controller. RXD: TXD: INT0: INT1: T0: T1: RD: WR: It receives data in serial communication. It transmits data in serial communication. External interrupt for timer 0. External interrupt for timer1 Timer0. Timer1. To read into external memory. To write into external memory.
XTAL1 & XTAL2: To connect the crystal oscillator. ALE: Address latch enable which is used to access the address locations from external memory. PSEN: memory. EA: External Access: 64 KB of ROM is the limit for external memory. Program store enable which is used for storing programming code into the external
Page | 17
Gyan-Vihar University
Capacitor is storing charge permanently until we use it. Crystal Oscillator is used to generate a carrier signal with stable frequency. With the help of this oscillator we will deduce the execution speed in terms of bytes/ sec.It generates 12 clock pulses /machine cycle. Capacitors provide charge for crystal oscillator. If we are not connecting any external memory to micro
Kl,kljljljlkjlk
Page | 18
Gyan-Vihar University
The 8051 has a bank of 128 bytes of Internal RAM. This Internal RAM is found on-chip on the 8051 so it is the fastest RAM available, and it is also the most flexible in terms of reading, writing, and modifying its contents. Internal RAM is volatile, so when the 8051 is reset this memory is cleared. The 128 bytes of internal ram is subdivided as shown on the memory map. The first 8 bytes (00h - 07h) are "register bank 0". These alternative register banks are located in internal RAM in addresses 08h through 1Fh.Bit memory actually resides in internal RAM, from addresses 20h through 2Fh. The 80 bytes remaining of Internal RAM, from addresses 30h
Page | 19
Gyan-Vihar University
through 7Fh, may be used by user variables that need to be accessed frequently or at high-speed. This area is also utilized by the microcontroller as a storage area for the operating stack.
Register Banks
The 8051 uses 8 "R" registers which are used in many of its instructions. These "R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7).These registers are generally used to assist in manipulating values and moving data from one memory location to another. The concept of register banks adds a great level of flexibility to the 8051.
Bit Memory
The 8051, being a communication oriented microcontroller, gives the user the ability to access a number of bit variables. These variables may be either 1 or 0. There are 128 bit variables available to the user, numbered 00h through 7Fh. The user may make use of these variables with commands such as SETB and CLR. It is important to note that Bit Memory is really a part of Internal RAM. In fact, the 128 bit variables occupy the 16 bytes of Internal RAM from 20h through 2Fh.
Page | 20
Gyan-Vihar University
Registers
The Accumulator The Accumulator, as its name suggests, is used as a general register to accumulate the results of a large number of instructions. It can hold an 8-bit (1-byte) value and is the most versatile register.
The "R" registers The "R" registers are a set of eight registers that are named R0, R1, etc. up to and including R7. These registers are used as auxiliary registers in many operations. The "B" Register The "B" register is very similar to the Accumulator in the sense that it may hold an 8-bit (1-byte) value. The "B" register is only used by two 8051 instructions: MUL AB and DIV AB. The Data Pointer (DPTR) The Data Pointer (DPTR) is the 8051s only user-accessible 16-bit (2-byte) register. The Accumulator, "R" registers, and "B" register are all 1-byte values. DPTR, as the name suggests, is used to point to data. It is used by a number of commands which allow the 8051 to access external memory. The Program Counter (PC) The Program Counter (PC) is a 2-byte address which tells the 8051 where the next instruction to execute is found in memory. When the 8051 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. The Stack Pointer (SP) The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-byte) value. The Stack Pointer is used to indicate where the next value to be removed from the stack should be.
Page | 21
Gyan-Vihar University
Addressing Modes
An "addressing mode" refers to how you are addressing a given memory location. The addressing modes are as follows, With an example of each: Immediate Addressing MOV A, #20h Direct Addressing MOV A, #30h Indirect Addressing MOV A, @R0 External Direct MOVX A, @DPTR Code Indirect MOVC A, @A+DPTR Each of these addressing modes provides important flexibility.
Interrupts
An interrupt is a special feature which allows the 8051 to provide the illusion of "multitasking," although in reality the 8051 is only doing one thing at a time. .
Timers
Timers are one of the categories of hardware time delays. Time delays are used to keep a system into halting System or sleepy mode. We have two timers- timer0, timer1.Hardware time delays are used to generate exact time delays.
Page | 22
Gyan-Vihar University
Registers are therefore memory locations whose role is to help with performing various mathematical operations or any other operations with data wherever data can be found. Look at the current situation. We have two independent entities (memory and CPU) which are interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for example, we wish to add the contents of two memory locations and return the result again back to memory, we would need a connection between memory and CPU. Simply stated, we must have some "way" through data goes from one block to another.
Page | 23
Gyan-Vihar University
3.8 Bus
That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller.
Figure3.6: Showing connection between memory and central unit using buses
As far as functionality, the situation has improved, but a new problem has also appeared: we have a unit that's capable of working by itself, but which does not have any contact with the outside world, or with us! In order to remove this deficiency, let's add a block which contains several memory locations whose one end is connected to the data bus, and the other has connection with the output lines on the microcontroller which can be seen as pins on the electronic component.
Page | 24
Gyan-Vihar University
When working with it the port acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller.
Gyan-Vihar University
until transfer begins. Once the transfer starts, we lower the transmission line to logical "0" for a period of time (which we will designate as T), so the receiving side will know that it is receiving data, and so it will activate its mechanism for reception. Let's go back now to the transmission side and start putting logic zeros and ones onto the transmitter line in the order from a bit of the lowest value to a bit of the highest value. Let each bit stay on line for a time period which is equal to T, and in the end, or after the 8th bit, let us bring the logical unit "1" back on the line which will mark the end of the transmission of one data. The protocol we've just described is called in professional literature NRZ (Non-Return to Zero).
As we have separate lines for receiving and sending, it is possible to receive and send data (info.) at the same time. So called full-duplex mode block which enables this way of communication is called a serial communication block. Unlike the parallel transmission, data moves here bit by bit, or in a series of bits what defines the term serial communication comes from. After the reception of data we need to read it from the receiving location and store it in memory as opposed to sending where the process is reversed. Data goes from memory through the bus to the sending location, and then to the receiving unit according to the protocol.
Page | 26
Gyan-Vihar University
However, in order to utilize it in industry we need a few additionally blocks. One of those is the timer block which is significant to us because it can give us information about time, duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the basis of their difference we can determine how much time has elapsed. This is a very important part of the microcontroller whose understanding requires most of our time.
Page | 27
Gyan-Vihar University
For a real application, a microcontroller alone is not enough. Beside a microcontroller, we need a program that would be executed, and a few more elements which make up interface logic towards the elements of regulation (which will be discussed next).
Page | 28
Gyan-Vihar University
4) LCD INTERFACING
4.1 Pin Configuration
GND
Vcc
16
15 4
80 C0
81 C1
82 83 C2 C 3 H ->A
84 C4
85 C5
86 C6
87 C7
88 C8
89 C9
8A CA
8B CB
8C CC
8D CD
8E CE
8F CF 5
10
11
12
13
14
Gyan-Vihar University
LCD stands for Liquid Crystal Display. The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters.
Page | 30
Gyan-Vihar University
Page | 31
Gyan-Vihar University
5) DC MOTOR INTERFACING
In this project the d.c motor interfacing consists of two motors .One motor is used to open & close the car door and the other is used to move the car forward. This interfacing is shown in fig. This uses L293D IC interfacing.
Page | 32
Gyan-Vihar University
5.3 FEATURES:
Output Current 1A Per Channel (600mA for L293D) Peak Output Current 2A Per Channel (1.2A for L293D) Inhibit Facility High Noise Immunity Separate Logic Supply Over-Temperature Protection
Page | 33
Gyan-Vihar University
6) Keyboard Interfacing
6.1 Interfacing the Keyboard to the 8051
At the lowest level, keyboards are organized in a matrix of row and columns. The CPU accesses both rows and column through ports; therefore, with two 8-bit ports, an 8*8 matrix of key can be connected to a microprocessor .When a key pressed, a row and column make a connect; otherwise there is no connection between row and column .In IBM PC keyboard, a single microcontroller (consisting of microprocessor, RAM and EPRROM and several ports all on a single chip) take care of software and hardware interfacing of keyboard. In such a system it is the function of programs stored in the EPROM of microcontroller to scan the keys continuously, identity which one has been activated, and present it to the motherboard. In this section we look at the mechanism by which the 8051 scans and identify the key.
Page | 34
Gyan-Vihar University
The rows are connected to an output port and the columns are connected to an input port and the columns are connected to an input port. If no key has been pressed, reading the input ports will yield 1s for all column since they are all connected to high (Vcc) If all the rows are grounded and a key pressed, one of the column will have 0 since the key pressed provides the path to ground. It is the function of the microcontroller to scan the keyboard continuously to detect and identify the key pressed.
Page | 35
Gyan-Vihar University
3. To detect which row the key press belongs to, it grounds one row at a time, reading the columns each time. If it finds that all columns are high, this means that the key press cannot belong to that row; therefore, it grounds the next row and continues until it finds the row the key press belongs to. Upon finding the row that the key press belongs to, it sets up the starting address for the look-up table holding the scan codes (or the ASCII value) for that row and goes to the next stage to identify the key. 4. To identify the key press, it rotates the column bits, one bit at a time, into the carry flag and checks to see if it is low. Upon finding the zero, it pulls out the ASCII code for that key from the look-up table; Otherwise, it increments the pointer to point to the next element of the look-up table.
While the key press detection is standard for all keyboards, the process for determining which key is pressed varies. The look-up table method shown in program can be modified to work with any matrix up to 8*8.
Page | 36
Gyan-Vihar University
7) Description of Project
7.1 Introduction
The Need
Delhi, the National Capital with a population of about 12 million is, perhaps, the only city of its size in the world, which depends almost entirely on buses on it sole mode of mass transport.bus services are inadequate and heavily over-crowded.. The result of extreme congestion on the road, ever slowing speeds, increasing accident rate, fuel wastage and environmental pollution. Delhi has now become the fourth most city in the world, with automobiles contributing more than two thirds of the total atmospheric pollution. Pollution related health problems are reaching disconcerting levels. Immediate steps are, therefore, needed to improve both the quality and availability of mass transport service. This is possible only if a rail-based mass transit system, which is nonpolluting, is introduced in the city without further delay.
Page | 37
Gyan-Vihar University
Page | 38
Gyan-Vihar University
Quantity
1 1
Page | 39
Gyan-Vihar University
Step 1: Circuit diagram of the proposed system is designed and finalized.(Refer to Figure 6.1 ) Step 2: All the components and software platform to be used are selected which are also mentioned above. Step 3: All the hardware components are soldered on their respective printed circuit boards with the help of soldering ion, solder and flux according to the hardware schematic shown in the Figure Step 4: Code/program of the proposed system is developed using assembly language with the help of software platform (Keil u vision3).The coding could be seen in section Step 5: The hex code of the program being created by the software platform is burnt into the flash code memory of our microcontroller IC 89C51. Step 6: Testing is done at various levels to finalize the appropriate program for the most proper working of the system
Page | 40
Gyan-Vihar University
8) FUTURE SCOPE
Stainless steel exteriors instead of an aluminium car body. Thinner, stronger stainless steel seats that offer more leg room. Each car would have 64 cloth-padded, taller seats with seat-back grab handles. A total end to carpeting. Floors would be rubberized. Interactive maps on LCD screens that would also likely display advertisements Automated station announcements. So no more "Judishuwary Square". Security cameras on all rail cars.
The 7000 series won't be ready for service for at least five years. The latest models are in the 6000 series, which were introduced last year.
Page | 41
Gyan-Vihar University
NET LINKS:
1. www.8051projects.net 2. www.atmel.com 3. www.electronicsforyou.com 4. www.encyclopedia.com 5. www.wikipedia.com
Page | 42
Gyan-Vihar University
10) Appendix
List of Essential Diagrams: 1. Figure 3.1: showing a typical microcontroller device and its different subunits 2. Figure 3.2: Pin configuration of Microcontroller 3. Figure 3.3: Reset circuit of Microcontroller 4. Figure 3.4: Ram Architecture 5. Figure 3.5: Simplified central processing unit with three register 6. Figure 3.6: Showing connection between memory and central unit using buses 7. Figure 3.7: Simplified input-output unit communicating with external world 8. Figure 3.8: Serial unit sending data through three lines 9. Figure 3.9: Timer unit generating signals in regular time intervals 10 .Figure 3.10 : Physical configuration of the interior of A Microcontroller 11 .Figure 3.11: Microcontroller outline with basic elements And internal connections 12 .Figure 4.1: 16x2 LCD pin configuration 13 .Figure 5.1: Block diagram of load driver L293D 14 .Figure 6.1: 4*4 Matrix keyboard 15 .Figure 7.1: Circuit diagram of Metro train prototype
10 11 13 14 18
19 20 21 22 22 23 24 27 29 33
Page | 43
Gyan-Vihar University
Page | 44
Gyan-Vihar University
acall display acall train station2: acall initialise1 acall next acall initialise2 mov dptr,#229h ;noida sec-16 mov r7,#12 acall display acall train station3: acall initialise1 acall next acall initialise2 mov dptr,#243h ;new ashok nagar mov r7,#15 acall display acall train station4: acall initialise1 acall next acall initialise2 mov dptr,#260h ;mayur vihar ext. mov r7,#16 acall display acall train staion5: acall initialise1
Page | 45 Electronics & Communication Dept.
Gyan-Vihar University
acall next acall initialise2 mov dptr,#289h ;akshardham mov r7,#10 acall display acall train station6: acall initialise1 acall next acall initialise2 mov dptr,#300h ;rajiv chowk mov r7,#11 acall display acall train ljmp last delay: mov r1,#225 l0: mov r2,#223 l2: djnz r2,l2 djnz r1,l0 ret next: mov dptr,#215h ;next station mov r7,#12 acall display ret
Page | 46 Electronics & Communication Dept.
Gyan-Vihar University
train: mov dptr,#275h mov r7,#9 acall initialise1 acall display clr p3.4;door n train working clr p3.5 clr p3.6 clr p3.7 mov p1,#0fh acall delay_1sec acall delay_1sec acall delay_1sec mov dptr,#315h mov r7,#10 acall initialise1 acall display setb p3.7 setb p3.4 setb p3.5 setb p3.6 acall delay_1sec mov p2,#05h acall delay_1sec
Page | 47
Gyan-Vihar University
acall delay_1sec acall delay_1sec acall delay_1sec acall delay_1sec mov p2,#00h acall delay_1sec acall delay_1sec ret initialise1: mov lcdport,#38h ;initiate the lcd in5*7 matrix acall cmd acall delay mov lcdport,#01h ;clear the display acall cmd acall delay mov lcdport,#0eh ;cursor blinking acall cmd acall delay mov lcdport,#80h ;cursor at fst line fst postn acall cmd acall delay ret initialise2: mov lcdport,#38h acall cmd
Page | 48 Electronics & Communication Dept.
Gyan-Vihar University
acall delay mov lcdport,#0eh acall cmd acall delay mov lcdport,#0c0h acall cmd acall delay ret display: clr a movc a,@a+dptr mov lcdport,a acall read inc dptr djnz r7,display ret cmd: clr rs setb en acall delay clr en ret read:
Page | 49
Gyan-Vihar University
setb rs setb en acall delay clr en ret delay_1sec: mov r5,#14 mov tmod,#10h rpt: mov th1,#00h mov tl1,#00h clr tf1 setb tr1 chk: jnb tf1,chk clr tr1 clr tf1 djnz r5,rpt ret org 183h db 'noida sec-15' org 197h db 'current station' org 215h db 'next station' org 229h
Page | 50 Electronics & Communication Dept.
Gyan-Vihar University
db 'noida sec-16' org 243h db 'new ashok nagar' org 260h db 'mayur vihar ext.' org 275h db 'door open' org 289h db 'akshardham' org 300h db 'rajiv chowk' org 315h db 'door close' org 330h db 'welcome to metro' last: end
Page | 51