Vous êtes sur la page 1sur 79

Page |1

1. INTRODUCTION
An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. Personal digital assistants (PDAs) or handheld computers are generally considered embedded devices because of the nature of their hardware design, even though they are more expandable in software terms. This line of definition continues to blur as devices expand. Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. In terms of complexity embedded systems can range from very simple with a single microcontroller chip, to very complex with multiple units, peripherals and networks mounted inside a large chassis or enclosure.

Examples of embedded systems


Automatic teller machines (ATMs) Avionics, such as inertial guidance systems, flight control hardware/software and other integrated systems in aircraft and missiles

Cellular telephones and telephone switches engine controllers and antilock brake controllers for automobiles Home automation products, such as thermostats, air conditioners, sprinklers, and security monitoring systems

Handheld calculators

Page |2

Handheld computers Household appliances, including microwave ovens, washing machines, television sets, DVD players and recorders

Medical equipment Personal digital assistant Videogame consoles Computer peripherals such as routers and printers Industrial controllers for remote machine operation.

1.1 History
In the earliest years of computers in the 1940s, computers were sometimes dedicated to a single task, but were too large to be considered "embedded". Over time however, the concept of programmable controllers developed from a mix of computer technology, solid state devices, and traditional electromechanical sequences. The first recognizably modern embedded system was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo project. The use of the then new monolithic integrated circuits, to reduce the size and weight, increased this risk. The first mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman (missile), released in 1961. It was built from transistor logic and had a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits. This program alone reduced prices on quad nand gate ICs from $1000/each to $3/each, permitting their use in commercial products. Since these early applications in the 1960s, embedded systems have come down in price. There has also been an enormous rise in processing power and functionality. For

Page |3 example the first microprocessor was the Intel 4004, which found its way into calculators and other small systems, but required external memory and support chips. In 1978 National Engineering Manufacturers Association released the standard for a programmable microcontroller. The definition was an almost any computer-based controller. They included single board computers, numerical controllers, and sequential controllers in order to perfom event-based instructions. By the mid-1980s, many of the previously external system components had been integrated into the same chip as the processor, resulting in integrated circuits called microcontrollers, and widespread use of embedded systems became feasible. As the cost of a microcontroller fell below $1, it became feasible to replace expensive knob-based analog components such as potentiometers and variable capacitors with digital electronics controlled by a small microcontroller with up/down buttons or knobs. By the end of the 80s, embedded systems were the norm rather than the exception for almost all electronics devices, a trend which has continued since.

1.2 Characteristics
Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs. An embedded system is not always a separate block - very often it is physically built-in to the device it is controlling. The software written for embedded systems is often called firmware, and is stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory.

User interfaces
Embedded systems range from no user interface at all - dedicated only to one task - to full user interfaces similar to desktop operating systems in devices such as PDAs.

Simple systems

Page |4 Simple embedded devices use buttons, LEDs, and small character- or digit-only displays, often with a simple menu system.

In more complex systems


A full graphical screen, with touch sensing or screen-edge buttons provides 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. The rise of the World Wide Web has given embedded designers another quite different option: providing a web page interface over a network connection. This avoids the cost of a sophisticated display, yet provides complex input and display capabilities when needed, on another computer. This is successful for remote, permanently installed equipment. In particular, routers take advantage of this ability.

CPU platform
Embedded processors can be broken into two distinct categories: microprocessors (P) and micro controllers (C). Micro controllers have built-in peripherals on the chip, reducing size of the system. There are many different CPU architectures used in embedded designs such as ARM, MIPS, Coldfire/68k, PowerPC, x86, PIC, 8051, Atmel AVR, Renesas H8, SH, V850, FR-V, M32R, Z80, Z8, etc. This in contrast to the desktop computer market, which is currently limited to just a few competing architectures. PC/104 and PC/104+ are a typical base for small, low-volume embedded and rugged system design. These often use DOS, Linux, NetBSD, or an embedded real-time operating system such as QNX or VxWorks. A common configuration for very-high-volume embedded systems is the system on a chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was purchased and added as part of the chip design. A related scheme is to use a

Page |5 field-programmable gate array (FPGA), and program it with all the logic, including the CPU.

1.3 Peripherals
Embedded Systems talk with the outside world via peripherals, such as:

Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485 etc Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI Universal Serial Bus (USB) Networks: Controller Area Network, LonWorks, etc Timers: PLL(s), Capture/Compare and Time Processing Units Discrete IO: aka General Purpose Input Output (GPIO)

Tools
As for other software, embedded system designers use compilers, assemblers, and debuggers to develop embedded system software. However, they may also use some more specific tools:

An in-circuit emulator (ICE) is a hardware device that replaces or plugs into the microprocessor, and provides facilities to quickly load and debug experimental code in the system.

Utilities to add a checksum or CRC to a program, so the embedded system can check if the program is valid.

For systems using digital signal processing, developers may use a math workbench such as MathCad or Mathematica to simulate the mathematics.

Custom compilers and linkers may be used to improve optimization for the particular hardware.

Page |6

An embedded system may have its own special language or design tool, or add enhancements to an existing language.

Software tools can come from several sources:


Software companies that specialize in the embedded market Ported from the GNU software development tools Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor

1.4 Debugging
Embedded Debugging may be performed at different levels, depending on the facilities available, ranging from assembly- or source-level debugging with an in-circuit emulator or in-circuit debugger, to output from serial debug ports or JTAG/Nexus interfaces, to an emulated environment running on a personal computer. As the complexity of embedded systems grows, higher level tools and operating systems are migrating into machinery where it makes sense. For example, cell phones, personal digital assistants and other consumer computers often need significant software that is purchased or provided by a person other than the manufacturer of the electronics. In these systems, an open programming environment such as Linux, NetBSD, OSGi or Embedded Java is required so that the third-party software provider can sell to a large market.

Reliability
Embedded systems often reside in machines that are expected to run continuously for years without errors, and in some cases recover by themselves if an error occurs. Therefore the software is usually developed and tested more carefully than that for personal computers, and unreliable mechanical moving parts such as disk drives, switches or buttons are avoided. Recovery from errors may be achieved with techniques such as a watchdog timer that resets the computer unless the software periodically notifies the watchdog.

Page |7 Specific reliability issues may include: 1. The system cannot safely be shut down for repair, or it is too inaccessible to repair. Solutions may involve subsystems with redundant spares that can be switched over to, or software "limp modes" that provide partial function. Examples include space systems, undersea cables, navigational beacons, borehole systems, and automobiles. 2. The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often backups are selected by an operator. Examples include aircraft navigation, reactor control systems, safety-critical chemical factory controls, train signals, engines on single-engine aircraft. 3. The system will lose large amounts of money when shut down: Telephone switches, factory controls, bridge and elevator controls, funds transfer and market making, automated sales and service.

High vs Low Volume


For high volume systems such as portable music players or mobile phones, minimizing cost is usually the primary design consideration. Engineers typically select hardware that is just good enough to implement the necessary functions. For lowvolume or prototype embedded systems, general purpose computers may be adapted by limiting the programs or by replacing the operating system with a real-time operating system.

Embedded software architectures


There are several different types of software architecture in common use.

Simple control loop In this design, the software simply has a loop. The loop calls subroutines, each of which manages a part of the hardware or software. Interrupt controlled system

Page |8 Some embedded systems are predominantly interrupt controlled. This means that tasks performed by the system are triggered by different kinds of events. An interrupt could be generated for example by a timer in a predefined frequency, or by a serial port controller receiving a byte. These kinds of systems are used if event handlers need low latency and the event handlers are short and simple. Usually these kinds of systems run a simple task in a main loop also, but this task is not very sensitive to unexpected delays. The tasks performed in the interrupt handlers should be kept short to keep the interrupt latency to a minimum. Some times longer tasks are added to a queue structure in the interrupt handler to be processed in the main loop later. This method brings the system close to a multitasking kernel with discrete processes. Cooperative multitasking A no preemptive multitasking system is very similar to the simple control loop scheme, except that the loop is hidden in an API. The programmer defines a series of tasks, and each task gets its own environment to "run" in. Then, when a task is idle, it calls an idle routine (usually called "pause", "wait", "yield", etc.). The advantages and disadvantages are very similar to the control loop, except that adding new software is easier, by simply writing a new task, or adding to the queueinterpreter. Preemptive multitasking In this type of system, a low-level piece of code switches between tasks based on a timer. This is the level at which the system is generally considered to have an "operating system", and introduces all the complexities of managing multiple tasks running seemingly at the same time. Any piece of task code can damage the data of another task; they must be precisely separated. Access to shared data must be controlled by some synchronization strategy, such as message queues, semaphores or a nonblocking synchronization scheme.

Page |9 Because of these complexities, it is common for organizations to buy a real-time operating system, allowing the application programmers to concentrate on device functionality rather than operating system services.

EMBEDDED APPLICATIONS:
Navigation system using a GPS receiver; Communications systems for protocol conversion and VoIP; Mobile data applications using BREWMP3 player and salary survey; Real-time systems using RTLinuxprinting, messaging and more; Windows CE database applications salary survey and energy meter reading; Networked information appliances using the HP Chai Appliance PlatformCRM, location-based services and more; Mobile Java applianceselectronic city guide, Jini appliance control, ACRemote application; Windows XP embedded applications air conditioner remote control, audio player remote control, typing speed indicator, database application, electronic voting.

P a g e | 10

2. GENERAL DESCRIPTION
The different blocks used in our project GSM based instantaneous vehicle registration details extraction system very useful for Traffic police are discussed here.

2.1 Power supply


There are many types of power supply. Most 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. For example a 5V regulated supply:

P a g e | 11

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.

Power supplies made from these blocks are described below with a circuit diagram and a graph of their output:

Transformer only Transformer + Rectifier Transformer + Rectifier + Smoothing Transformer + Rectifier + Smoothing + Regulator

Dual Supplies
Some electronic circuits require a power supply with positive and negative outputs as well as zero volts (0V). This is called a 'dual supply' because it is like two ordinary supplies connected together as shown in the diagram. Dual supplies have three outputs, for example a 9V supply has +9V, 0V and -9V outputs. Transformer only

P a g e | 12

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor. Transformer + Rectifier

The varying DC output is suitable for lamps, heaters and standard motors. It is not suitable for electronic circuits unless they include a smoothing capacitor.

Transformer + Rectifier + Smoothing

P a g e | 13

The smooth DC output has a small ripple. It is suitable for most electronic circuits. Transformer + Rectifier + Smoothing + Regulator

The regulated DC output is very smooth with no ripple. It is suitable for all electronic circuits.

Transformer

P a g e | 14 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. Transformer circuit symbol

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 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. Vp Vs Np Ns power out = power in Vs Is = Vp Ip

turns ratio = Rectifier

and

There are several ways of connecting diodes to make a rectifier to convert AC to DC. The bridge rectifier is the most important and it produces full-wave varying DC. A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce halfwave varyingDC.

P a g e | 15

A 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 Vp = primary (input) voltage Vs = secondary (output) voltage Np = number of turns on primary coil Ip = primary (input) current Ns = number of turns on secondary coil Is = secondary (output) current

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

Bridge rectifier Alternate pairs of diodes conduct, changing over the connections so the alternating directions of AC are converted to the one direction of DC.

Output: full-wave varying DC (using all the AC wave)

P a g e | 16

Single diode rectifier


A single diode can be used as a rectifier but this produces half-wave varying DC which has gaps when the AC is negative. It is hard to smooth this sufficiently well to supply electronic circuits unless they require a very small current so the smoothing capacitor does not significantly discharge during the gaps. Please see the Diodes page for some examples of rectifier diodes.

Fig1.2 Single diode rectifier

Output:

half-wave

varying

DC

(using only half the AC wave)

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

P a g e | 17

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

2.2 GSM
Global System for Mobile communications (GSM): originally from Groupe Spcial Mobile) is the most popular standard for mobile phones in the world. Its promoter, the GSM Association, estimates that 82% of the global mobile market uses the standard. GSM is used by over 2 billion people across more than 212 countries and territories. Its ubiquity makes international roaming very common between mobile phone operators, enabling subscribers to use their phones in many parts of the world. GSM differs from its predecessors in that both signaling and speech channels are digital call quality, and so is considered a second generation (2G) mobile phone system.

P a g e | 18 This has also meant that data communication was built into the system using the 3rd Generation Partnership Project (3GPP). The GSM logo is used to identify compatible handsets and equipment. The key advantage of GSM systems to consumers has been better voice quality and low-cost alternatives to making calls, such as the Short message service (SMS, also called "text messaging"). The advantage for network operators has been the ease of deploying equipment from any vendors that implement the standard. Like other cellular standards, GSM allows network operators to offer roaming services so that subscribers can use their phones on GSM networks all over the world. Newer versions of the standard were backward-compatible with the original GSM phones. For example, Release '97 of the standard added packet data capabilities, by means of General Packet Radio Service (GPRS). Release '99 introduced higher speed data transmission using Enhanced Data Rates for GSM Evolution (EDGE).

History
In 1982, the European Conference of Postal and Telecommunications Administrations (CEPT) created the Groupe Spcial Mobile (GSM) to develop a standard for a mobile telephone system that could be used across Europe. In 1987, a memorandum of understanding was signed by 13 countries to develop a common cellular telephone system across Europe. In 1989, GSM responsibility was transferred to the European Telecommunications Standards Institute (ETSI) and phase I of the GSM specifications were published in 1990. The first GSM network was launched in 1991 by Radiolinja in Finland with joint technical infrastructure maintenance from Ericsson. By the end of 1993, over a million subscribers were using GSM phone networks being operated by 70 carriers across 48 countries.

Technical details
GSM is a cellular network, which means that mobile phones connect to it by searching for cells in the immediate vicinity. GSM networks operate in four different frequency ranges. Most GSM networks operate in the 900 MHz or 1800 MHz bands.

P a g e | 19 Some countries in the Americas (including Canada and the United States) use the 850 MHz and 1900 MHz bands because the 900 and 1800 MHz frequency bands were already allocated. The rarer 400 and 450 MHz frequency bands are assigned in some countries, notably Scandinavia, where these frequencies were previously used for first-generation systems. In the 900 MHz band the uplink frequency band is 890915 MHz, and the downlink frequency band is 935960 MHz. This 25 MHz bandwidth is subdivided into 124 carrier frequency channels, each spaced 200 kHz apart. Time division multiplexing is used to allow eight full-rate or sixteen half-rate speech channels per radio frequency channel. There are eight radio timeslots (giving eight burst periods) grouped into what is called a TDMA frame. Half rate channels use alternate frames in the same timeslot. The channel data rate is 270.833 kbit/s, and the frame duration is 4.615 ms. The transmission power in the handset is limited to a maximum of 2 watts in GSM850/900 and 1 watt in GSM1800/1900. GSM has used a variety of voice codecs to squeeze 3.1 kHz audio into between 5.6 and 13 kbit/s. Originally, two codecs, named after the types of data channel they were allocated, were used, called Half Rate (5.6 kbit/s) and Full Rate (13 kbit/s). These used a system based upon linear predictive coding (LPC). In addition to being efficient with bitrates, these codecs also made it easier to identify more important parts of the audio, allowing the air interface layer to prioritize and better protect these parts of the signal. GSM was further enhanced in 1997 with the Enhanced Full Rate (EFR) codec, a 12.2 kbit/s codec that uses a full rate channel. Finally, with the development of UMTS, EFR was refactored into a variable-rate codec called AMR-Narrowband, which is high quality and robust against interference when used on full rate channels, and less robust but still relatively high quality when used in good radio conditions on half-rate channels. There are four different cell sizes in a GSM networkmacro, micro, pico and umbrella cells. The coverage area of each cell varies according to the implementation environment. Macro cells can be regarded as cells where the base station antenna is installed on a mast or a building above average roof top level. Micro cells are cells whose antenna height is under average roof top level; they are typically used in urban areas.

P a g e | 20 Picocells are small cells whose coverage diameter is a few dozen meters; they are mainly used indoors. Umbrella cells are used to cover shadowed regions of smaller cells and fill in gaps in coverage between those cells. Cell horizontal radius varies depending on antenna height, antenna gain and propagation conditions from a couple of hundred meters to several tens of kilometers. The longest distance the GSM specification supports in practical use is 35 kilometres (22 mi). There are also several implementations of the concept of an extended cell, where the cell radius could be double or even more, depending on the antenna system, the type of terrain and the timing advance. Indoor coverage is also supported by GSM and may be achieved by using an indoor picocell base station, or an indoor repeater with distributed indoor antennas fed through power splitters, to deliver the radio signals from an antenna outdoors to the separate indoor distributed antenna system. These are typically deployed when a lot of call capacity is needed indoors, for example in shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also provided by in-building penetration of the radio signals from nearby cells. The modulation used in GSM is Gaussian minimum-shift keying (GMSK), a kind of continuous-phase frequency shift keying. In GMSK, the signal to be modulated onto the carrier is first smoothed with a Gaussian low-pass filter prior to being fed to a frequency modulator, which greatly reduces the interference to neighboring channels (adjacent channel interference).

Interference with audio devices


This is a form of RFI, and could be mitigated or eliminated by use of additional shielding and/or bypass capacitors in these audio devices. However, the increased cost of doing so is difficult for a designer to justify. It is a common occurrence for a nearby GSM handset to induce a "dit, dit di-dit, dit di-dit, dit di-dit" output on PA's, wireless microphones, home stereo systems, televisions, computers, cordless phones, and personal music devices. When these audio devices are in the near field of the GSM handset, the radio signal is strong enough that the solid state amplifiers in the audio chain act as a detector.

P a g e | 21 The clicking noise itself represents the power bursts that carry the TDMA signal. These signals have been known to interfere with other electronic devices, such as car stereos and portable audio players.

Network structure
The structure of a GSM network The network behind the GSM system seen by the customer is large and complicated in order to provide all of the services which are required. It is divided into a number of sections and these are each covered in separate articles.

the Base Station Subsystem (the base stations and their controllers). the Network and Switching Subsystem (the part of the network most

similar to a fixed network). This is sometimes also just called the core network.

the GPRS Core Network (the optional part which allows packet based

Internet connections).

Subscriber identity module


One of the key features of GSM is the Subscriber Identity Module (SIM), commonly known as a SIM card. The SIM is a detachable smart card containing the user's subscription information and phonebook. This allows the user to retain his or her information after switching handsets. Alternatively, the user can also change operators while retaining the handset simply by changing the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only a SIM issued by them; this practice is known as SIM locking, and is illegal in some countries. In Australia, Canada, Europe and the United States many operators lock the mobiles they sell. This is done because the price of the mobile phone is typically subsidised with revenue from subscriptions, and operators want to try to avoid subsidising competitor's mobiles. A subscriber can usually contact the provider to remove the lock for a fee, utilize private services to remove the lock, or make use of ample software and websites available on the Internet to unlock the handset themselves. While most web sites offer the unlocking for a fee, some do it for free.

P a g e | 22 The locking applies to the handset, identified by its International Mobile Equipment Identity (IMEI) number, not to the account (which is identified by the SIM card). It is always possible to switch to another (non-locked) handset if such a handset is available. Some providers will unlock the phone for free if the customer has held an account for a certain time period. Third party unlocking services exist that are often quicker and lower cost than that of the operator. In most countries, removing the lock is legal. United States-based AT&T and T-Mobile provide free unlocking services to their customers after 3 months of subscription. In countries like Belgium, India, Indonesia and Pakistan, etc., all phones are sold unlocked. However, in Belgium, it is unlawful for operators there to offer any form of subsidy on the phone's price. This was also the case in Finland until April 1, 2006, when selling subsidized combinations of handsets and accounts became legal, though operators have to unlock phones free of charge after a certain period (at most 24 months).

GSM security
GSM was designed with a moderate level of security. The system was designed to authenticate the subscriber using a pre-shared key and challenge-response. Communications between the subscriber and the base station can be encrypted. The development of UMTS introduces an optional USIM, that uses a longer authentication key to give greater security, as well as mutually authenticating the network and the user whereas GSM only authenticated the user to the network (and not vice versa).

P a g e | 23

2.3 Liquid Crystal Display

Reflective twisted nematic liquid crystal display.


1. Polarizing filter film with a vertical axis to polarize light as it enters. 2. Glass substrate with ITO electrodes. The shapes of these electrodes will determine

the shapes that will appear when the LCD is turned ON. Vertical ridges etched on the surface are smooth. 3. Twisted nematic liquid crystal. 4. Glass substrate with common electrode film (ITO) with horizontal ridges to line up with the horizontal filter. 5. Polarizing filter film with a horizontal axis to block/pass light. 6. Reflective surface to send light back to viewer. (In a backlit LCD, this layer is replaced with a light source.) A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a thin, flat panel made up of any number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light source (backlight) or reflector. It is often used in battery-powered electronic devices because it requires very small amounts of electric power.A comprehensive classification of the various types and electro-optical modes of LCDs is provided in the article LCD classification.

P a g e | 24

Overview:

FIG2.1 LCD alarm clock Each pixel of an LCD typically consists of a layer of molecules aligned between two transparent electrodes, and two polarizing filters, the axes of transmission of which are (in most of the cases) perpendicular to each other. With no actual liquid crystal between the polarizing filters, light passing through the first filter would be blocked by the second (crossed) polarizer. The surface of the electrodes that are in contact with the liquid crystal material are treated so as to align the liquid crystal molecules in a particular direction. This treatment typically consists of a thin polymer layer that is unidirectionally rubbed using, for example, a cloth. The direction of the liquid crystal alignment is then defined by the direction of rubbing. Electrodes are made of a transparent conductor called Indium Tin Oxide (ITO). Before applying an electric field, the orientation of the liquid crystal molecules is determined by the alignment at the surfaces. In a twisted nematic device (still the most common liquid crystal device), the surface alignment directions at the two electrodes are perpendicular to each other, and so the molecules arrange themselves in a helical structure, or twist. This reduces the rotation of the polarization of the incident light, and the device appears grey. If the applied voltage is large enough, the liquid crystal molecules in the center of the layer are almost completely untwisted and the polarization of the incident light is not rotated as it passes through the liquid crystal layer. This light

P a g e | 25 will then be mainly polarized perpendicular to the second filter, and thus be blocked and the pixel will appear black. By controlling the voltage applied across the liquid crystal layer in each pixel, light can be allowed to pass through in varying amounts thus constituting different levels of gray. The optical effect of a twisted nematic device in the voltage-on state is far less dependent on variations in the device thickness than that in the voltage-off state. Because of this, these devices are usually operated between crossed polarizers such that they appear bright with no voltage (the eye is much more sensitive to variations in the dark state than the bright state). These devices can also be operated between parallel polarizers, in which case the bright and dark states are reversed. The voltage-off dark state in this configuration appears blotchy, however, because of small variations of thickness across the device. Both the liquid crystal material and the alignment layer material contain ionic compounds. If an electric field of one particular polarity is applied for a long period of time, this ionic material is attracted to the surfaces and degrades the device performance. This is avoided either by applying an alternating current or by reversing the polarity of the electric field as the device is addressed (the response of the liquid crystal layer is identical, regardless of the polarity of the applied field).

2.4 Radio-frequency identification(RFID)


Radio-frequency identification (RFID) is the use of an object (typically referred to as an RFID tag) applied to or incorporated into a product, animal, or person for the purpose of identification and tracking using radio waves. Some tags can be read from several meters away and beyond the line of sight of the reader. Most RFID tags contain at least two parts. One is an integrated circuit for storing and processing information, modulating and demodulating a radio-frequency (RF) signal, and other specialized functions. The second is an antenna for receiving and transmitting the signal.

P a g e | 26 There are generally three types of RFID tags: active RFID tags, which contain a battery and can transmit signals autonomously. Passive RFID tags, which have no battery and require an external source to provoke signal transmission. Battery assisted passive (BAP) which require an external source to wake up but have significant higher forward link capability providing great read range. Today, RFID is used in enterprise supply chain management to improve the efficiency of inventory tracking and management. History and Technology Background

Fig 2.4.1: An RFID tag used for electronic toll collection. In 1946 Lon Theremin invented an espionage tool for the Soviet Union which retransmitted incident radio waves with audio information. Sound waves vibrated a diaphragm which slightly altered the shape of the resonator, which modulated the reflected radio frequency. Even though this device was a covert listening device, not an identification tag, it is considered to be a predecessor of RFID technology, because it was likewise passive, being energized and activated by electromagnetic waves from an outside source. Similar technology, such as the IFF transponder invented in the United Kingdom in 1939, was routinely used by the allies in World War II to identify aircraft as friend or foe. Transponders are still used by most powered aircraft to this day. Another early work exploring RFID is the landmark 1948 paper by Harry Stockman, titled "Communication by Means of Reflected Power" (Proceedings of the IRE, pp 11961204, October 1948). Stockman predicted that "... considerable research

P a g e | 27 and development work has to be done before the remaining basic problems in reflectedpower communication are solved, and before the field of useful applications is explored." Mario Cardullo's U.S. Patent 3,713,148 in 1973 was the first true ancestor of modern RFID; a passive radio transponder with memory. The initial device was passive, powered by the interrogating signal, and was demonstrated in 1971 to the New York Port Authority and other potential users and consisted of a transponder with 16 bit memory for use as a toll device. The basic Cardullo patent covers the use of RF, sound and light as transmission media. The original business plan presented to investors in 1969 showed uses in transportation (automotive vehicle identification, automatic toll system, electronic license plate, electronic manifest, vehicle routing, vehicle performance monitoring), banking (electronic check book, electronic credit card), security (personnel identification, automatic gates, surveillance) and medical (identification, patient history). A very early demonstration of reflected power (modulated backscatter) RFID tags, both passive and semi-passive, was performed by Steven Depp, Alfred Koelle, and Robert Freyman at the Los Alamos National Laboratory in 1973. The portable system operated at 915 MHz and used 12-bit tags. This technique is used by the majority of today's UHFID and microwave RFID tags. The first patent to be associated with the abbreviation RFID was granted to Charles Walton in 1983 U.S. Patent 4,384,288. The largest deployment of active RFID is the US Department of Defense use of Savi active tags on every one of its more than a million shipping containers that travel outside of the continental United States (CONUS). The largest passive RFID deployment is the Defense Logistics Agency (DLA) deployment across 72 facilities implemented by ODIN who also performed the global roll-out for Airbus consisting of 13 projects across the globe. Miniaturization RFID is the technology which makes it easy to conceal or incorporate them in other items. For example, in 2009 researchers at Bristol University successfully glued RFID micro transponders to live ants in order to study their behavior. This trend towards

P a g e | 28 increasingly miniaturized RFID is likely to continue as technology advances. However, the ability to read at distance is limited by the inverse-square law. Hitachi holds the record for the smallest RFID chip, at 0.05mm x 0.05mm. The Mu chip tags are 64 times smaller than the new RFID tags. Manufacture is enabled by using the Silicon-on-Insulator (SOI) process. These "dust" sized chips can store 38-digit numbers using 128-bit Read Only Memory (ROM). A major challenge is the attachment of the antennas, thus limiting read range to only millimeters. Potential alternatives to the radio frequencies (0.1250.1342, 0.1400.1485, 13.56, and 840960 MHz) used are seen in optical RFID (or OPID) at 333 THz (900 nm), 380 THz (788 nm), 750 THz (400 nm). The awkward antennas of RFID can be replaced with photovoltaic components and IR-LEDs on the ICs.

Advantages
RFID is becoming increasingly prevalent as the price of the technology decreases. In January 2003 Gillette announced that it ordered 500 million tags from Alien Technology. Gillette VP Dick Cantwell, now an employee of Cisco says the company paid "well under ten cents" for each tag. The Japanese HIBIKI initiative aims to reduce the price to 5 Yen (4 eurocents). And in January 2009 Envego announced a 5.9 cent tag.

IT Asset Tracking In 2008 more than a dozen new passive UHF RFID tags emerged to be specifically mounted on metal. At the same time new integrated circuits (ICs) were introduced by Impinj and NXP (formerly Philips) which proved much better performance and the IT Asset Tracking application exploded. The largest adopter to date appear to be Bank of America and Wells Fargo - each with more than 100,000 assets across more than a dozen data centers.

Race Timing Many forms of RFID race timing have been in use for timing races of different types since the early 1990s. The practice began with pigeon racing, introduced by a

P a g e | 29 company called deister electronic Gmbh of Barsinghausen, Germany []. It is used for registering race start and end timings for animals or individuals in a marathon-type race where it is impossible to get accurate stopwatch readings for every entrant. In foot races, racers wear passive tags which are read by antennae placed alongside the track. UHF based tags instead of Low or high frequency last generation tags provide accurate readings with specially designed antennas. Rush error, lap count errors and accidents at start time are avoided since anyone can start and finish anytime without being in a batch mode. RFID is being adapted by many recruitment agencies which have a PET (Physical Endurance Test) as their qualifying procedure especially in cases where the candidate volumes may run into millions (Indian Railway Recruitment Cells, Police and Power sector). An Indian Software company Software Outsourcing Services has perfected the system for the same using UHF tags for the first time and they are able to process more than 30,000 candidates per day. Passports The first RFID passports ("E-passport") were issued by Malaysia in 1998. In addition to information also contained on the visual data page of the passport, Malaysian e-passports record the travel history (time, date, and place) of entries and exits from the country. Other countries that put RFID in passports include Norway (2005) [11], Japan (March 1, 2006), most EU countries (around 2006) including Ireland and UK, Australia and the United States (2007), Serbia (July 2008), Republic of Korea (August 2008), Albania (January 2009). Standards for RFID passports are determined by the International Civil Aviation Organization (ICAO), and are contained in ICAO Document 9303, Part 1, Volumes 1 and 2 (6th edition, 2006). ICAO refers to the ISO/IEC 14443 RFID chips in e-passports as "contactless integrated circuits". ICAO standards provide for e-passports to be identifiable by a standard e-passport logo on the front cover. In 2006, RFID tags were included in new US passports. The US produced 10 million passports in 2005, and it has been estimated that 13 million will be produced in

P a g e | 30 2006. The chips inlays produced by Smartrac will store the same information that is printed within the passport and will also include a digital picture of the owner. The US State Department initially stated the chips could only be read from a distance of 10 cm (4 in), but after widespread criticism and a clear demonstration that special equipment can read the test passports from 10 meters (33 ft) away, the passports were designed to incorporate a thin metal lining to make it more difficult for unauthorized readers to "skim" information when the passport is closed. The department will also implement Basic Access Control (BAC), which functions as a Personal Identification Number (PIN) in the form of characters printed on the passport data page. Before a passport's tag can be read, this PIN must be entered into an RFID reader. The BAC also enables the encryption of any communication between the chip and interrogator. Security expert Bruce Schneier has suggested that a mugger operating near an airport could target victims who have arrived from wealthy countries, or a terrorist could design an improvised explosive device which functioned when approached by persons from a particular country if passengers did not put their cards in an area close to their body (high liquid and saline content) or in a foil-lined wallet. Some other European Union countries are also planning to add fingerprints and other biometric data, while some have already done so.

Mobile payment Credit card companies are now looking for payment solutions for adding contactless payment cards to any mobile phone. A carrier solution that satisfied the industry's needs is now available. Less than 3mm thick, the sub-card will withstand its environment for 2 years, protected from the elements and secured in the carrier once inserted.

P a g e | 31

Transportation payments

Fig 2.4.2: An Electronic Road Pricing gantry

An Electronic Road Pricing gantry in Singapore. Gantries such as these collect tolls in high-traffic areas from active RFID units in vehicles. PayPass RFID chip removed from a MasterCard.

RFID is being used for E - Tolling in Motorways, Pakistan, Implemented by NADRA. Throughout Europe, and in particular in Paris (system started in 1995 by the RATP), Lyon, Bordeaux, Nancy and Marseilles in France, in the whole of the Portuguese highway system and in many Portuguese public car parks, Milan, Turin, Naples and Florence in Italy, and Brussels in Belgium, RFID passes conforming to the Calypso (RFID) international standard are used for public transport systems. They are also used now in Canada (Montreal), Mexico, Israel, Bogot and Pereira in Colombia, Stavanger in Norway, Luxembourg, etc.

In Toronto, Ontario, Canada and surrounding areas, Electronic Road Pricing systems are used to collect toll payments on Highway 407. In Seoul, South Korea and surrounding cities, T-money cards can be used to pay for public transit. Some other South Korean cities have adopted the system, which can also be used in some stores as cash. T-money replaced Upass, first introduced for transport payments in 1996 using MIFARE technology.

In Turkey, RFID has been used in the motorways and bridges as a payment system since [Nov 2008]; it is also used in electronic bus tickets in Istanbul.

P a g e | 32

In Hong Kong, mass transit is paid for almost exclusively through the use of an RFID technology, called the Octopus Card. Originally it was launched in September 1997 exclusively for transit fare collection, but has grown to be similar to a cash card, and can still be used in vending machines, fast-food restaurants and supermarkets. The card can be recharged with cash at add-value machines or in shops, and can be read several centimetres from the reader. The same applies for Delhi Metro, the rapid transit system in New Delhi, capital city of India.

The Moscow Metro, the world's second busiest, was the first system in Europe to introduce RFID smartcards in 1998. The Washington, D.C. Metrorail became the first U.S. urban mass-transit system to use RFID technology when it introduced the SmarTrip card in 1999. JR East in Japan introduced SUICa (Super Urban Intelligent Card) for transport payment service in its railway transportation service in November 2001, using Sony's FeliCa (Felicity Card) technology. The same Sony technology was used in Hong Kong's Octopus card, and Singapore's EZ-Link card.

In Singapore, public transportation buses and trains employ passive RFID cards known as EZ-Link cards. Traffic into crowded downtown areas is regulated by variable tolls imposed using an active tagging system combined with the use of stored-value cards (known as CashCards).

RFID is used in Malaysia Expressways payment system. The name for the system is Touch 'n Go. As the system's name indicates, the card is designed to only function as an RFID card when the user touches it.

Since 2002, in Taipei, Taiwan the transportation system uses RFID operated cards as fare collection. The Easy Card is charged at local convenience stores and metro stations, and can be used in Metro, buses and parking lots. The uses are planned to extend all throughout the island of Taiwan in the future.

In the United States, the Chicago Transit Authority has offered the Chicago Card and the Chicago Card Plus for rail payments across the entire system since 2002 and for bus payments since 2005. The MBTA introduced the RFID enabled

P a g e | 33 CharlieCard across Boston's subway, streetcar, and bus system in 2006, replacing the decades old token based fare collection system.

The New York City Metropolitan Transportation Authority conducted an RFID trial that utilized PayPass by MasterCard. The trial primarily took place on the IRT Lexington Avenue Line with several busier stations on other lines also included. The trial will end on May 31, 2009, however the option of using Pay Pass may be reintroduced on a wider scale at a later date. The MTA is also studying the possibility of accepting Smart Link (introduced by PATH) for fare payment on the New York City Subway and Buses, and as an eventual replacement for the Metro Card.

In the UK, operating systems for prepaying for unlimited public transport have been devised, making use of RFID technology. The design is embedded in a credit card-like pass, that when scanned reveals details of whether the pass is valid, and for how long the pass will remain valid. The first company to implement this is the NCT company of Nottingham City, where the general public affectionately refer to them as "beep cards". It has since been successfully implemented in London, where "Oyster cards" allow for pay-as-you-go travel as well as passes valid for various lengths of time and in various areas.

In Oslo, Norway, the upcoming public transport payment is to be entirely RFIDbased. The system was slated for introduction around spring 2007. In Norway, all public toll roads are equipped with an RFID payment system known as AutoPASS. RFID tags are used for electronic toll collection at toll booths with Georgia's Cruise Card, California's FasTrak, Colorado's E-470, Illinois' I-Pass, Oklahoma's Pikepass, the expanding eastern states' E-ZPass system (including Massachusetts's Fast Lane,Delaware, New Hampshire Turnpike, Maryland, New Jersey Turnpike, Pennsylvania Turnpike, West Virginia Turnpike, New York's Thruway system, Virginia, and the Maine Turnpike),Central Florida also utilizes this technology, via its E-PASS System. E-PASS and Sunpass are mutually compatible. Florida's SunPass, Various systems in Texas including D/FW's NTTA TollTag, the Austin metro TxTag and Houston HCTRA EZ Tag (which as of early 2007 are all valid

P a g e | 34 on any Texas toll road), Kansas's K-Tag, The "Cross-Israel Highway" (Highway 6), Philippines South Luzon Expressway E-Pass, Brisbane's Queensland Motorway E-Toll System in Australia, Autopista del Sol (Sun's Highway), Autopista Central (Central Highway), Autopista Los Libertadores, Costanera Norte, Vespucio Norte Express and Vespucio Sur urban Highways and every forthcoming urban highway (in a "Free Flow" modality) concessioned to private investors in Chile, all toll tunnels in Hong Kong (Autotoll) and all highways in Portugal (Via Verde, the first system in the world to span the entire network of tolls), France (Liber-T system), Italy (Telepass), Spain (VIA-T), Brazil (Sem Parar - Via Fcil). The tags, which are usually the active type, are read remotely as vehicles pass through the booths, and tag information is used to debit the toll amount from a prepaid account. The system helps to speed traffic through toll plazas as it records the date, time, and billing data for the RFID vehicle tag. The plaza- and queue-free 407 Express Toll Route, in the Greater Toronto Area, allows the use of a transponder (an active tag) for all billing. This eliminates the need to identify a vehicle by licence plate.[citation needed]

The Transperth public transport network in Perth, Western Australia uses RFID technology in the new SmartRider ticketing system. In Atlanta, MARTA (Metropolitan Atlanta Rapid Transit Authority) has transitioned its bus and rail lines from coin tokens to the new Breeze Card system.

RFID and asset management RFID (Radio Frequency Identification) combined with mobile computing and Web technologies provide a way for organizations to identify and manage their assets. Initially introduced to major retail by Craig Patterson, Knoxville, TN. Mobile computers, with integrated RFID readers, can now deliver a complete set of tools that eliminate paperwork, give proof of identification and attendance. This approach eliminates manual data entry. Web based management tools allow organizations to monitor their assets and make management decisions from anywhere in the world. Web based applications now mean that third parties, such as manufacturers and contractors can be granted access to

P a g e | 35 update asset data, including for example, inspection history and transfer documentation online ensuring that the end user always has accurate, real-time data. Organizations are already using RFID tags combined with a mobile asset management solution to record and monitor the location of their assets, their current status, and whether they have been maintained. Product tracking

The Canadian Cattle Identification Agency began using RFID tags as a replacement for barcode tags. The tags are required to identify a bovine's herd of origin and this is used for tracing when a packing plant condemns a carcass. Currently CCIA tags are used in Wisconsin and by US farmers on a voluntary basis. The USDA is currently developing its own program.

High-frequency RFID or HFID/HighFID tags are used in library book or bookstore tracking, jewelry tracking, pallet tracking, building access control, airline baggage tracking, and apparel and pharmaceutical items tracking. Highfrequency tags are widely used in identification badges, replacing earlier magnetic stripe cards. These badges need only be held within a certain distance of the reader to authenticate the holder. The American Express Blue credit card now includes a HighFID tag. In Feb 2008, Emirates Airline started a trial of RFID baggage tracing at London and Dubai airports.

BGN has launched two fully automated Smartstores that combine item-level RFID tagging and SOA to deliver an integrated supply chain, from warehouse to consumer.

UHF, Ultra-HighFID or UHFID tags are commonly used commercially in case, pallet, and shipping container tracking, and truck and trailer tracking in shipping yards.

In May 2007, Bear River Supply began utilizing Intelleflex Corporation's ultrahigh-frequency identification (UHFID) tags to help monitor their agricultural equipment.

In Colombia, "Federacin Nacional de Cafeteros" uses an RFID solution to trace the coffee.

P a g e | 36

Purdue Pharma currently uses RFID to track shipments of the painkiller OxyContin. In Berlin, Germany, the Berliner Wasserbetriebe (water treatment facility) Uses RFID systems from Psion Teklogix and Elektroniksystem-und-Logistik-GmbH (ESG) to identify and track its 60,000 assets.

Transportation and logistics

Logistics & Transportation is a major area of implementation for RFID technology. For example, Yard Management, Shipping & Freight and Distribution Centers are some areas where RFID tracking technology is used. Transportation companies around the world value RFID technology due to its impact on the business value and efficiency.

The North American railroad industry operates an automatic equipment identification system based on RFID. Locomotives and rolling stock are equipped with two passive RFID tags (one mounted on each side of the equipment); the data encoded on each tag identifies the equipment owner, car number, type of equipment, number of axles, etc. The equipment owner and car number can be used to derive further data about the physical characteristics of the equipment from the Association of American Railroads' car inventory database and the railroad's own database indicating the lading, origin, destination, etc. of the commodities being carried.

Aerospace applications that incorporate RFID technology are being incorporated into Network Centric Product Support architecture. This technology serves to help facilitate more efficient logistics support for systems maintenance on-board commercial aircraft.

Baggages passing through the Hong Kong International Airport are individually tagged with "HKIA" RFID tags as they navigate the airport's baggage handling system, which improves efficiency and reduces misplaced items.

Lap scoring Passive and active RFID systems are used in off-road events such as Orienteering, Enduro and Hare and Hounds racing. Riders have a transponder on their person, normally on their arm. When they complete a lap they swipe or touch the receiver which is

P a g e | 37 connected to a computer and log their lap time. The Casimo Group Ltd sells such a system, as does Sweden's SportIdent. RFID include the reduction of labor costs, the simplification of business processes, and the reduction of inventory inaccuracies. In 2004, Boeing integrated the use of RFID technology to help reduce maintenance and inventory costs on the Boeing 787 Dreamliner. With the high costs of aircraft parts, RFID. RFID mandates Wal-Mart and the United States Department of Defense have published requirements that their vendors place RFID tags on all shipments to improve supply chain management. Due to the size of these two organizations, their RFID mandates impact thousands of companies worldwide. The deadlines have been extended several times because many vendors face significant difficulties implementing RFID systems. In practice, the successful read rates currently run only 80%, due to radio wave attenuation caused by the products and packaging. In time it is expected that even small companies will be able to place RFID tags on their outbound shipments. Since January 2005, Wal-Mart has required its top 100 suppliers to apply RFID labels to all shipments. To meet this requirement, vendors use RFID printer/encoders to label cases and pallets that require EPC tags for Wal-Mart. These smart labels are produced by embedding RFID inlays inside the label material, and then printing bar code and other visible information on the surface of the label. Another Wal-Mart division, Sam's Club, has also moved in this direction. It sent letters dated Jan. 7, 2008 to its suppliers, stating that by Jan. 31, 2008, every full singleitem pallet shipped to its distribution center in DeSoto, Texas, or directly to one of its stores served by that DC, must bear an EPC Gen 2 RFID tag. Suppliers failing to comply will be charged a service fee. The DoD requirements for RFID tags on packages is prescribed in the Defense Federal Acquisition Regulations Supplements (DFARS) 252.211-7006. Positioning of the tag needs to be completed in accordance with the clause and definitions in MIL STD 129 and as of 1 March 2007, EPC Global tags must comply with EPCglobal Class 1 Generation 2 specification.

P a g e | 38

Promotion tracking Manufacturers of products sold through retailers promote their products by offering discounts for a limited period on products sold to retailers with the expectation that the retailers will pass on the savings to their customers. However, retailers typically engage in forward buying, purchasing more product during the discount period than they intend to sell during the promotion period. Some retailers engage in a form of arbitrage, reselling discounted product to other retailers, a practice known as diverting. To combat this practice, manufacturers are exploring the use of RFID tags on promoted merchandise so that they can track exactly which product has sold through the supply chain at fully discounted prices.

Libraries

Fig 2.4.3: RFID tags used in libraries: square book tag, round CD/DVD tag and rectangular VHS tag. Among the many uses of RFID technology is its deployment in libraries. This technology has slowly begun to replace the traditional barcodes on library items (books, CDs, DVDs, etc.). The RFID tag can contain identifying information, such as a book's title or material type, without having to be pointed to a separate database (but this is rare in North America). The information is read by an RFID reader, which replaces the standard barcode reader commonly found at a library's circulation desk. The RFID tag

P a g e | 39 found on library materials typically measures 50 mm X 50 mm in North America and 50 mm x 75 mm in Europe. It may replace or be added to the barcode, offering a different means of inventory management by the staff and self service by the borrowers. It can also act as a security device, taking the place of the more traditional electromagnetic security strip And not only the books, but also the membership cards could be fitted with an RFID tag. While there is some debate as to when and where RFID in libraries first began, it was first proposed in the late 1990s as a technology that would enhance workflow in the library setting. Singapore was certainly one of the first to introduce RFID in libraries and Rockefeller University in New York may have been the first academic library in the United States to utilize this technology, whereas Farmington Community Library in Michigan may have been the first public institution, both of which began using RFID in 1999. In Europe, the first public library to use RFID was the one in HoogezandSappemeer, the Netherlands, in 2001, where borrowers were given an option. To their surprise, 70% used the RFID option and quickly adapted, including elderly people. RFID has many library applications that can be highly beneficial, particularly for circulation staff. Since RFID tags can be read through an item, there is no need to open a book cover or DVD case to scan an item. This could reduce repetitive-motion injuries. Where the books have a barcode on the outside, there is still the advantage that borrowers can scan an entire pile of books in one go, instead of one at a time. Since RFID tags can also be read while an item is in motion, using RFID readers to check-in returned items.

Schools and universities School authorities in the Japanese city of Osaka are now chipping children's clothing, back packs, and student IDs in a primary school. A school in Doncaster, England is piloting a monitoring system designed to keep tabs on pupils by tracking radio chips in their uniforms.. St Charles Sixth Form College in West London, England, started September, 2008, is using an RFID card system to check in and out of the main gate, to both track attendance and prevent unauthorized entrance. As is Whitcliffe Mount School in Cleckheaton, England which uses RFID to track pupils and staff in and out of the building via a specially designed cards. In the Philippines , some schools already use

P a g e | 40 RFID in IDs for borrowing books and also gates in that particular schools have RFID ID Scanners. These Schools are Claret School of Quezon City , Colegio de San Juan de Letran and Other private Schools. Museums RFID technologies are now also implemented in end-user applications in museums. An example is the custom-designed application "eXsport" at the Exploratorium, a science museum in San Francisco, California. A visitor entering the museum receives an RF Tag that can be carried on a card or necklace. The eXspot system enables the visitor to receive information about the exhibit and take photos to be collected at the giftshop. Later they can visit their personal Web page on which specific information such as visit dates, the visited exhibits and the taken photographs can be viewed.

Social retailing When customers enter a dressing room, the mirror reflects their image and also images of the apparel item being worn by celebrities on an interactive display. A webcam also projects an image of the consumer wearing the item on the website for everyone to see. This creates an interaction between the consumers inside the store and their social network outside the store. The technology in this system is an RFID interrogator antenna in the dressing room and Electronic Product Code RFID tags on the apparel item.

Potential uses RFID can be used in a variety of applications such as:


Access management Tracking of goods and RFID in retail Tracking of persons and animals Toll collection and contactless payment Machine readable travel documents

P a g e | 41

Smart dust (for massively distributed sensor networks) Location-based services Tracking Sports memorabilia to verify authenicity Airport Baggage Tracking Logistics

Regulation and standardization There is no global public body that governs the frequencies used for RFID. In principle, every country can set its own rules for this. The main bodies governing frequency allocation for RFID are:

USA: FCC (Federal Communications Commission) Canada: CRTC (Canadian Radio-television and Telecommunications Commission)

Europe: ERO, CEPT, ETSI, and national administrations (note that the national administrations must ratify the usage of a specific frequency before it can be used in that country)

Malaysia: Malaysian Communications and Multimedia Commission (MCMC) Japan: MIC (Ministry of Internal Affairs and Communications) China: Ministry of Information Industry Taiwan: NCC (National Communications Commission) South Africa: ICASA South Korea: Ministry of Commerce, Industry and Energy Australia: Australian Communications and Media Authority. New Zealand: Ministry of Economic Development Singapore: Infocomm Development Authority of Singapore Brazil: Anatel (Agncia Nacional de Telecomunicaes) Problems and concerns

Global standardization The frequencies used for RFID in the USA are currently incompatible with those of Europe or Japan. Furthermore, no emerging standard has yet become as universal as the barcode.

P a g e | 42

Security concerns A primary RFID security concern is the illicit tracking of RFID tags. Tags which are world-readable pose a risk to both personal location privacy and corporate/military security. Such concerns have been raised with respect to the United States Department of Defense's recent adoption of RFID tags for supply chain management. More generally, privacy organizations have expressed concerns in the context of ongoing efforts to embed electronic product code (EPC) RFID tags in consumer products. Passports In an effort to make passports more secure, several countries have implemented RFID in passports. However, the encryption on UK chips was broken in under 48 hours. Since that incident, further efforts have allowed researchers to clone passport data while the passport is being mailed to its owner. Where a criminal used to need to secretly open and then reseal the envelope, now it can be done without detection, adding some degree of insecurity to the passport system.

2.5 RFID TAG:


An RFID tag is a microchip combined with an antenna in a compact package; the packaging is structured to allow the RFID tag to be attached to an object to be tracked. "RFID" stands for Radio Frequency Identification. The tag's antenna picks up signals from an RFID reader or scanner and then returns the signal, usually with some additional data (like a unique serial number or other customized information). RFID tags can be very small - the size of a large rice grain. Others may be the size of a small paperback book.

P a g e | 43

Fig 2.5.1: RFID Tags

P a g e | 44

3. BLOCK DIAGRAM AND OPERATION


3.1 Block Diagram

Fig 3.1: Block Diagram of Vehicle Registration details Extraction system using GSM

3.2 Operation
In generally all vehicles are tagged. When ever a vehicle reaches the signaling junction the RFID reader reads the tag and converts the radio waves into a suitable form for microcontroller. Microcontroller compares this data with the data stored already in it about vehicle registration details and displays them on LCD. If the vehicle of that particular details breaks the traffic rules the IR sensor will notice that and details are sent to the controller over GSM.

P a g e | 45 Power supply: It supplies 5v dc for all the components. RFID Reader: Its main function is to read the information from the RFID tag. RFID Tag: It holds the details of the vehicle registration IR sensor: Its main purpose is to notice the vehicle which breaks the rules and sends information to microcontroller. Microcontroller: It contains the database of the vehicle details containing RFID tags and gives instructions to all the parts. GSM: Its function is to send sms for the control area.

P a g e | 46

4. MICROCONTROLLER
4.1 Introduction
The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024 bytes of data RAM. A key feature of the P89V51RD2 is its X2 mode option. The design engineer can choose to run the application with the conventional 80C51 clock rate (12 clocks per machine cycle) or select the X2 mode (6 clocks per machine cycle) to achieve twice the throughput at the same clock frequency. Another way to benefit from this feature is to keep the same performance by reducing the clock frequency by half, thus dramatically reducing the EMI. The Flash program memory supports both parallel programming and in serial InSystem Programming (ISP). Parallel programming mode offers gang-programming at high speed, reducing programming costs and time to market. ISP allows a device to be reprogrammed in the end product under software control. The capability to field/update the application firmware makes a wide range of applications possible. The P89V51RD2 is also In-Application Programmable (IAP), allowing the Flash program memory to be reconfigured even while the application is running.

Features
80C51 Central Processing Unit 5 V Operating voltage from 0 to 40 MHz 64 kB of on-chip Flash program memory with ISP (In-System Programming) and IAP (In-Application Programming) Supports 12-clock (default) or 6-clock mode selection via software or ISP SPI (Serial Peripheral Interface) and enhanced UART PCA (Programmable Counter Array) with PWM and Capture/Compare functions Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each) Three 16-bit timers/counters Programmable Watchdog timer (WDT) Eight interrupt sources with four priority levels Second DPTR register

P a g e | 47 Low EMI mode (ALE inhibit) TTL- and CMOS-compatible logic levels Brown-out detection Low power modes Power-down mode with external interrupt wake-up Idle mode PDIP40, PLCC44 and TQFP44 packages

4.2 Block Diagram

Fig 4.2.1: P89V51RD2 Block diagram

P a g e | 48

4.3 Pin Configuration


Pin Diagram

Fig 4.3.1: Pin Diagram Pin description P0.0 to P0.7 (43-36pins): Port 0 is an 8-bit open drain bi-directional I/O port. Port 0 pins that have 1s written to them float, and in this state can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and data bus during accesses to

P a g e | 49 external code and data memory. In this application, it uses strong internal pull-ups when transitioning to 1s. Port 0 also receives the code bytes during the external host mode programming, and outputs the code bytes during the external host mode verification. External pull-ups are required during program verification or as a general purpose I/O port. P1.0 to P1.7 (2-9pins): Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 pins are pulled high by the internal pull-ups when 1s are written to them and can be used as inputs in this state. As inputs, Port 1 pins that are externally pulled LOW will source current (IIL) because of the internal pull-ups. P1.5, P1.6, P1.7 have high current drive of 16 mA. Port 1 also receives the low-order address bytes during the external host mode programming and verification. P1.0 ( 2pin) : External count input to Timer/Counter 2 or Clock-out from Timer/Counter 2 P1.1 (3pin): Timer/Counter 2 capture/reload trigger and direction control P1.2 (4pin): External clock input. This signal is the external clock input for the PCA. P1.3 (5pin): Capture/compare external I/O for PCA Module 0. Each capture/compare module connects to a Port 1 pin for external I/O. When not used by the PCA, this pin can handle standard I/O. P1.4 (6pin): SS: Slave port select input for SPI CEX1: Capture/compare external I/O for PCA Module 1 P1.5 (7pin): MOSI: Master Output Slave Input for SPI CEX2: Capture/compare external I/O for PCA Module 2 P1.6 (8pin): MISO: Master Input Slave Output for SPI CEX3: Capture/compare external I/O for PCA Module 3 P1.7 (9pin): SCK: Master Output Slave Input for SPI CEX4: Capture/compare external I/O for PCA Module 4

P a g e | 50 P2.0 to P2.7(24-31pins): Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. Port 2 pins are pulled HIGH by the internal pull-ups when 1s are written to them and can be used as inputs in this state. As inputs, Port 2 pins that are externally pulled LOW will source current (IIL) because of the internal pull-ups. Port 2 sends the high-order address byte during fetches from external program memory and during accesses to external Data Memory that use 16-bit address (MOVX@DPTR). In this application, it uses strong internal pull-ups when transitioning to 1s. Port 2 also receives some control signals and a partial of high-order address bits during the external host mode programming and verification. P3.0 to P3.7(11,13-19pins): Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. Port 3 pins are pulled HIGH by the internal pull-ups when 1s are written to them and can be used as inputs in this state. As inputs, Port 3 pins that are externally pulled LOW will source current (IIL) because of the internal pull-ups. Port 3 also receives some control signals and a partial of high-order address bits during the external host mode programming and verification. P3.0 11 RXD: serial input port P3.1 13 TXD: serial output port P3.2 14 INT0: external interrupt 0 input P3.3 15 INT1: external interrupt 1 input P3.4 16 T0: external count input to Timer/Counter 0 P3.5 17 T1: external count input to Timer/Counter 1 P3.6 18 WR: external data memory write strobe P3.7 19 RD: external data memory read strobe

PSEN (32pin): Program Store Enable: PSEN is the read strobe for external program memory. When the device is executing from internal program memory, PSEN is inactive (HIGH). When the device is executing code from external program memory, PSEN is

P a g e | 51 activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. A forced HIGH-to-LOW input transition on the PSEN pin while the RST input is continually held HIGH for more than 10 machine cycles will cause the device to enter external host mode programming. RST (10pin): Reset: While the oscillator is running, a HIGH logic state on this pin for two machine cycles will reset the device. If the PSEN pin is driven by a HIGH-to-LOW input transition while the RST input pin is held HIGH, the device will enter the external host mode, otherwise the device will enter the normal operation mode. EA (35pin): External Access Enable: EA must be connected to VSS in order to enable the device to fetch code from the external program memory. EA must be strapped to VDD for internal program execution. However, Security lock level 4 will disable EA, and program execution is only possible from internal program memory. The EA pin can tolerate a high voltage of 12 V. ALE/PROG (33pin): Address Latch Enable: ALE is the output signal for latching the low byte of the address during an access to external memory. This pin is also the programming pulse input (PROG) for flash programming. Normally the ALE is emitted at a constant rate of 16 the crystal frequency and can be used for external timing and clocking. One ALE pulse is skipped during each access to external data memory. However, if AO is set to 1, ALE is disabled. NC(1, 12, 23,34pins): No Connection. XTAL (21pin) Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock generator circuits. XTAL2 (20pin): Crystal 2: Output from the inverting oscillator amplifier. VDD (44pin): Power supply. VSS (22pin): Ground.

P a g e | 52

4.4 Memory organization


The device has separate address spaces for program and data memory. Flash program memory There are two internal flash memory blocks in the device. Block 0 has 64 kbytes and contains the users code. Block 1 contains the Philips-provided ISP/IAP routines and may be enabled such that it overlays the first 8 kbytes of the user code memory. The 64 kB Block 0 is organized as 512 sectors, each sector consists of 128 bytes. Access to the IAP routines may be enabled by clearing the BSEL bit in the FCF register. However, caution must be taken when dynamically changing the BSEL bit. Since this will cause different physical memory to be mapped to the logical program address space, the user must avoid clearing the BSEL bit when executing user code within the address range 0000H to 1FFFH. Data RAM memory The data RAM has 1024 bytes of internal memory. The device can also address up to 64 kB for external data memory. Expanded data RAM addressing The P89V51RD2 has 1 kB of RAM. See The device has four sections of internal data memory: 1. The lower 128 bytes of RAM (00H to 7FH) are directly and indirectly addressable. 2. The higher 128 bytes of RAM (80H to FFH) are indirectly addressable. 3. The special function registers (80H to FFH) are directly addressable only. 4. The expanded RAM of 768 bytes (00H to 2FFH) is indirectly addressable by the move external instruction (MOVX) and clearing the EXTRAM bit. Since the upper 128 bytes occupy the same addresses as the SFRs, the RAM must be accessed indirectly. The RAM and SFRs space are physically separate even though they have the same addresses.

P a g e | 53

AUXR - Auxiliary register (address 8EH) bit allocation Bit Symbol 7 6 5 4 3 2 1 EXTRAM 0 AO

Table 1: Auxiliary register (address 8EH) bit allocation 7 to 2 -Reserved for future use. Should be set to 0 by user programs. 1:EXTRAM Internal/External RAM access using MOVX @Ri/@DPTR. When 0, core attempts to access internal XRAM with address specified in MOVX instruction. If address supplied with this instruction exceeds on-chip available XRAM, off-chip XRAM is going to be selected and accessed. When 1, every MOVX @Ri/@DPTR instruction targets external data memory by default. 0: AO ALE off: disables/enables ALE. AO = 0 results in ALE emitted at a constant rate of 12 the oscillator frequency. In case of AO = 1, ALE is active only during a MOVX or MOVC. When instructions access addresses in the upper 128 bytes (above 7FH), the MCU determines whether to access the SFRs or RAM by the type of instruction given. If it is indirect, then RAM is accessed. If it is direct, then an SFR is accessed. See the examples below.

P a g e | 54

Fig 4.4.1 Internal and External Data Memory Structure Dual data pointers: The device has two 16-bit data pointers. The DPTR Select (DPS) bit in AUXR1 determines which of the two data pointers is accessed. When DPS = 0, DPTR0 is selected; when DPS = 1, DPTR1 is selected. Quickly switching between the two data pointers can be accomplished by a single INC instruction on AUXR1.

P a g e | 55

Fig 4.4.2 Dual Data Pointer Organization

Flash memory In-Application Programming


Flash organization The P89V51RD2 program memory consists of a 64 kB block. An In-System Programming (ISP) capability, in a second 8 kB block, is provided to allow the user code to be programmed in-circuit through the serial port. There are three methods of erasing or programming of the Flash memory that may be used. First, the Flash may be programmed or erased in the end-user application by calling low-level routines through a common entry point (IAP). Second, the on-chip ISP boot loader may be invoked. This ISP boot loader will, in turn, call low-level routines through the same common entry point that can be used by the end-user application. Third, the Flash may be programmed or erased using the parallel method by using a commercially available EPROM programmer which supports this device. Boot block When the microcontroller programs its own Flash memory, all of the low level details are handled by code that is contained in a Boot block that is separate from the user Flash memory. A user program calls the common entry point in the Boot block with appropriate parameters to accomplish the desired operation. Boot block operations include erase user code, program user code, program security bits, etc. A Chip-Erase operation can be performed using a commercially available parallel programmer.

P a g e | 56 This operation will erase the contents of this Boot Block and it will be necessary for the user to reprogram this Boot Block (Block 1) with the Philips-provided ISP/IAP code in order to use the ISP or IAP capabilities of this device. Power-On reset code execution Following reset, the P89V51RD2 will either enter the SoftICE mode (if previously enabled via ISP command) or attempt to autobaud to the ISP boot loader. If this autobaud is not successful within about 400 ms, the device will begin execution of the user code. In-System Programming (ISP) In-System Programming is performed without removing the microcontroller from the system. The In-System Programming facility consists of a series of internal hardware resources coupled with internal firmware to facilitate remote programming of the P89V51RD2 through the serial port. This firmware is provided by Philips and embedded within each P89V51RD2 device. The Philips In-System Programming facility has made in-circuit programming in an embedded application possible with a minimum of additional expense in components and circuit board area. The ISP function uses five pins (VDD, VSS, TxD, RxD, and RST). Only a small connector needs to be available to interface your application to an external circuit in order to use this feature. Using the serial number This device has the option of storing a 31-byte serial number along with the length of the serial number (for a total of 32 bytes) in a non-volatile memory space. When ISP mode is entered, the serial number length is evaluated to determine if the serial number is in use. If the length of the serial number is programmed to either 00H or FFH, the serial number is considered not in use. If the serial number is in use, reading, programming, or erasing of the user code memory or the serial number is blocked until the user transmits a verify serial number record containing a serial number and length that matches the serial number and length previously stored in the device.

P a g e | 57 The user can reset the serial number to all zeros and set the length to zero by sending the reset serial number' record. In addition, the reset serial number record will also erase all user code. In-Application Programming method Several In-Application Programming (IAP) calls are available for use by an application program to permit selective erasing, reading and programming of Flash sectors, pages, security bit, configuration bytes, and device id. All calls are made through a common interface, PGM_MTP. The programming functions are selected by setting up the microcontrollers registers before making a call to PGM_MTP at 1FF0H.

4.5 Timers/counters 0 and 1


The two 16-bit Timer/Counter registers: Timer 0 and Timer 1 can be configured to operate either as timers or event counters In the Timer function, the register is incremented every machine cycle. TMOD - Timer/Counter mode control register (address 89H) bit allocation:

Table 2: Timer/Counter mode control register (address 89H) bit allocation TMOD - Timer/Counter mode control register (address 89H) bit description:

Table 3: Counter mode control register (address 89H) bit description

P a g e | 58 TMOD - Timer/Counter mode control register (address 89H) M1/M0 operating mode:

Table 4: Timer/Counter mode control register (address 89H) M1/M0 operating mode TCON - Timer/Counter control register (address 88H) bit allocation:

Table 5: Timer/Counter control register (address 88H) bit allocation

P a g e | 59 TCON - Timer/Counter control register (address 88H) bit description:

Table 6: Timer/Counter control register (address 88H) bit description Mode 0: Putting either Timer into Mode 0 makes it look like an 8048 Timer, which is an 8-bit Counter with a fixed divide-by-32 pre-scalar.

P a g e | 60 Fig 4.5.1:Timer/Counter 0 or 1 in mode 0(13-bit counter) In this mode, the Timer register is configured as a 13-bit register. As the count rolls over from all 1s to all 0s, it sets the Timer interrupt flag TFn. The count input is enabled to the Timer when TRn = 1 and either GATE = 0 or INTn = 1. (Setting GATE = 1 allows the Timer to be controlled by external input INTn, to facilitate pulse width measurements). TRn is a control bit in the Special Function Register TCON . The GATE bit is in the TMOD register. The 13-bit register consists of all 8 bits of THn and the lower 5 bits of TLn. The upper 3 bits of TLn are indeterminate and should be ignored. Setting the run flag (TRn) does not clear the registers. Mode 0 operation is the same for Timer 0 and Timer 1. There are two different GATE bits, one for Timer 1 (TMOD.7) and one for Timer 0 (TMOD.3). Mode 1: Mode 1 is the same as Mode 0, except that all 16 bits of the timer register (THn and TLn) are used.

Fig 4.5.2: Timer/Counter 0 or 1 in Mode 1 (16-bit counter) Mode 2: Mode 2 configures the Timer register as an 8-bit Counter (TLn) with automatic reload. Overflow from TLn not only sets TFn, but also reloads TLn with the contents of THn, which must be preset by software. The reload leaves THn unchanged. Mode 2 operation is the same for Timer 0 and Timer 1.

P a g e | 61

Fig 4.5.3 Timer/Counter 0 or 1 in Mode 2 (8-bit auto-reload) Mode 3: When timer 1 is in Mode 3 it is stopped (holds its count). The effect is the same as setting TR1 = 0. Timer 0 in Mode 3 establishes TL0 and TH0 as two separate 8-bit counters. The logic for Mode 3 and Timer 0 is shown in Figure. TL0 uses the Timer 0 control bits: T0C/T, T0GATE, TR0, INT0, and TF0. TH0 is locked into a timer function (counting machine cycles) and takes over the use of TR1 and TF1 from Timer 1. Thus, TH0 now controls the Timer 1 interrupt. Mode 3 is provided for applications that require an extra 8-bit timer. With Timer 0 in Mode 3, the P89V51RD2 can look like it has an additional Timer. Note: When Timer 0 is in Mode 3, Timer 1 can be turned on and off by switching it into and out of its own Mode 3. It can still be used by the serial port as a baud rate generator, or in any application not requiring an interrupt.

Fig 4.5.4: Timer/Counter 0 Mode 3 (two 8-bit counters)

Timer 2

P a g e | 62 Timer 2 is a 16-bit Timer/Counter which can operate as either an event timer or an event counter, as selected by C/T2 in the special function register T2CON. Timer 2 has four operating modes: Capture, Auto-reload (up or down counting), Clock-out, and Baud Rate Generator which are selected according to Table 17 using T2CON (Table 18 and Table 19) and T2MOD (Table 20 and Table 21).

4.6 UARTs
The UART operates in all standard modes. Enhancements over the standard 80C51 UART include Framing Error detection, and automatic address recognition. Mode 0 Serial data enters and exits through RxD and TxD outputs the shift clock. Only 8 bits are transmitted or received, LSB first. The baud rate is fixed at 16 of the CPU clock frequency. UART configured to operate in this mode outputs serial clock on TxD line no matter whether it sends or receives data on RxD line. Mode 1 10 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0), 8 data bits (LSB first), and a stop bit (logical 1). When data is received, the stop bit is stored in RB8 in Special Function Register SCON. The baud rate is variable and is determined by the Timer 12 overflow rate. Mode 2: 11 bits are transmitted (through TxD) or received (through RxD): start bit (logical 0), 8 data bits (LSB first), a programmable 9th data bit, and a stop bit (logical 1). When data is transmitted, the 9th data bit (TB8 in SCON) can be assigned the value of 0 or (e.g. the parity bit (P, in the PSW) could be moved into TB8). When data is received, the 9th data bit goes into RB8 in Special Function Register SCON, while the stop bit is ignored.

P a g e | 63 The baud rate is programmable to either 116 or 132 of the CPU clock frequency, as determined by the SMOD1 bit in PCON. Mode 3 11 bits are transmitted (through TxD) or received (through RxD): a start bit (logical 0), 8 data bits (LSB first), a programmable 9th data bit, and a stop bit (logical 1). In fact, Mode 3 is the same as Mode 2 in all respects except baud rate. The baud rate in Mode 3 is variable and is determined by the Timer 12 overflow rate.

Framing error Framing error (FE) is reported in the SCON.7 bit if SMOD0 (PCON.6) = 1. If SMOD0 = 0, SCON.7 is the SM0 bit for the UART, it is recommended that SM0 is set up before SMOD0 is set to 1.

4.7 Serial peripheral interface


SPI features Master or slave operation 10 MHz bit frequency (max) LSB first or MSB first data transfer Four programmable bit rates End of transmission (SPIF) Write collision flag protection (WCOL)

Watchdog timer
The device offers a programmable Watchdog Timer (WDT) for fail safe protection against software deadlock and automatic recovery. To protect the system against software deadlock, the user software must refresh the WDT within a user-defined time period. If the software fails to do this periodical refresh, an internal hardware reset will be initiated if enabled (WDRE = 1). The software can be designed such that the WDT times out if the program does not work properly.

P a g e | 64 The WDT in the device uses the system clock (XTAL1) as its time base. So strictly speaking, it is a Watchdog counter rather than a Watchdog timer. The WDT register will increment every 344,064 crystal clocks. The upper 8-bits of the time base register (WDTD) are used as the reload register of the WDT. The WDTS flag bit is set by WDT overflow and is not changed by WDT reset. User software can clear WDTS by writing 1' to it. Figure 19 provides a block diagram of the WDT. Two SFRs (WDTC and WDTD) control Watchdog timer operation. During idle mode, WDT operation is temporarily suspended, and resumes upon an interrupt exit from idle. The time-out period of the WDT is calculated as follows: Period = (255 - WDTD) 344064 1/fCLK (XTAL1) where WDTD is the value loaded into the WDTD register and fosc is the oscillator frequency.

Fig 4.7.1: Block diagram of programmable Watchdog timer

4.8 Interrupts Reset


A system reset initializes the MCU and begins program execution at program memory location 0000H. The reset input for the device is the RST pin. In order to reset the device, a logic level high must be applied to the RST pin for at least two machine cycles (24 clocks), after the oscillator becomes stable. ALE, PSEN are weakly pulledhigh during reset. During reset, ALE and PSEN output a high level in order to perform a proper reset. This level must not be affected by external element.

P a g e | 65 Power-on Reset At initial power up, the port pins will be in a random state until the oscillator has started and the internal reset algorithm has weakly pulled all pins HIGH. Powering up the device without a valid reset could cause the MCU to start executing instructions from an indeterminate location. Such undefined states may inadvertently corrupt the code in the flash. When power is applied to the device, the RST pin must be held HIGH long enough for the oscillator to start up (usually several milliseconds for a low frequency crystal), in addition to two machine cycles for a valid power-on reset. An example of a method to extend the RST signal is to implement a RC circuit by connecting the RST pin to VDD through a 10 mF capacitor and to VSS through an 8.2 kW resistor as shown in Figure . Note that if an RC circuit is being used, provisions should be made to ensure the VDD rise time does not exceed 1 millisecond and the oscillator start-up time does not exceed 10 milliseconds. For a low frequency oscillator with slow start-up time the reset signal must be extended in order to account for the slow start-up time. This method maintains the necessary relationship between VDD and RST to avoid programming at an indeterminate location, which may cause corruption in the code of the flash. The power-on detection is designed to work as power-up initially, before the voltage reaches the brown-out detection level. The POF flag in the PCON register is set to indicate an initial power-up condition. The POF flag will remain active until cleared by software. Please refer to the PCON register definition for detail information. Following reset, the P89V51RD2 will either enter the SoftICE mode (if previously enabled via ISP command) or attempt to autobaud to the ISP boot loader. If this autobaud is not successful within about 400 ms, the device will begin execution of the user code.

P a g e | 66

Fig 4.7.2 Power-on reset circuit.

Software reset The software reset is executed by changing FCF[1] (SWR) from 0 to 1. A software reset will reset the program counter to address 0000H. All SFR registers will be set to their reset values, except FCF[1] (SWR), WDTC[2] (WDTS), and RAM data will not be altered. Brown-out detection reset The device includes a brown-out detection circuit to protect the system from severed supplied voltage VDD fluctuations. The P89V51RD2s brown-out detection threshold is 3.85 V. For brown-out voltage parameters, please refer to Table 67 and Table 68. When VDD drops below this voltage threshold, the brown-out detector triggers the circuit to generate a brown-out interrupt but the CPU still runs until the supplied voltage returns to the brown-out detection voltage VBOD. The default operation for a brown-out detection is to cause a processor reset. VDD must stay below VBOD at least four oscillator clock periods before the brown-out detection circuit will respond. Brown-out interrupt can be enabled by setting the EBO bit in IEA register (address E8H, bit 3). If EBO bit is set and a brown-out

P a g e | 67 condition occurs, a brown-out interrupt will be generated to execute the program at location 004BH. It is required that the EBO bit be cleared by software after the brown-out interrupt is serviced. Clearing EBO bit when the brown-out condition is active will properly reset the device. If brownout interrupt is not enabled, a brown-out condition will reset the program to resume execution at location 0000H Interrupt priority and polling sequence The device supports eight interrupt sources under a four level priority scheme. Table 43 summarizes the polling sequence of the supported interrupts. Note that the SPI serial interface and the UART share the same interrupt vector.

Table 7: Interrupt polling service Power-saving modes The device provides two power saving modes of operation for applications where power consumption is critical. The two modes are idle and Power-down, see Table 56. Idle mode Idle mode is entered setting the IDL bit in the PCON register. In idle mode, the program counter (PC) is stopped. The system clock continues to run and all interrupts and peripherals remain active. The on-chip RAM and the special function registers hold their data during this mode. The device exits idle mode through either a system interrupt or a hardware reset. Exiting idle mode via system interrupt, the start of the interrupt clears the IDL bit and exits idle mode. After exit the Interrupt Service Routine, the interrupted program resumes

P a g e | 68 execution beginning at the instruction immediately following the instruction which invoked the idle mode. A hardware reset starts the device similar to a power-on reset. Power-down mode The Power-down mode is entered by setting the PD bit in the PCON register. In the Power-down mode, the clock is stopped and external interrupts are active for level sensitive interrupts only. SRAM contents are retained during Power-down, the minimum VDD level is 2.0 V. The device exits Power-down mode through either an enabled external level sensitive interrupt or a hardware reset. The start of the interrupt clears the PD bit and exits Power-down. Holding the external interrupt pin low restarts the oscillator, the signal must hold low at least 1024 clock cycles before bringing back high to complete the exit. Upon interrupt signal restored to logic VIH, the interrupt service routine program execution resumes beginning at the instruction immediately following the instruction which invoked Power-down mode. A hardware reset starts the device similar to power-on reset. To exit properly out of Power-down, the reset or external interrupt should not be executed before the VDD line is restored to its normal operating voltage. Be sure to hold VDD voltage long enough at its normal operating level for the oscillator to restart and stabilize (normally less than 10 ms). System clock and clock options Clock Input Options and Recommended Capacitor Values for Oscillator Shown in Figure 28 are the input and output of an internal inverting amplifier (XTAL1, XTAL2), which can be configured for use as an on-chip oscillator. When driving the device from an external clock source, XTAL2 should be left disconnected and XTAL1 should be driven. At start-up, the external oscillator may encounter a higher capacitive load at XTAL1 due to interaction between the amplifier and its feedback capacitance. However, the capacitance will not exceed 15 pF once the external signal meets the VIL and VIH specifications. Crystal manufacturer, supply voltage, and other factors may cause circuit performance to differ from one application to another. C1 and C2 should be adjusted

P a g e | 69 appropriately for each design. Table 57 shows the typical values for C1 and C2 vs. crystal type for various frequencies

Table 8:Recommended values for C1 and C2

Clock doubling option By default, the device runs at 12 clocks per machine cycle (x1 mode). The device has a clock doubling option to speed up to 6 clocks per machine cycle (please see Table 58). Clock double mode can be enabled either by an external programmer or using IAP. When set, the EDC bit in FST register will indicate 6 clock mode. The clock double mode is only for doubling the internal system clock and the internal flash memory, i.e. EA = 1. To access the external memory and the peripheral devices, careful consideration must be taken. Also note that the crystal output (XTAL2) will not be doubled.

P a g e | 70

5. SOFTWARE
5.1 Overview of KEIL CROSS C COMPILER
It is possible to create the source files in a text editor such as Notepad, run the Compiler on each C source file, specifying a list of controls, run the Assembler on each Assembler source file, specifying another list of controls, run either the Library Manager or Linker (again specifying a list of controls) and finally running the Object-HEX Converter to convert the Linker output file to an Intel Hex File. Once that has been completed the Hex File can be downloaded to the target hardware and debugged. Alternatively KEIL can be used to create source files; automatically compile, link and covert using options set with an easy to use user interface and finally simulate or perform debugging on the hardware with access to C variables and memory. Unless you have to use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the process of creating and testing an embedded application. Projects The user of KEIL centers on projects. A project is a list of all the source files required to build a single application, all the tool options which specify exactly how to build the application, and if required how the application should be simulated. A project contains enough information to take a set of source files and generate exactly the

P a g e | 71 binary code required for the application. Because of the high degree of flexibility required from the tools, there are many options that can be set to configure the tools to operate in a specific manner. It would be tedious to have to set these options up every time the application is being built; therefore they are stored in a project file. Loading the project file into KEIL informs KEIL which source files are required, where they are, and how to configure the tools in the correct way. KEIL can then execute each tool with the correct options. It is also possible to create new projects in KEIL. Source files are added to the project and the tool options are set as required. The project can then be saved to preserve the settings. The project also stores such things as which windows were left open in the simulator/debugger, so when a project is reloaded and the simulator or debugger started, all the desired windows are opened. KEIL project files have the extension . Simulator/Debugger The simulator/ debugger in KEIL can perform a very detailed simulation of a micro controller along with external signals. It is possible to view the precise execution time of a single assembly instruction, or a single line of C code, all the way up to the entire application, simply by entering the crystal frequency. A window can be opened for each peripheral on the device, showing the state of the peripheral. This enables quick trouble shooting of mis-configured peripherals. Breakpoints may be set on either assembly instructions or lines of C code, and execution may be stepped through one instruction or C line at a time. The contents of all the memory areas may be viewed along with ability to find specific variables. In addition the registers may be viewed allowing a detailed view of what the microcontroller is doing at any point in time. The Keil Software 8051 development tools listed below are the programs you use to compile your C code, assemble your assembler source files, link your program together, create HEX files, and debug your target program. Editing, and Program Debugging in one powerful environment. C51 ANSI Optimizing C Cross Compiler: creates relocatable object modules from your C source code, Vision2 for Windows Integrated Development Environment: combines Project Management, Source Code

P a g e | 72 A51 Macro Assembler: creates relocatable object modules from your 8051 assembler source code, BL51 Linker/Locator: combines relocatable object modules created by the compiler and assembler into the final absolute object module, LIB51 Library Manager: combines object modules into a library, which may be used by the linker, OH51 Object-HEX Converter: creates Intel HEX files from absolute object modules.

5.2 SOURCE CODE


#include <at89c51xd2.h> #include <string.h> #include "lcd.h" #include "usart.h" #include "gsm.h"

xdata unsigned char smsMessage[100];

#define irSensor P1_2

void main( void ) {

const unsigned char *myString1 = "*** WELCOME ***";

P a g e | 73 const unsigned char *myString2 = " TO ";

const unsigned char *myString3 = "GSM & RFID BASED"; const unsigned char *myString4 = "VEHICLE DETAILS "; const unsigned char *myString5 = " EXTRACTION "; const unsigned char *myString6 = "FLASH THE CARD "; const unsigned char *myString7 = " xdata unsigned char rfIdNumber[13]; unsigned char swNo = 0; NOW ";

USART_Init_9600();

Lcd_Init(); SenStringToLcd ( 1, myString1 ); SenStringToLcd ( 2, myString2 ); DelayMs(500); SenStringToLcd ( 1, myString3 ); DelayMs(300); SenStringToLcd ( 1, myString4 ); SenStringToLcd ( 2, myString5 ); DelayMs(500);

P a g e | 74 SenStringToLcd ( 1, "Sending SMS " );

SenStringToLcd ( 2, "****************" ); SendSms("+919030725846", "GSM Modem Test"); DelayMs( 500 ); SenStringToLcd ( 2, "SMS Sent ......." );

DelayMs( 300 );

while(1){

SenStringToLcd ( 1, myString6 ); SenStringToLcd ( 2, myString7 ); DelayMs(5);

strcpy( rfIdNumber, "\0"); USART_Ready_To_Receive(); for( swNo = 0; swNo < 12; swNo++ ){ rfIdNumber[swNo] = USART_Read_A_Char(); } rfIdNumber[12] = '\0';

P a g e | 75 SenStringToLcd ( 2, " " );

SenStringToLcd ( 2, rfIdNumber ); DelayMs( 200 );

if( !strcmp( rfIdNumber, "260092D34D2A" ) ){

SenStringToLcd ( 1, "U R Authorised " ); SenStringToLcd ( 2, "****************" ); DelayMs( 300 ); SenStringToLcd ( 1, "Please Wait " );

SenStringToLcd ( 2, "While Processing" ); DelayMs( 300 ); SenStringToLcd ( 1, " Owner Name " ); SenStringToLcd ( 2, " DelayMs( 300 ); SenStringToLcd ( 1, " Vehicle No " ); SenStringToLcd ( 2, " AP 29 AD 9623 " ); DelayMs( 300 ); SenStringToLcd ( 1, "Colour: Black " ); SenStringToLcd ( 2, "Model : Pleasure" ); DelayMs( 300 ); Spurthi " );

P a g e | 76

while( irSensor == 0 ); SenStringToLcd ( 1, "Detected Signal " ); SenStringToLcd ( 2, "Breaking..... " ); DelayMs( 300 );

SenStringToLcd ( 1, "Sending SMS

" );

SenStringToLcd ( 2, "****************" ); strcpy( smsMessage, "Name: Spurthi, Reg No: AP29 AD 9623, Colour: Black, Model: Pleasure" ); SendSms( "+919030725846", smsMessage ); DelayMs( 500 ); SenStringToLcd ( 2, "SMS Sent ......." ); SenStringToLcd ( 1, "****************); SenStringToLcd ( 2, "****************" );

} else if( !strcmp( rfIdNumber, "26009354C524" ) ){

SenStringToLcd ( 1, "U R Authorised " ); SenStringToLcd ( 2, "****************" );

P a g e | 77 DelayMs( 300 ); SenStringToLcd ( 1, "Please Wait " );

SenStringToLcd ( 2, "While Processing" ); DelayMs( 300 ); SenStringToLcd ( 1, " Owner Name " ); SenStringToLcd ( 2, " DelayMs( 300 ); SenStringToLcd ( 1, " Vehicle No " ); SenStringToLcd ( 2, " AP 31 BE 5684 " ); DelayMs( 300 ); SenStringToLcd ( 1, "Colour: Red " ); Bhavani " );

SenStringToLcd ( 2, "Model : Scooty " ); DelayMs( 300 );

while( irSensor == 0 ); SenStringToLcd ( 1, "Detected Signal " ); SenStringToLcd ( 2, "Breaking..... " ); DelayMs( 300 );

SenStringToLcd ( 1, "Sending SMS

" );

SenStringToLcd ( 2, "****************" );

P a g e | 78 strcpy( smsMessage, "Name: Bhavani, Reg No: AP31 BE 5684, Colour: Red, Model: Scooty" ); SendSms( "+919030725846", smsMessage ); DelayMs( 500 ); SenStringToLcd ( 2, "SMS Sent ......." ); SenStringToLcd ( 1, "****************" ); SenStringToLcd ( 2, "****************" ); } else{

SenStringToLcd ( 1, "U R NOT Athorisd" ); SenStringToLcd ( 2, " DelayMs( 300 ); } } " );

P a g e | 79

6. Conclusion
The purpose of the project to get instantaneous vehicle registration information over wireless using GSM is successfully done. This project is very helpful for traffic police to get the vehicle owners registration details on the field itself. The system also displays the recent fines to be paid by that particular registered vehicle owner. This helps in the increasing revenue of the government. It also greaftly helps the traffic authority to trace the lost vehicles.

Vous aimerez peut-être aussi