traffic signal image processing

38
3. ARM LPC 2148 It is the heart of the entire system and used for data analysis and storage. It will capture the all the answers feed by users and will do the comparison with standard answers enter by system operator. ARM7 is a generation of ARM processor designs. This generation introduced the Thumb 16-bit instruction set providing improved code density compared to previous designs. The most widely used ARM7 designs implement the ARMv4T architecture, but some implement ARMv3 or ARMv5TEJ. All these designs use a Von Neumann architecture , thus the few versions comprising a cache do not separate data and instruction caches. The NXP (founded by Philips) LPC2148 is an ARM7TDMI-S based high- performance 32-bit RISC Microcontroller with Thumb extensions 512KB on-chip Flash ROM with In-System Programming (ISP) and In-Application Programming (IAP), 32KB RAM, Vectored Interrupt Controller, Two 10bit ADCs with 14 channels, USB 2.0 Full Speed Device Controller, Two UARTs, one with full modem interface. Two I2C serial interfaces, Two SPI serial interfaces Two 32-bit timers, Watchdog Timer, PWM unit, Real Time Clock with optional battery backup, Brown out detect circuit General purpose I/O pins. CPU clock up to 60 MHz, On-chip crystal oscillator and On-chip PLL. Features and benefits 2.1 Key features * 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package. * 8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory.

Upload: gaus-patel

Post on 25-Dec-2015

223 views

Category:

Documents


2 download

DESCRIPTION

TRAFFIC SIGNAl

TRANSCRIPT

Page 1: Traffic Signal Image Processing

3. ARM LPC 2148

It is the heart of the entire system and used for data analysis and storage. It will capture the all the answers feed by users and will do the comparison with standard answers enter by system operator. ARM7 is a generation of ARM processor designs. This generation introduced the Thumb 16-bit instruction set providing improved code density compared to previous designs. The most widely used ARM7 designs implement the ARMv4T architecture, but some implement ARMv3 or ARMv5TEJ. All these designs use a Von Neumann architecture, thus the few versions comprising a cache do not separate data and instruction caches.

The NXP (founded by Philips) LPC2148 is an ARM7TDMI-S based high-performance 32-bit RISC Microcontroller with Thumb extensions 512KB on-chip Flash ROM with In-System Programming (ISP) and In-Application Programming (IAP), 32KB RAM, Vectored Interrupt Controller, Two 10bit ADCs with 14 channels, USB 2.0 Full Speed Device Controller, Two UARTs, one with full modem interface. Two I2C serial interfaces, Two SPI serial interfaces Two 32-bit timers, Watchdog Timer, PWM unit, Real Time Clock with optional battery backup, Brown out detect circuit General purpose I/O pins. CPU clock up to 60 MHz, On-chip crystal oscillator and On-chip PLL.

Features and benefits

2.1 Key features

* 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.

* 8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory.

128-bit wide interface/accelerator enables high-speed 60 MHz operation.

* In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot

loader software. Single flash sector or full chip erase in 400 ms and programming of

256 B in 1 ms.

* EmbeddedICE RT and Embedded Trace interfaces offer real-time debugging with the

on-chip RealMonitor software and high-speed tracing of instruction execution.

Page 2: Traffic Signal Image Processing

* USB 2.0 Full-speed compliant device controller with 2 kB of endpoint RAM.

In addition, the LPC2146/48 provides 8 kB of on-chip RAM accessible to USB by DMA.

* One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a total of 6/14

analog inputs, with conversion times as low as 2.44 s per channel.

* Single 10-bit DAC provides variable analog output (LPC2142/44/46/48 only).

* Two 32-bit timers/external event counters (with four capture and four compare

channels each), PWM unit (six outputs) and watchdog.

* Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input

An Introduction to the ARM 7 Architecture

The principle feature of the ARM 7 microcontroller is that it is a register based load-and-store architecture with a number of operating modes. While the ARM7 is a 32 bit microcontroller, it is also capable of running a 16-bit instruction set, known as “THUMB”. This helps it achieve a greater code density and enhanced power saving. While all of the register-to-register data processing instructions are single-cycle, other instructions such as data transfer instructions, are multi-cycle. To increase the performance of these instructions, the ARM 7 has a three-stage pipeline. Due to the inherent simplicity of the design and low gate count, ARM 7 is the industry leader in low-power processing on a watts per MIP basis. Finally, to assist the developer, the ARM core has a built-in JTAG debug port and on-chip “embedded ICE” that allows programs to be downloaded and fully debugged in-system.

In order to keep the ARM 7 both simple and cost-effective, the code and data regions are accessed via a single data bus. Thus while the ARM 7 is capable of single-cycle execution of all data processing instructions, data transfer instructions may take several cycles since they will require at least two accesses onto the bus (one for the instruction one for the data). In order to improve performance, a three stage pipeline is used that allows multiple instructions to be processed simultaneously.

The pipeline has three stages; FETCH, DECODE and EXECUTE. The hardware of each stage is designed to be independent so up to three instructions can be processed simultaneously. The pipeline is most effective in speeding up sequential code. However a branch instruction will cause the pipeline to be flushed marring its performance. As we shall see later the ARM 7 designers had some clever ideas to solve this problem.

ARM-3-StagePipeline

Page 3: Traffic Signal Image Processing

ARM7 Programming Model

The programmer’s model of the ARM 7 consists of 15 user registers, as shown in Fig. 3, with R15 being used as the Program Counter (PC). Since the ARM 7 is a load-and-store architecture, an user program must load data from memory into the CPU registers, process this data and then store the result back into memory. Unlike other processors no memory to memory instructions are available.

Fig 2 Load And Store Architecture

As stated above R15 is the Program Counter. R13 and R14 also have special functions; R13 is used as the stack pointer, though this has only been defined as a programming convention. Unusually the ARM instruction set does not have PUSH and POP instructions so stack handling is done via a set of instructions that allow loading and storing of multiple registers in a single operation. Thus it is possible to PUSH or POP the entire register set onto the stack in a single instruction. R14 has special significance and is called the “link register”. When a call is made to a procedure, the return address is automatically placed into R14, rather than onto a stack, as might be expected. A return can then be implemented by moving the contents of R14 into R15, the PC. For multiple calling trees, the contents of R14 (the link register) must be placed onto the stack.

Page 4: Traffic Signal Image Processing

.

Fig 3 User Mode Register Model

In addition to the 16 CPU registers, there is a current program status register (CPSR). This contains a set of condition code flags in the upper four bits that record the result of a previous instruction, as shown in Fig 4. In addition to the condition code flags, the CPSR contains a number of user-configurable bits that can be used to change the processor mode, enter Thumb processing and enable/disable interrupts.

Page 5: Traffic Signal Image Processing

Current Program Status Register and Flags

Exception and Interrupt Modes

The ARM 7 architecture has a total of six different operating modes, as shown below. These modes are protected or exception modes which have associated interrupt sources and their own register sets.

User: This mode is used to run the application code. Once in user mode the CPSR cannot be written to and modes can only be changed when an exception is generated.

FIQ: (Fast Interrupt reQuest) This supports high speed interrupt handling. Generally it is used for a single critical interrupt source in a system

IRQ: (Interrupt ReQuest) This supports all other interrupt sources in a system

Supervisor: A “protected” mode for running system level code to access hardware or run OS calls. The ARM 7 enters this mode after reset.

Abort: If an instruction or data is fetched from an invalid memory region, an abort exception will be generated

Undefined Instruction: If a FETCHED opcode is not an ARM instruction, an undefined instruction exception will be generated.

The User registers R0-R7 are common to all operating modes. However FIQ mode has its own R8 –R14 that replace the user registers when FIQ is entered. Similarly, each of the other modes have their own

Page 6: Traffic Signal Image Processing

R13 and R14 so that each operating mode has its own unique Stack pointer and Link register. The CPSR is also common to all modes. However in each of the exception modes, an additional register - the saved program status register (SPSR), is added. When the processor changes the current value of the CPSR stored in the SPSR, this can be restored on exiting the exception-mode.

Page 7: Traffic Signal Image Processing

Fig 5 Full Register Set For ARM 7

Entry to the Exception modes is through the interrupt vector table. Exceptions in the ARM processor can be split into three distinct types.

(i) Exceptions caused by executing an instruction, these include software interrupts, undefined instruction exceptions and memory abort exceptions

(ii) Exceptions caused as a side effect of an instruction such as a abort caused by trying to fetch data from an invalid memory region.

(iii) Exceptions unrelated to instruction execution, this includes reset, FIQ and IRQ interrupts

Page 8: Traffic Signal Image Processing

Types of Power Supply

There are many types of power supply. Most are designed to convert high voltage AC mains electricity to a suitable DC 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 5V regulated supply

.

Each of the blocks is described in more detail below:

Transformer - steps down high voltage AC mains to low voltage AC. Rectifier - converts AC to DC, but the DC output is varying. Smoothing - smooths the DC from varying greatly to a small ripple. Regulator - eliminates ripple by setting DC output to a fixed voltage.

Page 9: Traffic Signal Image Processing

Transformer

Transformer circuit symbol

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 voltage, step-down transformers reduce voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in UK) 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

Page 10: Traffic Signal Image Processing

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.

turns ratio = Vp

= Np

and power out = power in

Vs Ns Vs × Is = Vp × Ip

Vp = primary (input) voltageNp = number of turns on primary coilIp = primary (input) current

Vs = secondary (output) voltageNs = number of turns on secondary coilIs = secondary (output) current

Bridge rectifierA bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses all the AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifier

Root Mean Square (RMS) Values

The value of an AC voltage is continually changing from zero up to the positive peak, through zero to the negative peak and back to zero again. Clearly for most of the time it is less than the peak voltage, so this is not a good measure of its real effect.

Page 11: Traffic Signal Image Processing

Instead we use the root mean square voltage (VRMS) which is 0.7 of the peak voltage (Vpeak):

VRMS = 0.7 × Vpeak and Vpeak = 1.4 × VRMS

These equations also apply to current. They are only true for sine waves (the most common type of AC) because the 0.7 and 1.4 are different values for other shapes.

The RMS value is the effective value of a varying voltage or current. It is the equivalent steady DC (constant) value which gives the same effect.

For example a lamp connected to a 6V RMS AC supply will light with the same brightness when connected to a steady 6V DC supply. However, the lamp will be dimmer if connected to a 6V peak AC supply because the RMS value of this is only 4.2V (it is equivalent to a steady 4.2V DC).

You may find it helps to think of the RMS value as a sort of average, but please remember that it is NOT really the average! In fact the average voltage (or current) of an AC signal is zero because the positive and negative parts exactly cancel out

Page 12: Traffic Signal Image Processing

Bridge rectifierAlternate pairs of diodes conduct, changing overthe connections so the alternating directions ofAC are converted to the one direction of DC.

Smoothing

Page 13: Traffic Signal Image Processing

Smoothing 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. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

Note that smoothing significantly increases the average DC voltage to almost the peak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this increases to almost the peak value giving 1.4 × 4.6 = 6.4V smooth DC.

Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation below gives the required value for the smoothing capacitor. A larger capacitor will give less ripple. The capacitor value must be doubled when smoothing half-wave DC.

Smoothing capacitor for 10% ripple, C =

5 × Io

Vs × f

C  = smoothing capacitance in farads (F)Io  = output current from the supply in amps (A)Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DCf    = frequency of the AC supply in hertz (Hz), 50Hz in the UK

Page 14: Traffic Signal Image Processing

Voltage regulator

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection').

Many of the fixed voltage regulator ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right. They include a hole for attaching a heatsink if necessary.

Page 15: Traffic Signal Image Processing

POWER SUPPLY:

Regulator:

Regulator is used to convert unregulated dc voltage to regulated dc voltage.

Regulator IC 7812:

We require fixed regulated voltage of 12V with output current of 1A.Here we select three

terminal Positive voltage regulators IC 7812 which gives 12V dc output voltage.

Input to this regulator IC must be greater than the output voltage plus drop

across the IC. The voltage drop across IC7805 is 3.5V.

So,

Input to regulator = output voltage + drop across IC7812

= 12+2.5

= 14.5V

For proper output input to the regulator must be greater than 14.5V.

Page 16: Traffic Signal Image Processing

Regulator IC 7805:

As we require one more supply of 5V.We can use same filtered output to get 5V dc .For this

purpose, we are using the IC 7805 which gives 5V dc output voltage. The input to this IC should

be in between 8V and 20V. Hence we can use this regulator IC 7805 in parallel with

regulator IC 7812.

Regulator IC LM 1117:

We require one more supply of 3.3V. For this purpose, we are using the IC LM 1117 which

gives 3.3V dc output voltage. Hence we can use this regulator IC LM 1117 in parallel with

regulator IC 7805.Output of 7805 applied to LM 1117. The LM1117 is a series of low dropout

voltage regulators with a dropout of 1.2V at 800mA of load current.

LM 117 will give output voltage of 3.3 V.

Page 17: Traffic Signal Image Processing

Interfacing the Serial / RS232 Port

The Serial Port is harder to interface than the Parallel Port. In most cases, any device you

connect to the serial port will need the serial transmission converted back to parallel so that

it can be used. This can be done using a UART. On the software side of things, there are

many more registers that you have to attend to than on a Standard Parallel Port. (SPP)

So what are the advantages of using serial data transfer rather than parallel?

1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25

volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as

5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel

port which has a maximum swing of 5 Volts. Therefore cable loss is not going to be as

much of a problem for serial cables than they are for parallel.

2. You don't need as many wires than parallel transmission. If your device needs to be

mounted a far distance away from the computer then 3 core cable (Null Modem

Configuration) is going to be a lot cheaper that running 19 or 25 core cable. However

you must take into account the cost of the interfacing at each end.

3. Infra Red devices have proven quite popular recently. You may of seen many electronic

diaries and palmtop computers which have infra red capabilities build in. However could

you imagine transmitting 8 bits of data at the one time across the room and being able to

(from the devices point of view) decipher which bits are which? Therefore serial

transmission is used where one bit is sent at a time. IrDA-1 (The first infra red

specifications) was capable of 115.2k baud and was interfaced into a UART. The pulse

length however was cut down to 3/16th of a RS232 bit length to conserve power

considering these devices are mainly used on diaries, laptops and palmtops.

4. Microcontroller's have also proven to be quite popular recently. Many of these have in

built SCI (Serial Communications Interfaces) which can be used to talk to the outside

Page 18: Traffic Signal Image Processing

world. Serial Communication reduces the pin count of these MPU's. Only two pins are

commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least

8 pins if you use a 8 bit Parallel method (You may also require a Strobe).

Hardware Properties

Devices which use serial cables for their communication are split into two categories.

These are DCE (Data Communications Equipment) and DTE (Data Terminal

Equipment.) Data Communications Equipment are devices such as your modem, TA

adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal.

The electrical specifications of the serial port is contained in the EIA (Electronics

Industry Association) RS232C standard. It states many parameters such as -

1. A "Space" (logic 0) will be between +3 and +25 Volts.

2. A "Mark" (Logic 1) will be between -3 and -25 Volts.

3. The region between +3 and -3 volts is undefined.

4. An open circuit voltage should never exceed 25 volts. (In Reference to

GND)

5. A short circuit current should not exceed 500mA. The driver should be

able to handle this without damage. (Take note of this one!)

Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum

Baud Rates etc are also included. For more information please consult the EIA RS232-C

standard. It is interesting to note however, that the RS232C standard specifies a

Page 19: Traffic Signal Image Processing

maximum baud rate of 20,000 BPS!, which is rather slow by today's standards. A new

standard, RS-232D has been recently released.

Serial Ports come in two "sizes", There are the D-Type 25 pin connector and the D-Type

9 pin connector both of which are male on the back of the PC, thus you will require a

female connector on your device. Below is a table of pin connections for the 9 pin and 25

pin D-Type connectors.

Serial Pinouts (D25 and D9 Connectors)

D-Type-25 Pin

No. D-Type-9 Pin No. Abbreviation Full Name

Pin 2 Pin 3 TD Transmit Data

Pin 3 Pin 2 RD Receive Data

Pin 4 Pin 7 RTS Request To Send

Pin 5 Pin 8 CTS Clear To Send

Pin 6 Pin 6 DSR Data Set Ready

Pin 7 Pin 5 SG Signal Ground

Pin 8 Pin 1 CD Carrier Detect

Pin 20 Pin 4 DTR Data Terminal Ready

Pin 22 Pin 9 RI Ring Indicator

Table 1 : D Type 9 Pin and D Type 25 Pin Connectors

Pin Functions

  Abbreviation Full Name Function

     TD Transmit Data Serial Data Output (TXD)

     RD Receive Data Serial Data Input (RXD)

     CTS Clear to Send This line indicates that the Modem is ready to exchange

Page 20: Traffic Signal Image Processing

data.

    DCD Data Carrier

Detect

When the modem detects a "Carrier" from the modem at

the other end of the phone line, this Line becomes active.

    DSR Data Set

Ready

This tells the UART that the modem is ready to establish a

link.

    DTR Data Terminal

Ready

This is the opposite to DSR. This tells the Modem that the

UART is ready to link.

    RTS Request To

Send

This line informs the Modem that the UART is ready to

exchange data.

    RI Ring Indicator Goes active when modem detects a ringing signal from the

PSTN.

Null Modems

A Null Modem is used to connect two DTE's together. This is commonly used as a cheap

way to network games or to transfer files between computers using Zmodem Protocol,

Xmodem Protocol etc. This can also be used with many Microprocessor Development

Systems.

Figure 1 : Null Modem Wiring Diagram

Above is my preferred method of wiring a Null Modem. It only requires 3 wires (TD, RD

& SG) to be wired straight through thus is more cost effective to use with long cable runs.

The theory of operation is reasonably easy. The aim is to make to computer think it is

talking to a modem rather than another computer. Any data transmitted from the first

Page 21: Traffic Signal Image Processing

computer must be received by the second thus TD is connected to RD. The second

computer must have the same set-up thus RD is connected to TD. Signal Ground (SG)

must also be connected so both grounds are common to each computer.

The Data Terminal Ready is looped back to Data Set Ready and Carrier Detect on both

computers. When the Data Terminal Ready is asserted active, then the Data Set Ready

and Carrier Detect immediately become active. At this point the computer thinks the

Virtual Modem to which it is connected is ready and has detected the carrier of the other

modem.

All left to worry about now is the Request to Send and Clear To Send. As both computers

communicate together at the same speed, flow control is not needed thus these two lines

are also linked together on each computer. When the computer wishes to send data, it

asserts the Request to Send high and as it's hooked together with the Clear to Send, It

immediately gets a reply that it is ok to send and does so.

Notice that the ring indicator is not connected to anything of each end. This line is only

used to tell the computer that there is a ringing signal on the phone line. As we don't have

a modem connected to the phone line this is left disconnected

DTE / DCE Speeds

We have already talked briefly about DTE & DCE. A typical Data Terminal Device is a

computer and a typical Data Communications Device is a Modem. Often people will talk

about DTE to DCE or DCE to DCE speeds. DTE to DCE is the speed between your

modem and computer, sometimes referred to as your terminal speed. This should run at

faster speeds than the DCE to DCE speed. DCE to DCE is the link between modems,

sometimes called the line speed.

Page 22: Traffic Signal Image Processing

Most people today will have 28.8K or 33.6K modems. Therefore we should expect the

DCE to DCE speed to be either 28.8K or 33.6K. Considering the high speed of the

modem we should expect the DTE to DCE speed to be about 115,200 BPS.(Maximum

Speed of the 16550a UART) This is where some people often fall into a trap. The

communications program which they use have settings for DCE to DTE speeds. However

they see 9.6 KBPS, 14.4 KBPS etc and think it is your modem speed.

Today's Modems should have Data Compression build into them. This is very much like

PK-ZIP but the software in your modem compresses and decompresses the data. When

set up correctly you can expect compression ratios of 1:4 or even higher. 1 to 4

compression would be typical of a text file. If we were transferring that text file at 28.8K

(DCE-DCE), then when the modem compresses it you are actually transferring 115.2

KBPS between computers and thus have a DCE-DTE speed of 115.2 KBPS. Thus this is

why the DCE-DTE should be much higher than your modem's connection speed.

Some modem manufacturers quote a maximum compression ratio as 1:8. Lets say for

example its on a new 33.6 KBPS modem then we may get a maximum 268,800 BPS

transfer between modem and UART. If you only have a 16550a which can do 115,200

BPS tops, then you would be missing out on a extra bit of performance. Buying a 16C650

should fix your problem with a maximum transfer rate of 230,400 BPS.

However don't abuse your modem if you don't get these rates. These are MAXIMUM

compression ratios. In some instances if you try to send a already compressed file, your

modem can spend more time trying the compress it, thus you get a transmission speed

less than your modem's connection speed. If this occurs try turning off your data

compression. This should be fixed on newer modems. Some files compress easier than

others thus any file which compresses easier is naturally going to have a higher

compression ratio.

Flow Control

Page 23: Traffic Signal Image Processing

So if our DTE to DCE speed is several times faster than our DCE to DCE speed the PC

can send data to your modem at 115,200 BPS. Sooner or later data is going to get lost as

buffers overflow, thus flow control is used. Flow control has two basic varieties,

Hardware or Software.

Software flow control, sometimes expressed as Xon/Xoff uses two characters Xon and

Xoff. Xon is normally indicated by the ASCII 17 character where as the ASCII 19

character is used for Xoff. The modem will only have a small buffer so when the

computer fills it up the modem sends a Xoff character to tell the computer to stop sending

data. Once the modem has room for more data it then sends a Xon character and the

computer sends more data. This type of flow control has the advantage that it doesn't

require any more wires as the characters are sent via the TD/RD lines. However on slow

links each character requires 10 bits which can slow communications down.

Hardware flow control is also known as RTS/CTS flow control. It uses two wires in your

serial cable rather than extra characters transmitted in your data lines. Thus hardware

flow control will not slow down transmission times like Xon-Xoff does. When the

computer wishes to send data it takes active the Request to Send line. If the modem has

room for this data, then the modem will reply by taking active the Clear to Send line and

the computer starts sending data. If the modem does not have the room then it will not

send a Clear to Send.

Serial Port's Registers (PC's)

Port Addresses & IRQ's

Name Address IRQ

COM 1 3F8 4

COM 2 2F8 3

COM 3 3E8 4

Page 24: Traffic Signal Image Processing

COM 4 2E8 3

Table 3 : Standard Port Addresses

Above is the standard port addresses. These should work for most P.C's. If you just

happen to be lucky enough to own a IBM P/S2 which has a micro-channel bus, then

expect a different set of addresses and IRQ's. Just like the LPT ports, the base addresses

for the COM ports can be read from the BIOS Data Area.

Start Address Function

0000:0400 COM1's Base Address

0000:0402 COM2's Base Address

0000:0404 COM3's Base Address

0000:0406 COM4's Base Address

Table 4 - COM Port Addresses in the BIOS Data Area;

The above table shows the address at which we can find the Communications (COM)

ports addresses in the BIOS Data Area. Each address will take up 2 bytes

LCD (Liquid Crystal Display) screen is an electronic display

module and find a wide range of applications. A 16x2 LCD display

is very basic module and is very commonly used in various

Page 25: Traffic Signal Image Processing

devices and circuits. These modules are preferred over seven

segments and other multi segment LEDs. The reasons being:

LCDs are economical; easily programmable; have no limitation of

displaying special & even custom characters (unlike in seven

segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there

are 2 such lines. In this LCD each character is displayed in 5x7

pixel matrix. This LCD has two registers, namely, Command and

Data.

The command register stores the command instructions given to

the LCD. A command is an instruction given to LCD to do a

predefined task like initializing it, clearing its screen, setting the

cursor position, controlling display etc. The data register stores

the data to be displayed on the LCD. The data is the ASCII value

of the character to be displayed on the LCD.

 

Pin Diagram: 

Page 26: Traffic Signal Image Processing
Page 27: Traffic Signal Image Processing

Pin Description:  Pin No

 Function  Name

1 Ground (0V) Ground2 Supply voltage; 5V (4.7V – 5.3V)  Vcc3 Contrast adjustment; through a variable

resistor VEE

4 Selects command register when low; and data register when high

Register Select

5 Low to write to the register; High to read from the register

Read/write

6 Sends data to data pins when a high to low pulse is given

Enable

7

8-bit data pins

DB08 DB19 DB2

10 DB311 DB412 DB513 DB614 DB715 Backlight VCC (5V) Led+16 Backlight Ground (0V) Led-

Page 28: Traffic Signal Image Processing

Working Of Project

We propose a new traffic Control System that will control the congestion problem of

traffic through traffic signals on the basis of current traffic density.

The current traffic light system is fixed. It has fixed time interval to pass the traffic

from either side of the road, which creates the congestion problem. Our Smart traffic

control system solves this problem on real time basis. It will observe the traffic

condition then it will take decision of period of

Microcontroller. The Microcontroller will receive the count from MATLAB

software We have defined three different conditions and based of these condition the

Microcontroller will provide delay to the traffic signal.

Density ofTime Interval

Vehicles (in Seconds)

Red

Low 30

Medium 20

High 10

So as the vehicle density increases on the road the interval of green signal and red will change. Now if there is very high traffic congestion on some roads. So we are also installing the Digital Display (LCD)

Page 29: Traffic Signal Image Processing

Flowchart:

STOP

SIGNAL TIME 1 SECIDENSITY

HIGH ?

SIGNAL TIME 3 SECIDENSITY

LOW ?

READ THE IR O/P

Process MATLAB data

START

Page 30: Traffic Signal Image Processing

Advantages

Time saving system

Very reliable as compare to manual methods

Highly secured system

Applications

Prepaid parking system

Shopping Mall s

Car tracking systems