You are on page 1of 33

CHAPTER1 INTRODUCTION

1 .1 G E NE R AL INTRODUCTION
TRAFFIC DENSITY ANALYZER CUM SIGNALLING FOR METRO CITIES is an application specific project which provides an intelligent environment. The heart of my project is microcontroller, which will provide the controlling of the traffic depending upon the density in each junction. In this project IR communication is used to analyze traffic density. The IR rays are continuously transmitted and received by the IR transmitter and IR

receiver respectively. Whenever discontinuity occurs in the this process, the microcontroller senses the result, compares it with all the four junctions and shows the green signal for longer time period (where the traffic density is heavy) while the red signal is shown to the other three roads.

1.2ORGANIZATION OF THE REPORT


The chapter 1 contains the general introduction and organization of the project The chapter 2 contains description of the hardware components The chapter 3 contains schematic diagram and its operation. The chapter 4 contains software description. The chapter 5contains the result The chapter6 contains conclusions and the future scope

CHAPTER2 HARDWARE COMPONENTS DESCRIPTION


2.1 GENERAL THEORY
The general theory explains all the components used in this project. So a general idea about the components can be obtained. And also the working of primary components is discussed in this chapter.

2.2 MICROCONTROLLER 2.2.1 INTRODUCTION


A Microcontroller consists of a powerful CPU tightly coupled with memory, various I/O interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog converter integrated on to a single silicon chip. If a system is developed with a microprocessor, the designer has to go for external memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these facilities on a single chip. Development of a Microcontroller reduces PCB size and cost of design. One of the major differences between a Microprocessor and a Microcontroller is that a controller often deals with bits not bytes as in the real world application. Intel has introduced a family of Microcontrollers called the MCS-51.

2.2.2 BLOCK DIAGRAM

Fig.(2.1): Block diagram of Microcontroller FEATURES


4K bytes of In-System Programmable (ISP) flash memory
4.0V to 5.5V operating range Fully static operation: 0 Hz to 33 MHz Three-level program memory lock

128 x 8-bit internal RAM


32 programmable I/O lines
3

Two 16-bit timer/counters Six interrupt sources Full duplex UART serial channel Low-power idle and power-down modes

2.2.3 DESCRIPTION
The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industrystandard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bitCPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S51 isa powerful microcontroller which provides a highly-flexible and cost-effectivesolution to many embedded control applications.

Fig.(2.2): Microcontroller

2.2.4 PIN DIAGRAM

Fig.(2.3): Pin Diagram 2.2.5 PIN DESCRIPTION


VCC -Supply voltage GND Ground

PORT 0
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance inputs. Port 0 can also be configured to be the multiplexed low order address/data bus during access to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification.

PORT 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The port 1output buffers can sink/source four TTL inputs. When 1s are written to port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during flash programming and verification.

PORT 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The port 2output buffers can sink/source four TTL inputs. When 1s are written to port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 also receives the high-order address bits and some control signals during flash programming and verification.

PORT 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The port 3output buffers can sink/source four TTL inputs. When 1s are written to port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups.

Port 3 receives some control signals for flash programming and verification. Port 3 also serves the functions of various special features of the AT89S51, as shown in the following table.

Table(2.1) : Port 3 Pin Functions

RST
Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during access to external memory. This pin is also the program pulse input(PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction .Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode.

PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H upto FFFFH. However, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.

XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 Output from the inverting oscillator amplifier.

2.2.6SPECIAL FUNCTION REGISTERS


SFRs are a kind of control table used for running and monitoring microcontrollers operating. Each of these registers, even each bit they include, has its name, address in the scope of RAM and clearly defined purpose ( for example: timer control, interrupt, serial connection etc.). Even though there are 128 free memory locations intended for their storage, the basic core, shared by all types of 8051 controllers, has only 21 such registers. Rest of locations are intentionally left free in order to enable the producers to further improved models keeping at the same time compatibility with the previous versions. It also enables the use of programs written a

long time ago for the micro controllers, which are out of production now.

Table 2.4:Special function registers A REGISTER (Accumulator)


This is a general-purpose register which serves for storing intermediate results during operating. A number (an operand) should be added to the accumulator prior to execute an instruction upon it. Once an arithmetical operation is performed by the ALU, the result is placed into the accumulator.

Fig 2.5 Aregister B REGISTER


B register is used during multiply and divide operations which can be performed only upon numbers stored in the A and B registers. All other instructions in the program can use this register as a spare accumulator (A).

Fig 2.5 B register R REGISTERS (R0-R7)


This is a common name for the total 8 general purpose registers (R0, R1, R2 ...R7). Even they are not true SFRs, they deserve to be discussed here because of their purpose. The bank is active when the R registers it includes are in use. Similar to the accumulator, they are used for temporary storing variables and intermediate results. Which of the banks will be active depends on two bits included in the PSW Register. These registers are stored in four banks in the scope of RAM.

Table 2.7:R registers

2.2.7MEMORY ORGANIZATION
MCS-51 devices have a separate address space for program and data memory. Up to 64K bytes each of external program and data memory can be addressed. Program memory: if the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89C51, if EA is connected to VCC, program fetches to addresses 0000H through FFFFH are directed to internal memory and fetches to addresses 1000H through FFFFH are directed to external memory. Data memory: The AT89C51 implements 128 bytes of on-chip RAM. The 128 bytes are accessible via direct and indirect addressing modes. Stack operations are examples of indirect addressing, so the 128 bytes of data RAM are available as stack space.

10

2.3 POWER SUPPLY DESCRIPTION


The power supplies are designed to convert high voltage AC mains electricity to a suitable low voltage supply for electronics circuits and other devices. A power supply can by broken down into a series of blocks, each of which performs a particular function. A DC power supply which maintains the output voltage constant irrespective of AC mains fluctuations or load variations is known as Regulated DC Power Supply For example a 5V regulated power supply system as shown below:

Fig.(2.8): Components of a typical power supply 2.4 TRANSFORMER


A transformer is an electrical device which is used to convert electrical power from one electrical circuit to another without any change in frequency. Transformers convert AC electricity from one voltage to another with little loss of power. Transformers work only with AC and this is one of the reasons why mains electricity is AC. Step-up transformers increase the output voltage while stepdown transformers decrease the output voltage.

11

Most of the power supplies use a step-down transformer to reduce the dangerous high mains voltage to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. There is no electrical connection between the two coils, instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core. Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down, current is stepped up. The ratio of the number of turns on each coil, called the turns ratio, determines the ratio of the voltages . A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply and a small number of turns on its secondary (output) coil to give a low output voltage.

Fig.(2.9): An Electrical Transformer


Turns ratio = Vp/ VS= Np/NS Power Out= Power In VS x IS=VP x IP Vp = primary (input) voltage Np = number of turns on primary coil Ip = primary (input) current

2.5 RECTIFIER
A circuit which is used to convert ac to dc is known as rectifier . The process of conversion of ac to dc is called rectification.

12

TYPES OF RECTIFIERS Half wave Rectifier Full wave rectifier 1. Centre tap full wave rectifier 2. Bridge type full wave rectifier 2.5.1 HALF-WAVE RECTIFIER The Half wave rectifier is a circuit, which converts an ac voltage to dc voltage When a diode is connected to a source of alternating voltage, it will be alternately forward-biased, and then reverse-biased, during each cycle of the AC sine-wave. When a single diode is used in a rectifier circuit, current will flow through the circuit only during one-half of the input voltage cycle. For this reason, this rectifier circuit is called a half -wave rectifier 2.5.2FULL-WAVE RECTIFIER A Full Wave Rectifier is a circuit, which converts an ac voltage into a pulsating dc voltage using both half cycles of the applied ac voltage. It uses two diodes of which one conducts during one half cycle while the other conducts during the other half cycle of the applied ac voltage.

Fig.(2.10): Centre tap full wave rectifier Bridge

13

2.5.3BRIDGE RECTIFIER
A bridge rectifier makes use of four diodes in a bridge arrangement to achieve full- wave rectification. This is a widely used configuration, both with individual diodes wired as shown and with single component bridges where the diode bridge is wired internally.

Fig.(2.11): Bridge Rectifier OPERATION


During positive half cycle of secondary, the diodes D2 and D3 are in forward biased while D1 and D4 are in reverse biased as shown in the fig(3.7). The current flow direction is shown in the fig.(3.7) with dotted arrows.

Fig.(2.12):Bridge Rectifier Positive Half Cycle

14

During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward biased while D2 and D3 are in reverse biased as shown in the fig(3.8). The current flow direction is shown in the fig.(3.8) with dotted arrows.

Fig.(2.13):Bridge Rectifier Negative Half Cycle 2.6 FILTER


A Filter is a device which removes the ac component of rectifier output but allows the dc component to reach the load.

2.6.1 CAPACITOR FILTER


The ripple content in the rectified output of half wave rectifier is 121%or that of full-wave or bridge rectifier is 48%. Such high percentage of ripples is not acceptable for most of the applications. Ripples can be removed by one of the following methods of filtering. A capacitor, in parallel to the load, provides an easier by-pass for the ripple voltage through it due to low impedance at ripple frequency and leaves the dc to appear at the load. Filtering is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling.

15

The capacitor charges quickly near the peak of the varying DC and then discharges as it supplies current to the output. Filtering significantly increases the average DC voltage to almost the peak value (1.4 RMS value). To calculate the value of capacitor(C), C = * 3 * f * r * Rl Where, f = supply frequency, r = ripple factor, Rl = load resistance

2.7 REGULATOR
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. The maximum current they can pass also rates them. Negativ e voltage regulators are available, mainly for use in dual supplies. Many of the fixed voltage regulators ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown in the fig (3.5). The LM7805 is simple to use . The positive lead of an unregulated DC power supply (anything from 9V DC to 24V DC) is connected to the input pin, and connect the negative lead to the common pin and when the power is on, 5V appear at the output pin.

Fig.(2.14): A Three Terminal Voltage Regulator

16

2.7.1 LM78XX DESCRIPTION


The Bay Linear LM78XX is an integrated linear positive regulator with three terminals. The LM78XX offer several fixed output voltages making them useful in wide range of applications.

FEATURES
Output current of 1.5A Output voltage tolerance of 5% Internal thermal overload protection Internal short-circuit limited No external component Output voltage 5V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V

2.8 OSCILLATOR CHARACTERISTICS


The heart of the 8051 is the circuitry that generates the clock pulses by which all internal operations are synchronized. Pins XTAL1 and XTAL2 are provided

for connecting a resonant network to form an oscillator typically a quartz crystal and capacitors are employed. The crystal frequency is the basic internal clock frequency of the microcontroller.

Fig.(2.15):Oscillator Connections
17

Fig.(2.16): External Clock Drive Configuration 2.9 LIGHT EMITTING DIODE 2.9.1 LED DESCRIPTION
It is a semiconductor diode having radioactive recombination. It requires a definite amount of energy to generate an electron-hole pair. The same energy is released when an electron recombines with a hole. This released energy may result in the emission of photon and such a recombination. Here the amount of energy released when the electro reverts from the conduction band to the valence band appears in the form of radiation. Alternatively the released energy may result in a series of phonons causing lattice vibration. Finally the released energy may be transferred to another electron. Therecombinati on radiation may lie in the infra-red and visible light spectrum. In forward it is peaked around the band gap energy and the phenomenon is called injection luminescence. In a junction biased, in the avalanche breakdown region, there results a spectrum of photons carrying much higher energies, almost white light gets emitted from micro-plasma breakdown region in silicon junction. Diodes having radioactive recombination are termed as Light Emitting Diode, abbreviated as LED.

18

Fig.(2.17): Light Emitting Diode

Fig.(2.18): Circuit Symbol of LED TESTING AN LED


Never connect an LED directly to a battery or power supply. It will be destroyed almost instantly because too much current will pass through and burn it out. LEDs must have a resistor in series to limit the current to a safe value, for quick testing purposes a 1k resistor is suitable for most LEDs if your supply voltage is 12V or less.

CALCULATING AN LED RESISTOR VALUE


An LED must have a resistor connected in series to limit the current through the LED, otherwise it will burn out almost instantly.

19

The resistor value, R is given by

VS= supply voltage VL= LED voltage (usually 2V, but 4V for blue and white LEDs) I = LED current (e.g. 20mA), this must be less than the maximum permitted

MERITS
The following are the merits of LEDs over conventional incandescent and other types of lamps 1. Low working voltages and currents 2. Less power consumption 3. Very fast action 4. Emission of monochromatic light 5. Small size and weight 6. No effect of mechanical vibrations 7. Extremely long life Typical LED uses a forward voltage of about 2V and current of 5 - 10mA.GaAs LED produces infra-red light while red, green and orange lights are produced by gallium arsenide phosphide (GaAsP) and gallium phosphide (GaP).

2.9.2 INFRA - RED LED IR LED DESCRIPTION


The QED233 / QED234 is a 940nm GaAs/ AlGaAs LED encapsulated in a clear untinted, plastic T-1 3/4 package.

20

Fig.(2.19): IR LED and Schematic FEATURES


Wavelength () = 940 nm Chip material = GaAs with AlGaAs window Package type: T-1 3/4 (5mm lens diameter) Matched photo sensor: QSD122/123/124 High output power Package, material and color: Clear, untinted, plastic Ideal for remote control applications

2.10 PHOTO DIODE


A photodiode is a type of photo detector capable of converting light into either current or voltage, depending upon the mode of operation. Photodiodes are similar to regular semiconductor diodes except that they may be either exposed (to detect vacuum UV or X-rays) or packaged with a window or optical fiber connection to allow light to reach the sensitive part of the device. Many diodes designed for use specifically as a photodiode will also use a PIN junction rather than the typical PN junction.

PRINCIPLE OF OPERATION
A photodiode is a PN junction or PIN structure. When a photon of sufficient energy strikes the diode, it excites an electron thereby creating a mobile electron and a positively charged electron hole. If the absorption occurs in the junctions depletion
21

region, or one diffusion length away from it, these carriers are swept from the junction by the built-in field of the depletion region. Thus holes move towards the anode and electrons towards the cathode and a photocurrent is produced.

MATERIALS
The material used to make a photodiode is critical to define its properties, because only photons with sufficient energy to excite electrons across the materials band gap will produce significant photocurrents.

Table (2.2): Materials commonly used to produce photodiodes include FEATURES


Critical performance parameters of a photodiode include: 1) Excellent linearity with respect to incident light 2) Low noise 3) Wide spectral response 4) Mechanically rugged 5) Compact and lightweight 6)Longlife

22

CHAPTER 3 HARDWARE IMPLEMENTATION


3.1 SCHEMATIC DIAGRAM

Fig.(3.1): Schematic diagram

23

3.2 SCHEMATIC DESCRIPTION POWER SUPPLY


The schematic diagram gives the basic hardware connections used in the project. Beginning from the power supply the secondary of the step-down transformer wires are given to the two ends (2, 4) of bridge rectifier which is having four diodes in the bridge format. The other two ends (1, 3) are connected to the input (pin1) and output (pin3) of the 7805 regulator and pin 2 is connected to ground as shown in schematic diagram. The 1000 micro farad capacitor is connected in between the bridge rectifier and regulator to eliminate the ac ripples presented in the rectified output. The 100microfarad capacitor is used to eliminate the noise at regulator output. Now 5V is available at the pin 3 of regulator and connected to pin 40 of microcontroller.

AT89S51 MICROCONTROLLER
The 8051 microcontroller consist 40 pins and every pin has its ownfunctionality as shown in the schematic diagram. The port 0 is having the pull up resistor which is having eight 10K resistors in parallel each connected to the each pin of it.

IR LED
The IR LED is arranged with a resistor, in such a way that Vcc is applied to the positive terminal of the IR LED. These are connected to the port 1 of the microcontroller.

IR RECEIVER
The IR receivers are arranged with the transistor logic as shown in the schematic diagram. The two transistors are connected in such a manner that collector terminal is connected to the base terminal of the other. The photo diode is connected to the base of the transistor along with the combination of the resistor. The IR Receivers are connected to the different ports of the microcontroller.

24

CHAPTER 4 SOFTWARE IMPLEMENTATION


4.1. SOFTWARE TOOLS 4.1.1. ABOUT SOFTWARE
Software used is: *Keil software for C programming *Express PCB for lay out design *Express SCH for schematic design

KEIL VISION3
Vision3 is an IDE (Integrated Development Environment) that helps you write, compile, anddebug embedded programs. It encapsulates the following components:

A project manager. A make facility. Tool configuration. Editor. A powerful debugger. This software is used for execution of microcontroller programs.Keil development

tools for the MC architecture support every level of software developer fromthe professional applications engineer to the student just learning about embedded softwaredevelopment. The industry-standard keil C compilers, macro assemblers, debuggers,real, time Kernels, Single-boardcomputers and emulators support all avr derive--atives and help you to get more projects completed onschedule. The keil software development tools are designed to solve the complex problems facingembedded software developers.

25

When starting a new project, simply select the microcontroller you the device database and the vision IDE sets all compiler, assembler, linker, and memory options for you.

Numerous example programs are included to help you get started with the most popular embedded avr devices

The keil Vision debugger accurately simulates on-chip peripherals(PC, CAN, UART, SPI, Interrupts ,I/O ports, A/D converter, D/A converter and PWM modules)of your avr device. Simulation helps you understand h/w configurations and avoids time wasted on setup problems. Additionally, with simulation, you can write and test applications before target h/w is available.

When you are ready to begin testing your s/w application with target h/w, use the MON51,MON390, MONADI, or flash MON51 target monitors, the ISD51 InSystem Debugger, or the ULINK USB-JTAG adapter to download and test program code on your target system.

EXPRESS PCB
Express PCB is a Circuit Design Software and PCB manufacturing service. One can learnalmost everything you need to know about Express PCB from the help topics included with the programsgiven. Details: Express PCB, Version 5.6.0

EXPRESS SCH
The Express SCH schematic design program is very easy to use. This software enables the user to draw the Schematics with drag and drop options. A Quick Start Guide is provided by which the user can learn how to use it. Details: Express SCH, Version 5.6.0

26

EMBEDDED C
The programming Language used here in this project is anEmbeddedCLanguage. ThisEmbedded C Language is different from the generic C language in few things like a)Data types b)Access over the architecture addresses The Embedded C Programming Language forms the user friendly language with access over Portaddresses, SFR Register addresses etc. Signed char: o Used to represent the - or + values. o As a result, we have only 7 bits for the magnitude of the signed number, giving us values from -128 to +127.

EMBEDDED C DATA TYPES

4.2 KEIL SOFTWARE


The Keil development tools are designed to solve the complex problems facing embedded software developers

27

4.2.1 BUILDING AN APPLICATION IN VISION2


To build (compile, assemble, and link) an application inVision2, you must: 1. Select Project - (for example, 166\EXAMPLES\HELLO\HELLO.UV2). 2. Select Project - Rebuild all target files or Build target.Vision2 compiles, assembles, and links the files in your project.

CREATING YOUR OWN APPLICATIONINVISION2 TO CREATE A NEW PROJECT IN VISION2, YOU MUST
1. Select Project - New Project. 2. Select a directory and enter the name of the project file. 3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from the Device DatabaseTM. 4. Create source files to add to the project. 5. Select Project - Targets, Groups, Files, Add/Files, select Source Group1, and add the source files to the project. 6. Select Project - Options and set the tool options. Note when you select the target device from the Device Database all special options are set automatically. You typically only need to configure the memory map of your target hardware. Default memory model settings are optimal for most applications. 7. Select Project - Rebuild all target files or Build target.

DEBUGGING AN APPLICATION IN VISION2


To debug an application created usingVision2, you must: 1. Select Debug - Start/Stop Debug Session. 2. Use the Step toolbar buttons to single-step through your program. You may enterG, mainin the Output Window to execute to the main C function. 3. Open the Serial Window using the Serial #1button on the toolbar. Debug your program using standard options like Step, Go, Break, and so on.

28

STARTING VISION2 AND CREATING A PROJECT


Vision2 is a standard Windows application and started by clicking on the program icon. To create a new project file select from theVision2 menuProject- New Project. This opens a standard Windows dialog that asks you for the new project filename. We suggest that you use a separate folder for each project. You can simply use the icon CreateNew Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project1. Vision2 creates a new project file with the name PROJECT1.UV2 which contains a default target and file group name. You can see these names in the Project

WINDOW - FILES
Now use from the menu Project Select Device for Target and select a CPU for your project. TheSelect Device dialog box shows theVision2 device database. Just select the microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU. This selection sets necessary tool options forthe 80C51RD+ device and simplifies in this way the tool Configuration

4.2.2 BUILDING PROJECTS AND CREATING A HEX FILES


Typical, the tool settings under Options - Target are all you need to start a new application. You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors,Vision2 will display errors and warning messages in the Output Window - Build page. A double click on a message line opens the source file on the correct location in aVision2 editor window. Once you have successfully generated your application you can start debugging. After you have tested your application, it is required to create an Intel HEX file to download thesoftware into an EPROM programmer or simulator.Vision2 creates HEX files with each build processwhen Create HEX files under Options for Target - Output is
29

enabled. You may start your PROMprogramming utility after the make process when you specify the program under the option Run UserProgram #1.

CPUSIMULATION
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped for read,write, or code execution access. TheVision2 simulator traps and reports illegal memory accesses beingdone. In addition to memory mapping, the simulator also provides support for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU you have selected are configured fromthe Device.

DATABASE SELECTION
You have made when you create your project target. Refer to page 58 for more Informationabout selecting a device. You may select and display the on-chip peripheral components using theDebug menu. You can also change the aspects of each peripheral using the controls in the dialog boxes.

START DEBUGGING
You start the debug mode of Vision2 with the Debug - Start/Stop Debug Session command.Depending on the Options for Target - Debug Configuration,Vision2 will load the application program and run the startup codeVision2 saves the editor screen layout and restores the screen layout of thelast debug session. If the program execution stops,Vision2 opens an editor window with the sourcetext or shows CPU instructions in the disassembly window. The next executable statement is markedwith a yellow arrow. During debugging, most editor features are still available. For example, you can use the find command or correct program errors. Program source text of your application is shown in the same windows. TheVision2 debug mode differs from the edit mode inthe following aspects:

30

- The Debug Menu and Debug Commands described on page 28 are Available. The additional debugwindows are discussed in the following. - The project structure or tool parameters cannot be modified. All build Commands are disabled.

DISASSEMBLYWINDOW
The Disassembly window shows your target program as mixed source and assembly program or just assembly code. A trace history of previously executed instructions may be displayed with Debug -View Trace Records. To enable the trace history, set Debug -Enable/Disable Trace Recording. If you select the Disassembly Window as the active window all program step commands work on CPUinstruction level rather than program source lines. You can select a text line and set or modify codebreakpoints using toolbar buttons or the context menu commands. You may use the dialog Debug - Inline Assembly. to modify the CPU instructions. That allowsyou to correct mistakes or to make temporary changes to the target program you are debugging

31

CHAPTER 5 RESULT
5. RESULT
This project showed a tremendous result in monitoring and controlling the traffic by giving green signal for more amount of time to the road which had heavy traffic and quite less time to the junction having less traffic, thereby reducing the traffic density

Fig 5.1Snapshot of the Circuit

32

CHAPTER 6 CONCLUSION AND FUTURE SCOPE


CONCLUSION
The project Traffic Density Analyzer Cum Signaling for Metro Cities has been successfully designed and tested. Integrating features of all the hardware components used have developed it. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.

FUTURE SCOPE
The future Scope of this project is, it can send the message according to traffic density, to other zones/traffic control room/FM stations by interfacing the GSM Modem.By this we can divert the people who were going in that way and to clear the traffic easily & the traffic density can be reduced.

33

You might also like