trainning report by- harshit

Upload: harshit-jain

Post on 07-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Trainning Report by- Harshit

    1/51

    Gyan-Vihar University

    Page | 1 Electronics & Communication Dept.

    Summer Training ReportOn

    Embedded System & Microcontroller-88005511(Submitted to SURESH GYAN VIHAR UNIVERSITY in fulfillment of requirement of

    degree of Bachelor of TechnologyIn

    Electronics & Communication Engineering)Session (2008-12)

    Submitted To: Submitted By:Mr. Rashid Hussain Name Harshit JainHead of Department Roll No. 22223333

    Electronics & Communication Enrollment No. SGUV081020440

  • 8/4/2019 Trainning Report by- Harshit

    2/51

  • 8/4/2019 Trainning Report by- Harshit

    3/51

    Gyan-Vihar University

    Page | 3 Electronics & Communication Dept.

    List of ContentsPreface 1

    Acknowledgement 2

    1. Profile of Company 3

    1.1 About Dynamica 3

    1.2 Dynamica Philosophy 4

    1.3 Company Training Partner - Ducat India 4

    1.4 Services 4

    1.5 Solutions 5

    2. Embedded System 6

    2.1 Embedded System 7

    2.2 Variety of Embedded System 7

    2.3 User Interface 8

    3. Microcontroller 9

    3.1 Introduction 9

    3.2 Definition of a Microcontroller 9

    3.3 Pin Configuration 11

    3.4 Reset Circuit 13

  • 8/4/2019 Trainning Report by- Harshit

    4/51

    Gyan-Vihar University

    Page | 4 Electronics & Communication Dept.

    3.5 Ram Architecture 14

    3.6 Microcontrollers v/s Microprocessors 18

    3.7 Central Processing Unit 18

    3.8 Bus 19

    3.9 Input Output Unit 20

    3.10 Serial Communication 20

    3.11 Timer Unit 22

    4. LCD Interfacing 24

    4.1 Pin description 24

    4.2 DDRAM- Display Data RAM 25

    4.3 BF - Busy Flag 25

    4.4 Instruction Register (IR) and Data Register (DR) 25

    4.5 Commands and Instruction set 25

    4.6 Sending Commands to LCD 26

    5. DC Motor Interfacing 27

    5.1 Push-pull four channel driver 27

    5.2 Block Diagram 27

    5.3 Features 28

    6. Keyboard Interfacing 29

  • 8/4/2019 Trainning Report by- Harshit

    5/51

    Gyan-Vihar University

    Page | 5 Electronics & Communication Dept.

    6.1nterfacing the key board with 8051 29

    6.2 Scanning & Identifying the Key 29

    6.3 Grounding Rows & Reading the Columns 30

    7. Project Description 32

    7.1 Introduction of Project 32

    7.2 Circuit Diagram of Metro Train Prototype 33

    7.3 Project Methodology 34

    7.4 Procedure 35

    7.5 General Working 35

    8. Future Scope 36

    9. References and Bibliography 37

    10. Appendix: List of diagrams 38

    11. Coding 39

  • 8/4/2019 Trainning Report by- Harshit

    6/51

    Gyan-Vihar University

    Page | 6 Electronics & Communication Dept.

    PrefaceThis training report is all about the embedded systems and its application invarious 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.

  • 8/4/2019 Trainning Report by- Harshit

    7/51

    Gyan-Vihar University

    Page | 7 Electronics & Communication Dept.

    Acknowledgement

    I would like to express my sincere gratitude to DYNAMICA INDIA forgiving 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.

  • 8/4/2019 Trainning Report by- Harshit

    8/51

    Gyan-Vihar University

    Page | 8 Electronics & Communication Dept.

    1) Profile Of The Company-DYNAMICA INDIADYNAMICA Company works on solutions in the scope of e-commerce, web site

    development, software development on multiple platforms, multimedia presentation

    design, and internet marketing. One of the most perspective directions in our company

    specialization is development of solutions for mobile commerce (m-commerce). We develop

    WAP sites and PDA compatible sites which become more and more needed year by year.

    1.1) About DYNAMICA1. "Quality Matters"

    The main direction of our companies activity is the development of high

    quality and efficient managing of web sites, convenient from user point of view, fully

    functional from administrating position, meeting all quality standards of modern IT

    industry and Internet standards in particular.

    We provide our clients with truly flexible solutions. Convenient and reliable in utilizing

    products that finally give them a real advantage compared to companies not paying

    enough attention to the quality of IT products used in their business process.

    2. "We choose the best for you"Our activity is built on the outsourcing basis, or in other words, we involve

    specialized experts who have extensive experience working with technologies which are

    planned for project implementation.

    At the moment more than 200 various specialists and developer teams from India

    are working for our company. Among them a bigger part belongs to programmers and

    web designers as well as specialists in Internet advertising and Internet marketing.

    3. "We do help!"Our clients are companies of any level interested in specialized software products

    development, increase of presence in high tech communication sectors or releasing e-

    commerce projects.

    4. "We work internationally"In spite of the fact that our main developer's center is located in Noida (INDIA)

    we offer services worldwide. Our CRM system allows us to keep in touch with our

    clients very closely.

  • 8/4/2019 Trainning Report by- Harshit

    9/51

    Gyan-Vihar University

    Page | 9 Electronics & Communication Dept.

    1.2) Dynamica Philosophy in their own wordsApply the principle "Discovering Opportunity" by letting us bring the future closer to

    you, so that when major and unexpected changes occur you are ready for them, even welcomingthem with a peaceful smile on your face.

    1.3) Company Training Partner DUCAT INDIADucat is a technology training partner, whose projects are focused on providing an

    extensible development platform and application frameworks for building software. Ducat

    provides extensible tools and frameworks that span the software development lifecycle,

    including support for modeling, language development environments for Java, .NET, ABAP/4,

    IBM Mainframe, AS/400, RTO-Linux, C/C++ and others, testing and performance, business

    intelligence, rich client applications and Embedded development.

    Resulting from the profound combination of DUCAT's training and developmentexperience, and its customer relationship processes, Ducat INDIA offers a complete tailored and

    personalized framework for supporting its existing and future customers, be it locally or globally.1.4) ServicesAt 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 businesshouse with a number of group companies or a small and medium scale enterprise (SME), we cancater to all your IT requirements.

    Through our services we help you to implement enterprise-wide technology advancesthat enhance your core processes. We aim to provide solutions to your business and technologyneeds in a manner that it adds value to your enterprise as well as adheres to a fixed-price andfixed-time frame.

    DYNAMICA brings together strategic and technological expertise, a flexible and cost-effective global delivery model and rich domain experience to provide solutions that fit yourneeds.

    We provide following services1. Application Development and Maintenance

    2. Enterprise Quality Services

    3. Packaged Application Services

    4. Product Engineering

    5. Systems Integration

  • 8/4/2019 Trainning Report by- Harshit

    10/51

    Gyan-Vihar University

    Page | 10 Electronics & Communication Dept.

    1.5) SolutionsWhat 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 thefact 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 subsequentlydiffers.

    We specialize in 3 core areas:1) Web Application development

    2) Custom Application Development

    3) Mobile Software Programming

    The other areas we cater to are:1) ERP Solutions

    2) .NET/ASP Programming

    3) Linux Programming

    4) Java Programming

    5) IBM Mainframe

    6) C++ ,C

    7) UNIX

    8) TESTING

    9)

    oracle

    10) Embedded System

  • 8/4/2019 Trainning Report by- Harshit

    11/51

    Gyan-Vihar University

    Page | 11 Electronics & Communication Dept.

    2) Embedded SystemOne 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 Apolloproject 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 diskfor 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.

    http://en.wikipedia.org/wiki/Apollo_Guidance_Computerhttp://en.wikipedia.org/wiki/Apollo_Guidance_Computerhttp://en.wikipedia.org/wiki/Charles_Stark_Draperhttp://en.wikipedia.org/wiki/Minuteman_%28missile%29http://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Digital_circuithttp://en.wikipedia.org/wiki/Hard_diskhttp://en.wikipedia.org/wiki/Sheffer_stroke#NAND_gatehttp://en.wikipedia.org/wiki/Microprocessorhttp://en.wikipedia.org/wiki/Intel_4004http://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Analog_electronicshttp://en.wikipedia.org/wiki/Potentiometerhttp://en.wikipedia.org/wiki/Variable_capacitorhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Variable_capacitorhttp://en.wikipedia.org/wiki/Potentiometerhttp://en.wikipedia.org/wiki/Analog_electronicshttp://en.wikipedia.org/wiki/Calculatorhttp://en.wikipedia.org/wiki/Intel_4004http://en.wikipedia.org/wiki/Microprocessorhttp://en.wikipedia.org/wiki/Sheffer_stroke#NAND_gatehttp://en.wikipedia.org/wiki/Hard_diskhttp://en.wikipedia.org/wiki/Digital_circuithttp://en.wikipedia.org/wiki/Transistorhttp://en.wikipedia.org/wiki/Minuteman_%28missile%29http://en.wikipedia.org/wiki/Charles_Stark_Draperhttp://en.wikipedia.org/wiki/Apollo_Guidance_Computerhttp://en.wikipedia.org/wiki/Apollo_Guidance_Computer
  • 8/4/2019 Trainning Report by- Harshit

    12/51

    Gyan-Vihar University

    Page | 12 Electronics & Communication Dept.

    22..11))Embedded SystemAn embedded system is a computer system designed to do one or a few dedicated and/or

    specific functions often with real-time computing constraints. It is embedded as part of acomplete device often including hardware and mechanical parts. By contrast, a general-purposecomputer, such as a personal computer (PC), is designed to be flexible and to meet a wide rangeof end-user needs. Embedded systems control many devices in common use today.

    Embedded systems are controlled by one or more main processing cores that are typicallyeither microcontrollers or digital signal processors(DSP).The key characteristic, however, isbeing dedicated to handle a particular task.

    Since the embedded system is dedicated to specific tasks, design engineers can optimizeit to reduce the size and cost of the product and increase the reliability and performance. Someembedded systems are mass-produced, benefiting from economies of scale.

    Physically, embedded systems range from portable devices such as digitalwatches and MP3 players, to large stationary installations like traffic lights, factory controllers,

    or the systems controlling nuclear power plants. Complexity varies from low, with asingle microcontroller chip, to very high with multiple units, peripherals and networks mountedinside a large chassis or enclosure.

    2.2) Variety of Embedded SystemEmbedded systems span all aspects of modern life and there are many examples of their

    use.

    Telecommunications systems employ numerous embedded systems from telephone

    switches for the network to mobile phones at the end-user. Computer networking usesdedicated routers and network bridges to route data.

    Consumer electronics include personal digital assistants (PDAs), mp3 players, mobile

    phones, videogame consoles, digital cameras, DVD players,GPS receivers, and printers. Many

    household appliances, such as microwave ovens, washing machines and dishwashers, are

    including embedded systems to provide flexibility, efficiency and features.

    Advanced HVAC systems use networked thermostats to more accurately and efficiently control

    temperature that can change by time of day and season. Home automation uses wired- and

    wireless-networking that can be used to control lights, climate, security, audio/visual,surveillance, etc., all of which use embedded devices for sensing and controlling.

    Transportation systems from flight to automobiles increasingly use embedded systems.

    New airplanes contain advanced avionics such as inertial guidance systems and GPS receivers

    that also have considerable safety requirements. Various electric motors brushless DC

    motors, induction motors and DC motors are using electric/electronic motor controllers.

    http://en.wikipedia.org/wiki/Computer_systemhttp://en.wikipedia.org/wiki/Function_%28mathematics%29http://en.wikipedia.org/wiki/Real-time_computinghttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Digital_signal_processorhttp://en.wikipedia.org/wiki/Economies_of_scalehttp://en.wikipedia.org/wiki/Economies_of_scalehttp://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Digital_audio_playerhttp://en.wikipedia.org/wiki/Traffic_lighthttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Nuclear_power_planthttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Chassishttp://en.wikipedia.org/wiki/Telephone_switchhttp://en.wikipedia.org/wiki/Telephone_switchhttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/Routerhttp://en.wikipedia.org/wiki/Network_bridgehttp://en.wikipedia.org/wiki/Consumer_electronicshttp://en.wikipedia.org/wiki/Personal_digital_assistanthttp://en.wikipedia.org/wiki/Mp3_playerhttp://en.wikipedia.org/wiki/Videogame_consolehttp://en.wikipedia.org/wiki/Digital_camerahttp://en.wikipedia.org/wiki/DVD_playerhttp://en.wikipedia.org/wiki/Global_Positioning_Systemhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Microwave_ovenhttp://en.wikipedia.org/wiki/Washing_machinehttp://en.wikipedia.org/wiki/Dishwashershttp://en.wikipedia.org/wiki/HVAChttp://en.wikipedia.org/wiki/Thermostathttp://en.wikipedia.org/wiki/Seasonhttp://en.wikipedia.org/wiki/Home_automationhttp://en.wikipedia.org/wiki/Avionicshttp://en.wikipedia.org/wiki/Inertial_guidance_systemhttp://en.wikipedia.org/wiki/Global_Positioning_Systemhttp://en.wikipedia.org/wiki/Brushless_DC_motorhttp://en.wikipedia.org/wiki/Brushless_DC_motorhttp://en.wikipedia.org/wiki/Induction_motorhttp://en.wikipedia.org/wiki/DC_motorhttp://en.wikipedia.org/wiki/Motor_controllerhttp://en.wikipedia.org/wiki/Motor_controllerhttp://en.wikipedia.org/wiki/DC_motorhttp://en.wikipedia.org/wiki/Induction_motorhttp://en.wikipedia.org/wiki/Brushless_DC_motorhttp://en.wikipedia.org/wiki/Brushless_DC_motorhttp://en.wikipedia.org/wiki/Global_Positioning_Systemhttp://en.wikipedia.org/wiki/Inertial_guidance_systemhttp://en.wikipedia.org/wiki/Avionicshttp://en.wikipedia.org/wiki/Home_automationhttp://en.wikipedia.org/wiki/Seasonhttp://en.wikipedia.org/wiki/Thermostathttp://en.wikipedia.org/wiki/HVAChttp://en.wikipedia.org/wiki/Dishwashershttp://en.wikipedia.org/wiki/Washing_machinehttp://en.wikipedia.org/wiki/Microwave_ovenhttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Global_Positioning_Systemhttp://en.wikipedia.org/wiki/DVD_playerhttp://en.wikipedia.org/wiki/Digital_camerahttp://en.wikipedia.org/wiki/Videogame_consolehttp://en.wikipedia.org/wiki/Mp3_playerhttp://en.wikipedia.org/wiki/Personal_digital_assistanthttp://en.wikipedia.org/wiki/Consumer_electronicshttp://en.wikipedia.org/wiki/Network_bridgehttp://en.wikipedia.org/wiki/Routerhttp://en.wikipedia.org/wiki/Mobile_phonehttp://en.wikipedia.org/wiki/Telephone_switchhttp://en.wikipedia.org/wiki/Telephone_switchhttp://en.wikipedia.org/wiki/Chassishttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Nuclear_power_planthttp://en.wikipedia.org/wiki/Programmable_logic_controllerhttp://en.wikipedia.org/wiki/Traffic_lighthttp://en.wikipedia.org/wiki/Digital_audio_playerhttp://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Digital_watchhttp://en.wikipedia.org/wiki/Economies_of_scalehttp://en.wikipedia.org/wiki/Digital_signal_processorhttp://en.wikipedia.org/wiki/Microcontrollerhttp://en.wikipedia.org/wiki/Personal_computerhttp://en.wikipedia.org/wiki/Real-time_computinghttp://en.wikipedia.org/wiki/Function_%28mathematics%29http://en.wikipedia.org/wiki/Computer_system
  • 8/4/2019 Trainning Report by- Harshit

    13/51

    Gyan-Vihar University

    Page | 13 Electronics & Communication Dept.

    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 andsecurity, medical applications and life critical systems as these systems can be isolated fromhacking and thus be more reliable. For fire safety, the systems can be designed to be have greaterability to handle higher temperatures and continue to operate. In dealing with security, theembedded systems can be self sufficient and be able to deal with cut electrical andcommunication systems.

    2.3) User InterfaceEmbedded systems range from no user interface at all dedicated only to one task to

    complex graphical user interfaces that resemble modern computer desktop operating systems.

    Simple embedded devices use buttons, LEDs, graphic or character LCDs (for example

    popular HD44780 LCD) with a simple menu system.

    More sophisticated devices use graphical screen with touch sensing or screen-edge

    buttons provide flexibility while minimizing space used: the meaning of the buttons can change

    with the screen, and selection involves the natural behavior of pointing at what's

    desired. Handheld systems often have a screen with a "joystick button" for a pointing device.

    Some systems provide user interface remotely with the help of a serial (e.g. RS-

    232, USB, IC, etc.) or network (e.g. Ethernet) connection. In spite of the potentially necessary

    proprietary client software and/or specialist cables that are needed, this approach usually gives a

    lot of advantages: extends the capabilities of embedded system, avoids the cost of a display,

    simplifies BSP, allows to build rich user interface on the PC. A good example of this is the

    combination of an embedded web server running on an embedded device (such as an IP camera)

    or a network routers. The user interface is displayed in a web browser on a PC connected to the

    device, therefore needing no bespoke software to be installed.

    http://en.wikipedia.org/wiki/Automobilehttp://en.wikipedia.org/wiki/Electric_vehiclehttp://en.wikipedia.org/wiki/Hybrid_vehiclehttp://en.wikipedia.org/wiki/Anti-lock_braking_systemhttp://en.wikipedia.org/wiki/Electronic_Stability_Controlhttp://en.wikipedia.org/wiki/Traction_control_systemhttp://en.wikipedia.org/wiki/Traction_control_systemhttp://en.wikipedia.org/wiki/Four-wheel_drivehttp://en.wikipedia.org/wiki/Medical_equipmenthttp://en.wikipedia.org/wiki/Vital_signshttp://en.wikipedia.org/wiki/Electronic_stethoscopehttp://en.wikipedia.org/wiki/Medical_imaginghttp://en.wikipedia.org/wiki/Positron_emission_tomographyhttp://en.wikipedia.org/wiki/Single_photon_emission_computed_tomographyhttp://en.wikipedia.org/wiki/Computed_tomographyhttp://en.wikipedia.org/wiki/Magnetic_resonance_imaginghttp://en.wikipedia.org/wiki/Desktop_operating_system#Graphical_user_interfaceshttp://en.wikipedia.org/wiki/Push-buttonhttp://en.wikipedia.org/wiki/LEDhttp://en.wikipedia.org/wiki/LCDhttp://en.wikipedia.org/wiki/HD44780_Character_LCDhttp://en.wikipedia.org/wiki/Menu_%28computing%29http://en.wikipedia.org/wiki/Touch_screenhttp://en.wikipedia.org/wiki/Mobile_devicehttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/USBhttp://en.wikipedia.org/wiki/I%C2%B2Chttp://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/Board_support_packagehttp://en.wikipedia.org/wiki/Embedded_HTTP_serverhttp://en.wikipedia.org/wiki/IP_camerahttp://en.wikipedia.org/wiki/Routerhttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Routerhttp://en.wikipedia.org/wiki/IP_camerahttp://en.wikipedia.org/wiki/Embedded_HTTP_serverhttp://en.wikipedia.org/wiki/Board_support_packagehttp://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/I%C2%B2Chttp://en.wikipedia.org/wiki/USBhttp://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/RS-232http://en.wikipedia.org/wiki/Mobile_devicehttp://en.wikipedia.org/wiki/Touch_screenhttp://en.wikipedia.org/wiki/Menu_%28computing%29http://en.wikipedia.org/wiki/HD44780_Character_LCDhttp://en.wikipedia.org/wiki/LCDhttp://en.wikipedia.org/wiki/LEDhttp://en.wikipedia.org/wiki/Push-buttonhttp://en.wikipedia.org/wiki/Desktop_operating_system#Graphical_user_interfaceshttp://en.wikipedia.org/wiki/Magnetic_resonance_imaginghttp://en.wikipedia.org/wiki/Computed_tomographyhttp://en.wikipedia.org/wiki/Single_photon_emission_computed_tomographyhttp://en.wikipedia.org/wiki/Positron_emission_tomographyhttp://en.wikipedia.org/wiki/Medical_imaginghttp://en.wikipedia.org/wiki/Electronic_stethoscopehttp://en.wikipedia.org/wiki/Vital_signshttp://en.wikipedia.org/wiki/Medical_equipmenthttp://en.wikipedia.org/wiki/Four-wheel_drivehttp://en.wikipedia.org/wiki/Traction_control_systemhttp://en.wikipedia.org/wiki/Traction_control_systemhttp://en.wikipedia.org/wiki/Electronic_Stability_Controlhttp://en.wikipedia.org/wiki/Anti-lock_braking_systemhttp://en.wikipedia.org/wiki/Hybrid_vehiclehttp://en.wikipedia.org/wiki/Electric_vehiclehttp://en.wikipedia.org/wiki/Automobile
  • 8/4/2019 Trainning Report by- Harshit

    14/51

    Gyan-Vihar University

    Page | 14 Electronics & Communication Dept.

    3) MICROCONTROLLERS3.1 Introduction

    Circumstances that we find ourselves in today in the field of microcontrollers had theirbeginnings in the development of technology of integrated circuits. This development has madeit possible to store hundreds of thousands of transistors into one chip. That was a prerequisite forproduction of microprocessors, and the first computers were made by adding external peripheralssuch as memory, input-output lines, timers and other. Further increasing of the volume of thepackage resulted in creation of integrated circuits. These integrated circuits contained bothprocessor and peripherals. That is how the first chip containing a microcomputer, or what wouldlater be known as a microcontroller came about.

    3.2 Definition of a MicrocontrollerMicrocontroller, as the name suggests, are small controllers. They are like single chip

    computers that are often embedded into other systems to function as processing/controlling unit.

    For example, the remote control you are using probably has microcontrollers inside that do

    decoding and other controlling functions. They are also used in automobiles, washing machines,

    microwave ovens, toys ... etc, where automation is needed.

    The key features of microcontrollers include:

    High Integration of Functionality Microcontrollers sometimes are called single-chip computers because they have on-chip

    memory and I/O circuitry and other circuitries that enable them to function as smallstandalone computers without other supporting circuitry.

    Field Programmability, Flexibility Microcontrollers often use EEPROM or EPROM as their storage device to allow field

    programmability so they are flexible to use. Once the program is tested to be correct thenlarge quantities of microcontrollers can be programmed to be used in embedded systems.

    Easy to Use

    Assembly language is often used in microcontrollers and since they usually follow RISC

    architecture, the instruction set is small. The development package of microcontrollers

    often includes an assembler, a simulator, a programmer to "burn" the chip and a

    demonstration board. Some packages include a high level language compiler such as a Ccompiler and more sophisticated libraries.

  • 8/4/2019 Trainning Report by- Harshit

    15/51

    Gyan-Vihar University

    Page | 15 Electronics & Communication Dept.

    Most microcontrollers will also combine other devices such as:

    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

  • 8/4/2019 Trainning Report by- Harshit

    16/51

    Gyan-Vihar University

    Page | 16 Electronics & Communication Dept.

    3.3 PIN CONFIGURATION

    figure 3.2 Pin configuration of Microcontroller

    P1

    RESET

    RXD

    TXD

    INT0

    INT1

    T0

    T1

    RD

    WR

    XTAL1

    XTAL2

    GND

    P3

    Vcc

    P0

    EA

    PSEN

    ALE

    P2

  • 8/4/2019 Trainning Report by- Harshit

    17/51

    Gyan-Vihar University

    Page | 17 Electronics & Communication Dept.

    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: It receives data in serial communication.

    TXD: It transmits data in serial communication.

    INT0: External interrupt for timer 0.

    INT1: External interrupt for timer1

    T0: Timer0.

    T1: Timer1.

    RD: To read into external memory.

    WR: 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: Program store enable which is used for storing programming code into the external

    memory.

    EA: External Access: 64 KB of ROM is the limit for external memory.

  • 8/4/2019 Trainning Report by- Harshit

    18/51

  • 8/4/2019 Trainning Report by- Harshit

    19/51

    Gyan-Vihar University

    Page | 19 Electronics & Communication Dept.

    3.5 RAM Architecture

    figure 3.4: Ram Architecture

    The 8051 has a bank of 128 bytes ofInternal 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

  • 8/4/2019 Trainning Report by- Harshit

    20/51

    Gyan-Vihar University

    Page | 20 Electronics & Communication Dept.

    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 BanksThe 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 MemoryThe 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.

    Special Function Register (SFR) MemorySpecial Function Registers (SFRs) are areas of memory that control specific functionality

    of the 8051 processor. For example, four SFRs permit access to the 8051s 32 input/output lines.

    Another SFR allows a program to read or write to the 8051s serial port .SFR is a part of Internal

    Memory. This is not the case. When using this method of memory access (its called direct

    address), any instruction that has an address of 00h through 7Fh refers to an Internal RAM

    memory address; any instruction with an address of 80h through FFh refers to an SFR control

    register.

  • 8/4/2019 Trainning Report by- Harshit

    21/51

    Gyan-Vihar University

    Page | 21 Electronics & Communication Dept.

    RegistersThe 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" registersThe "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" RegisterThe "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.

  • 8/4/2019 Trainning Report by- Harshit

    22/51

    Gyan-Vihar University

    Page | 22 Electronics & Communication Dept.

    Addressing ModesAn "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.

    InterruptsAn 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.

    .

    TimersTimers 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.

  • 8/4/2019 Trainning Report by- Harshit

    23/51

    Gyan-Vihar University

    Page | 23 Electronics & Communication Dept.

    3.6 Microcontrollers versus MicroprocessorsMicrocontroller differs from a microprocessor in many ways. First and the most

    important is its functionality. In order for a microprocessor to be used, other components such asmemory, or components for receiving and sending data must be added to it. In short that means

    that microprocessor is the very heart of the computer. On the other hand, microcontroller isdesigned to be all of that in one. No other external components are needed for its applicationbecause all necessary peripherals are already built into it. Thus, we save the time and spaceneeded to construct devices.

    3.7 Central Processing UnitLet add 3 more memory locations to a specific block that will have a built in capability to

    multiply, divide, subtract, and move its contents from one memory location onto another. The

    part we just added in is called "central processing unit" (CPU). Its memory locations are calledregisters.

    Figure3.5: Simplified central processing unit with three registers

    Registers are therefore memory locations whose role is to help with performing variousmathematical operations or any other operations with data wherever data can be found. Look atthe current situation. We have two independent entities (memory and CPU) which areinterconnected, and thus any exchange of data is hindered, as well as its functionality. If, forexample, we wish to add the contents of two memory locations and return the result again backto memory, we would need a connection between memory and CPU. Simply stated, we musthave some "way" through data goes from one block to another.

  • 8/4/2019 Trainning Report by- Harshit

    24/51

    Gyan-Vihar University

    Page | 24 Electronics & Communication Dept.

    3.8 BusThat "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 theamount 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 toconnect 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 theoutside world, or with us! In order to remove this deficiency, let's add a block which containsseveral memory locations whose one end is connected to the data bus, and the other hasconnection with the output lines on the microcontroller which can be seen as pins on theelectronic component.

  • 8/4/2019 Trainning Report by- Harshit

    25/51

    Gyan-Vihar University

    Page | 25 Electronics & Communication Dept.

    3.9 Input-output unitThose locations we've just added are called "ports". There are several types of ports:

    input, output or bidirectional ports. When working with ports, first of all it is necessary to choosewhich port we need to work with, and then to send data to, or take it from the port.

    Figure3.7: Simplified input-output unit communicating with external world

    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.

    3.10 Serial CommunicationBeside stated above we've added to the already existing unit the possibility of

    communication with an outside world. However, this way of communicating has its drawbacks.One of the basic drawbacks is the number of lines which need to be used in order to transfer data.What if it is being transferred to a distance of several kilometers? The number of lines times

    number of kilometers doesn't promise the economy of the project. It leaves us having to reducethe number of lines in such a way that we don't lessen its functionality. Suppose we are workingwith three lines only, and that one line is used for sending data, other for receiving, and the thirdone is used as a reference line for both the input and the output side. In order for this to work, weneed to set the rules of exchange of data. These rules are called protocol. Protocol is thereforedefined in advance so there wouldn't be any misunderstanding between the sides that arecommunicating with each other. For example, if one man is speaking in French, and the other inEnglish, it is highly unlikely that they will quickly and effectively understand each other. Let'ssuppose we have the following protocol. The logical unit "1" is set up on the transmitting line

  • 8/4/2019 Trainning Report by- Harshit

    26/51

    Gyan-Vihar University

    Page | 26 Electronics & Communication Dept.

    until transfer begins. Once the transfer starts, we lower the transmission line to logical "0" for aperiod of time (which we will designate as T), so the receiving side will know that it is receivingdata, and so it will activate its mechanism for reception. Let's go back now to the transmissionside and start putting logic zeros and ones onto the transmitter line in the order from a bit of thelowest 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 linewhich will mark the end of the transmission of one data. The protocol we've just described iscalled in professional literature NRZ (Non-Return to Zero).

    Figure3.8: Serial unit sending data through three lines only

    As we have separate lines for receiving and sending, it is possible to receive and senddata (info.) at the same time. So called full-duplex mode block which enables this way ofcommunication is called a serial communication block. Unlike the parallel transmission, datamoves here bit by bit, or in a series of bits what defines the term serial communication comesfrom. After the reception of data we need to read it from the receiving location and store it inmemory 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.

  • 8/4/2019 Trainning Report by- Harshit

    27/51

    Gyan-Vihar University

    Page | 27 Electronics & Communication Dept.

    3.11 Timer unitSince we have the serial communication explained, we can receive, send and process

    data.

    Figure2.9: Timer unit generating signals in regular time intervals

    However, in order to utilize it in industry we need a few additionally blocks. One of thoseis 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 registerwhose numeric value increments by one in even intervals, so that by taking its value duringperiods T1 and T2 and on the basis of their difference we can determine how much time haselapsed. This is a very important part of the microcontroller whose understanding requires mostof our time.

    Figure2.10: Physical configuration of the interior of a microcontroller

  • 8/4/2019 Trainning Report by- Harshit

    28/51

    Gyan-Vihar University

    Page | 28 Electronics & Communication Dept.

    Figure2.11: Microcontroller outline with basic elements and internal connections

    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 interfacelogic towards the elements of regulation (which will be discussed next).

  • 8/4/2019 Trainning Report by- Harshit

    29/51

    Gyan-Vihar University

    Page | 29 Electronics & Communication Dept.

    4) LCD INTERFACING4.1 Pin Configuration

    GND Vcc

    figure : 16x2 LCD Pin configuration

    3- >VARISTOR

    4-> RS

    5-> RW

    6-> EN

    7-14-> DATA LINE INPUTS

    80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F

    C0 C1 C2 3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF

    H ->A

    1 16 2 15

    4

    3

    5

    6

    7 8 9 10 11 12 13 14

  • 8/4/2019 Trainning Report by- Harshit

    30/51

    Gyan-Vihar University

    Page | 30 Electronics & Communication Dept.

    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.

    4.2 DDRAM - Display Data RAMDisplay data RAM (DDRAM) stores display data represented in 8-bit character codes. Its

    extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that

    is not used for display can be used as general data RAM. So whatever you send on the DDRAM

    is actually displayed on the LCD.

    4.3 BF - Busy FlagBusy Flag is a status indicator flag for LCD. When we send a command or data to the

    LCD for processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed

    successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount of delay.

    For the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and

    The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will

    not accept next command or data and BF = 0 means LCD is ready for the next command or data

    to process.

    4.4 Instruction Register (IR) and Data Register (DR)There are two 8-bit registers controller Instruction and Data register. Instruction register

    corresponds to the register where you send commands to LCD e.g. LCD shift command, LCD

    clear, LCD address etc. and Data register is used for storing data which is to be displayed on

    LCD. When send the enable signal of the LCD is asserted, the data on the pins is latched in to the

    data register and data is then moved automatically to the DDRAM and hence is displayed on the

    LCD.

    4.5 Commands and Instruction setOnly the instruction register (IR) and the data register (DR) of the LCD can be controlled

    by the MCU. Before starting the internal operation of the LCD, control information is

    temporarily stored into these registers to allow interfacing with various MCUs, which operate at

    different speeds, or various peripheral control devices. The internal operation of the LCD is

    determined by signals sent from the MCU.

  • 8/4/2019 Trainning Report by- Harshit

    31/51

    Gyan-Vihar University

    Page | 31 Electronics & Communication Dept.

    4.6 Sending Commands to LCDTo send commands we simply need to select the command register. Everything is same

    as we have done in the initialization routine. But we will summarize the common steps and put

    them in a single subroutine.

    Following are the steps:

    Move data to LCD port Select command register Select write operation Send enable signal Wait for LCD to process the command

  • 8/4/2019 Trainning Report by- Harshit

    32/51

    Gyan-Vihar University

    Page | 32 Electronics & Communication Dept.

    5) DC MOTOR INTERFACINGIn 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.

    5.1 Push-Pull Four Channel DriverDescription

    Output current to 1A or 600mA per channel respectively. Each channel is controlled by a

    TTL-compatible logic input and each pair of drivers (a The L293 and L293D are quad push-pull

    drivers capable of delivering full bridge) is equipped with an inhibit input which turns off all four

    transistors. A separate supply input is provided for the logic so that it may be run off a lower

    voltage to reduce dissipation. Additionally the L293D includes the output clamping diodes

    within the IC for complete interfacing with inductive loads. Both devices is available in 16-pin

    Batwing DIP packages. They are also available in Power S0IC and Hermetic DIL packages.

    5.2 Block Diagram

  • 8/4/2019 Trainning Report by- Harshit

    33/51

    Gyan-Vihar University

    Page | 33 Electronics & Communication Dept.

    5.3FEATURES: 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

    ABSOLUTE MAXIMUM RATINGS:Collector Supply Voltage, VC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36V

    Logic Supply Voltage, VSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36V

    Input Voltage, VI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7V

    Inhibit Voltage, VINH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7V

    Peak Output Current (Non-Repetitive), lOUT (L293) . . . . . . . . . . . . . . . . . . . . . . . . . .. 2A

    lOUT (L293D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 1.2A

    Total Power DissipationAt T ground-pins = 80C

    N Batwing pkg, (Note) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5W

    Storage and Junction Temperature, Tstg, TJ . . . . . . ... . . . .. . . . . . . -40 to +150C

  • 8/4/2019 Trainning Report by- Harshit

    34/51

    Gyan-Vihar University

    Page | 34 Electronics & Communication Dept.

    6) Keyboard Interfacing6.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.

    6.2 Scanning and identifying the keyFigure shows a 4*4 matrix connected to two ports.

    Figure 4*4 Matrix Keyboard

  • 8/4/2019 Trainning Report by- Harshit

    35/51

    Gyan-Vihar University

    Page | 35 Electronics & Communication Dept.

    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 themicrocontroller to scan the keyboard continuously to detect and identify the key pressed.

    6.3 Grounding Rows & Reading ColumnsTo detect a pressed key , the microcontroller grounds all rows by providing 0 to the

    output latch, and then it reads the columns. If the data read from the columns is D3-D0=1111, no

    key has been pressed and the process continues until a key press is detected. However, if one of

    the column bits has a zero, this means that a key press has occurred. For example, if D3-

    D0=1101, this means that a key in the D1 column has been pressed. After a key press is detected,

    the microcontroller will go through the process of identifying the key. Starting with the top row,the microcontroller grounds it by providing a low to row D0 only; then it reads the columns. I f

    the data read is all1s, no key in that row is activated and the process is moved to the next row. It

    grounds the next row, reads the columns, and checks for any zero. This process continues until

    the row is identified. After identification of the row in which the key has been pressed, the next

    task is to find out which column the pressed key belongs to. This should be easy since the

    microcontroller knows at any time which row and column are being accessed.

    Assembly language program for detection and identification of key activation is given

    below. In this program, it is assumed that P1 and P2 are initialized as output and input,

    respectively. Program13.1 goes through the following four major stages:

    1. To make sure that the preceding key has been released, 0s are output to all rows at once,

    and the columns are read and checked repeatedly until all the columns are high. When all

    columns are found to be high, the program waits for a short amount of time before it goes

    to the next stage of waiting for a key to be pressed.

    2. To see if any key is pressed, the columns are scanned over and over in an infinite loop

    until one of them has a 0 on it. Remember that the output latches connected to rows still

    have their initial zeros (provided in stage 1), making them grounded. After the key press

    detection, it waits 20ms for the bounce and then scans the columns again. This serves twofunctions: (a) it ensures that the first key press detection was not an erroneous one due to

    spike noise, and(b) the 20ms delay prevents the same key press from being interpreted as

    a multiple key press. If after the 20-ms delay the key is still pressed, it goes to the next

    stage to detect which row it belongs to; otherwise, it goes back into the loop to detect a

    real key press.

  • 8/4/2019 Trainning Report by- Harshit

    36/51

    Gyan-Vihar University

    Page | 36 Electronics & Communication Dept.

    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 withany matrix up to 8*8.

  • 8/4/2019 Trainning Report by- Harshit

    37/51

    Gyan-Vihar University

    Page | 37 Electronics & Communication Dept.

    7) Description of Project7.1 IntroductionThe Need

    Delhi, the National Capital with a population ofabout 12 million is, perhaps, the only city of its size inthe world, which depends almost entirely on buses on itsole mode of mass transport.bus services are inadequateand heavily over-crowded.. The result of extremecongestion on the road, ever slowing speeds, increasingaccident 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 disconcertinglevels.

    Immediate steps are, therefore, needed to improve both the quality and availability ofmass transport service. This is possible only if a rail-based mass transit system, which is non-polluting, is introduced in the city without further delay.

    Delhi MRTS ProjectWith a view to reducing the problems of Delhiscommuter, the launching of an Integrated Multi Mode Mass

    Rapid Transport System for Delhi had long been underconsideration. The first concrete step in this direction was,however, taken when a feasibility study for developing such amulti-modal MRTS system was commissioned by GNCTD(with support from GOI) in 1989 and completed by RITES in

    1991.

    My Prototype of metro trainI have made the prototype of Metro train using Microcontroller 89C51.The basic functionof this project is given later. I have used a toy car to implementing it which has two DC motors.

    One is used for opening and closing the door and other is used for moving the car forward. Thecomplete description of project is given below.

  • 8/4/2019 Trainning Report by- Harshit

    38/51

  • 8/4/2019 Trainning Report by- Harshit

    39/51

    Gyan-Vihar University

    Page | 39 Electronics & Communication Dept.

    7.3 PROJECT METHODOLOGY7.3(a) Components:

    Component Name Quantity1. Microcontroller Section

    Microcontroller IC (AT89C51) with base 1

    Crystal Oscillator (11.0592 MHz) 1

    Capacitor (30pF) 2

    Capacitor (10F) 1

    Resistor (8.2K) 1

    LCD Connector 1

    2. Buzzer 13. LCD(16x2) 14. Load Driver (L293D) with base 15. A Car (toy-driven by a DC motor) 16. General Purpose Card 47. Single Core Connecting Wires8. Reset Switch (Push-on) 1

    7.3(b) Softwares used:1. Keil Vision3.2. Top-View Simulator

    7.3(c) Equipments used:1. Soldering iron, solder, flux.2. Hex Blade

  • 8/4/2019 Trainning Report by- Harshit

    40/51

    Gyan-Vihar University

    Page | 40 Electronics & Communication Dept.

    7.4 Procedure of building the Prototype of Metro Train

    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 theflash 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

    7.5 General Working

    When the power is turned on a message (welcome to metro) is displayed on LCD.

    Then a message Current station is Kishan Ganj is displayed and door is opened also.

    A buzzer is also turned on when door opens. After some delay the door is closed and car

    is started to move forward. A message current station is Kishan Ganj is displayed also on

    LCD. After some delay a message next station is Pratap nagar is displayed.

    After some time the train stops and a message current station is Pratap nagar is

    displayed. This process is continued for five stations. In the end a message End of line is

    displayed on LCD. This whole process is repeated until we turned off the power supply.

  • 8/4/2019 Trainning Report by- Harshit

    41/51

    Gyan-Vihar University

    Page | 41 Electronics & Communication Dept.

    8) FUTURE SCOPE

    The new cars would feature the following:

    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.

  • 8/4/2019 Trainning Report by- Harshit

    42/51

    Gyan-Vihar University

    Page | 42 Electronics & Communication Dept.

    9) REFRENCES AND BIBLOGRAPHY THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM by Muhammad Ali

    Mazidi , Janice Gillispie Mazidi, Rolin D. Mckinlay. The 8051 MICROCONTROLLER by K. J. Ayala. "Advanced Microprocessors and Microcontrollers" by B.P. Singh & Renu Singh. "Let Us C" by Yashwant Kanitkar. "Data Structure through C" by Yashwant Kanitkar.

    NET LINKS:1. www.8051projects.net2. www.atmel.com3. www.electronicsforyou.com4. www.encyclopedia.com5. www.wikipedia.com

    http://www.8051projects.net/http://www.8051projects.net/http://www.amtel.com/http://www.amtel.com/http://www.electronicsforyou.com/http://www.electronicsforyou.com/http://www.encyclopedia.com/http://www.encyclopedia.com/http://www.wikipedia.com/http://www.wikipedia.com/http://www.wikipedia.com/http://www.encyclopedia.com/http://www.electronicsforyou.com/http://www.amtel.com/http://www.8051projects.net/
  • 8/4/2019 Trainning Report by- Harshit

    43/51

    Gyan-Vihar University

    Page | 43 Electronics & Communication Dept.

    10)AppendixList of Essential Diagrams:

    1.

    Figure 3.1: showing a typical microcontroller deviceand its different subunits 10

    2.Figure 3.2: Pin configuration of Microcontroller 11

    3.Figure 3.3: Reset circuit of Microcontroller 13

    4.Figure 3.4: Ram Architecture 14

    5.Figure 3.5: Simplified central processing unit

    with three register 18

    6.Figure 3.6: Showing connection between memory

    and central unit using buses 19

    7.Figure 3.7: Simplified input-output unit communicating

    with external world 20

    8.Figure 3.8: Serial unit sending data through three lines 21

    9.

    Figure 3.9: Timer unit generating signals in regulartime intervals 22

    10.Figure 3.10 : Physical configuration of the interior ofA Microcontroller 22

    11.Figure 3.11: Microcontroller outline with basic elementsAnd internal connections 23

    12.Figure 4.1: 16x2 LCD pin configuration 2413.Figure 5.1: Block diagram of load driver L293D 2714.Figure 6.1: 4*4 Matrix keyboard 2915.Figure 7.1: Circuit diagram of Metro train prototype 33

  • 8/4/2019 Trainning Report by- Harshit

    44/51

    Gyan-Vihar University

    Page | 44 Electronics & Communication Dept.

    11)CodingMETRO TRAIN PROTO-TYPE

    $mod51

    lcdport equ p0

    rs equ p3.2

    en equ p3.3

    ;rw equ p3.1

    org 00h

    mov p0,#00h

    mov p2,#00h

    mov p3,#0ffh

    welcome: acall initialise1 ;lcd initialise

    mov dptr,#330h ;welcome to metro

    mov r7,#16

    acall display

    acall delay

    station1: acall initialise1

    mov dptr,#197h ;current station

    mov r7,#15

    acall display

    acall delayacall initialise2

    mov r7,#12

    mov dptr,#183h ;noida sec-15

  • 8/4/2019 Trainning Report by- Harshit

    45/51

    Gyan-Vihar University

    Page | 45 Electronics & Communication Dept.

    acall display

    acall train

    station2: acall initialise1

    acall next

    acall initialise2

    mov dptr,#229h ;noida sec-16

    mov r7,#12

    acall display

    acall trainstation3:

    acall initialise1

    acall next

    acall initialise2

    mov dptr,#243h ;new ashok nagar

    mov r7,#15acall 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

  • 8/4/2019 Trainning Report by- Harshit

    46/51

    Gyan-Vihar University

    Page | 46 Electronics & Communication Dept.

    acall next

    acall initialise2

    mov dptr,#289h ;akshardham

    mov r7,#10

    acall display

    acall train

    station6: acall initialise1

    acall next

    acall initialise2mov 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

  • 8/4/2019 Trainning Report by- Harshit

    47/51

    Gyan-Vihar University

    Page | 47 Electronics & Communication Dept.

    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.7mov p1,#0fh

    acall delay_1sec

    acall delay_1sec

    acall delay_1sec

    mov dptr,#315h

    mov r7,#10acall initialise1

    acall display

    setb p3.7

    setb p3.4

    setb p3.5setb p3.6

    acall delay_1sec

    mov p2,#05h

    acall delay_1sec ;move for 5 sec

  • 8/4/2019 Trainning Report by- Harshit

    48/51

    Gyan-Vihar University

    Page | 48 Electronics & Communication Dept.

    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 matrixacall cmd

    acall delay

    mov lcdport,#01h ;clear the display

    acall cmd

    acall delay

    mov lcdport,#0eh ;cursor blinkingacall cmd

    acall delay

    mov lcdport,#80h ;cursor at fst line fst postn

    acall cmd

    acall delay

    ret

    initialise2: mov lcdport,#38h

    acall cmd

  • 8/4/2019 Trainning Report by- Harshit

    49/51

    Gyan-Vihar University

    Page | 49 Electronics & Communication Dept.

    acall delay

    mov lcdport,#0eh

    acall cmd

    acall delay

    mov lcdport,#0c0h

    acall cmd

    acall delay

    ret

    display: clr amovc a,@a+dptr

    mov lcdport,a

    acall read

    inc dptr

    djnz r7,displayret

    cmd:

    clr rs

    setb en

    acall delayclr en

    ret

    read:

  • 8/4/2019 Trainning Report by- Harshit

    50/51

    Gyan-Vihar University

    Page | 50 Electronics & Communication Dept.

    setb rs

    setb en

    acall delay

    clr en

    ret

    delay_1sec:

    mov r5,#14

    mov tmod,#10h

    rpt: mov th1,#00hmov tl1,#00h

    clr tf1

    setb tr1

    chk: jnb tf1,chk

    clr tr1clr tf1

    djnz r5,rpt

    ret

    org 183h

    db 'noida sec-15'

    org 197hdb 'current station'

    org 215h

    db 'next station'

    org 229h

  • 8/4/2019 Trainning Report by- Harshit

    51/51

    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 300hdb 'rajiv chowk'

    org 315h

    db 'door close'

    org 330h

    db 'welcome to metro'

    last:

    end