You are on page 1of 68

PROJECT REPORT BAISED ON RF BASED RESTAURANT ORDERING SYSTEM Submission of report in the partial fulfillment of requirement of degree BACHLOR

OF TECHNOLOGY In ELECTRONICS AND COMMUNICATION ENGINEERING Under Punjab Technical University

Submitted by: Karan Kumar (100780419302) Manveer Kaur (100780419305) Himani Gwari (100780419299) Ankita Rani (100780419296)

Under the Supervision of: Er. Rajni Rojra (Asst. Prof.&H.O.D.) Er. Shalley Raina (Asst. Prof.) Electronics and Communication Department Swami Parmanand Engineering College Lalru, Mohali

ABSTRACT
The project mainly aims in designing completely automated menu in restaurants with the help of touch screen sensor and a graphical LCD to provide a user-friendly environment. There is no need of a person to take the order from the table. The menu will be displayed automatically on the table and we can directly order the menu with the help of touch screen. Touch screens provide fast access to any and all types of digital media, with no textbound interface getting in the way. Faster input can mean better service. Using a touch interface can effectively increase operator accuracy, reduce training time, and improve overall operational efficiencies, a properly designed touch interface can improve each operator's accuracy. Touch screens are practical in automation, which has become even simpler with touch screen technology. Owners familiar with the icon system appreciate touch screens that make automation systems user friendly. The system consists of a microcontroller, which is interfaced with the input and output modules, the controller acts as an intermediate medium between both of them. So the controller can be termed as a control unit. The input module is nothing but a touch screen sensor which is placed on GLCD to have graphical image display, which takes the input from the user and provides the same to the microcontroller. The output module is RF module which makes the communication between system at table and system at ordering department. The controller also takes the responsibility to display the menu items on the graphical LCD. At the receiving end the selected items will be displayed on GLCD with user table number.

ACKNOWLEDGEMENTS
First of all I would like to thanks Almighty for his blessings. Then I would like to thanks my Principal Mam, Ms. JyotiMatto for providing me such a great environment. I also thankful to my H.O.D. Er. Rajni Rojra and all my teachers for her support not only subjectively but also mentally. My deep gratitude is extended to my teachers Er. Rajni Rojra & Er. Shalley Raina for his guidance. Her assistance opened new doors for my academic pursuits. Her encouragement guided me through a difficult period of project research. Her instructions were always constructive and positive. At last but not the least, I would like thank my Parents and grand Parents, without their help, encouragement, support and patience, it would have been impossible to stand here.

CERTIFICATE
This is to certify that KARAN KUMAR Roll no. 100780419302, Manveer Kaur Roll No. 100780419305, Ankita Rani Roll No. 100780419296, Himani Gwari Roll No. 100780419299 student of Swami Parmanand Engineering College; ECE 7th SEM (2010-2014) has successfully completed his project RF based Restaurant Ordering System under the supervision of Er. Rajni Rojra and Er.Shalley Raina in the ECE department.

Er. Rajni Rojra (Asst. Prof.)

Er. Shalley Raina Asst. Prof.

Er. Rajni Rojra (Head ECE Dept.)

Table of Content
Abstract..(I) Acknowledgement(II) Certificate(III) Step down Transformer(1-10) Bridge Rectifier..(11-12) HT12D..(13-18) RF Receiver & Transmitter Module..(19-20) 162A LCD Display(21-24) Microcontroller..(25-52) Capacitor .(53-54) Resistor.(55-56) Crystal Oscillator ..(57) Semiconductor..(58-63)

Introduction
Three phase transformers are used throughout industry to change values of three-phase voltage and current. Since three-phase power is the most common way in which power is produced, transmitted, and used, an understanding of how three phase transformer connections are made is essential. In this section it will discuss different types of three phase transformers connections. A three-phase transformer is constructed by winding three single-phase transformers on a single core. These transformers are put into an enclosure, which is then filled with dielectric oil. The dielectric oil performs several functions. Since it is a dielectric, a nonconductor of electricity, it provides electrical insulation between the windings and the case. It is also used to help provide cooling and to prevent the formation of moisture, which can deteriorate the winding insulation. Connection This connection as shown in figure below is very suitable for step-down applications. The secondary winding current is about 58% of the load current. On the primary side the voltages are from line to neutral, whereas the voltages are from line to line on the secondary side. Therefore, the voltage and the current in the primary are out of ohase with the voltage and the current in the secondary. In a Y/ connection the distortion in the waveform of the induced voltages is not as drastic as it is in a Y/Y-connected transformer when the neutral is not connected to the ground the reason is that the distorted currents in the primary give rise to a circulating current in the -connected secondary.(4:256)

Figure (2) Y/ connected three-phase transformer

/Y Connection This connection as shown in figure below is proper for a step-up application. However, this connection is now being exploited to satisfy the requirements of both three-phase and the single-phase loads. In this case, we use a four-wire secondary. The single-phase loads are taken care of by the three line-to-neutral circuits. An attempt is invariably made to distribute the single-phase loads almost equally among three-phases.(4:256)

Figure (3) /Y connected three-phase transformer d) / Connection as shown below the three transformers with the primary and secondary windings connected as /. The line-to-line voltage on either side is equal to the corresponding phase voltage. Therefore, this arrangement is useful when the voltages are not very high. The advantage of this connection is that even under unbalanced loads the three-phase load voltages remain substantially equal. This disadvantage of / connection is the absence of a neutral terminal on either side. Another drawback is that the electrical insulation is stressed to the line voltage. Therefore, a -connection winding requires more expensive insulation than a Y-connected winding for the same power rating.(4:255)

Figure (4) / connected three-phase transformer C. Analysis of three-phase Transformer Under steady-state conditions, a single three-phase transformer operates exactly the same way as three single-phase transformers connected together. Therefore, in our discussion that follows we assume that we have three identical single-phase transformers connected to form a three-phase transformer. D. Electrical Characteristics Transformers in the trade are either autotransformers (non isolating) or isolation transformers. The main difference between the two is that isolating transformers protect the load from any problems associated with the supply voltage. These are ideally suited for loads that are finicky to voltage spikes and dips, or there is a concern for damage to expensive electronic components. Speaking of protection, the majority of transformers have inherent protection for the secondary through a fuse or thermal link. The fuse may or may not be easily replaceable. When installing transformers, if there is any doubt, at the least install secondary fusing to protect the transformer and/or load on the transformer. It is also recommended to install primary line side fusing for maximum protection. There are three basic configurations of transformers used in the trade. Primary voltages are typically AC (alternating current), while the secondary voltage might be AC or DC (direct current). a) Step down transformers

This is used where a lower voltage is required to supply a load or control voltage. Example: A unit has a 230-volt supply, and the control circuit requires 24 volts. A unit has 600-volt supply and a damper motor requires 120 volts.

Figure (5) step down transformer

b) Step up transformers Rarely seen in the trade but is sometimes used, it is used where a higher voltage is required. Example: Unit supply voltage is 120 volts and a crankcase heater requires a 230-volt supply.

Figure (6) step up transformer

c) Isolation transformers Another transformer that is sometimes used is Isolation transformer, which has the same primary and secondary voltages. They are used to protect the secondary load from supply voltage irregularities. Note that isolation transformers are also available in step up and step down configurations.

Figure (7) isolation transformer

E. How transformers work

A basic transformer consists of two sets of coils or windings. Each set of windings is simply an inductor. AC voltage is applied to one of the windings, called the primary winding. The other winding, called the secondary winding, is positioned in close proximity to the primary winding, but is electrically isolated from it. The alternating current that flows through the primary winding establishes a time-varying magnetic flux, some of which links to the secondary winding and induces a voltage across it. The magnitude of this voltage is proportional to the ratio of the number of turns on the primary winding to the number of turns on the secondary winding. This is known as the turns ratio. To maximize flux linkage with the secondary circuit, an iron core is often used to provide a low-reluctance path for the magnetic flux. The polarity of the windings describes the direction in which the coils were wound onto the core. Polarity determines whether the flux produced by one winding is additive or subtractive with respect to the flux produced by another winding. A basic two-winding transformer is shown in the Figure below.

Figure (8) how transformer work

F. Transformer Construction
The simple elements of a transformer consist of two coils having mutual inductance and a laminated steel core. The two coils are insulated from each other and the steel core. Other necessary parts are some suitable container for assembled core and windings; a suitable medium for insulating the core and its windings from its container; suitable bushings (either of porcelain, oil filled or capacitor type) for insulating and bringing out the terminals of windings from the tank. In all type of transformers, the core is constructed of transformer sheet steel laminations assembled to provide a continuous magnetic path with a minimum of air gap included. The steel used is of high silicon content, some times heat treated to produce a high permeability and low hysteresis loss at the usual operating flux densities. Laminating the core minimizes the eddy current loss, the laminations being insulated from each other by a light coat of coreplate varnish or by an oxide layer on the surface. The thickness of lamination varies from 0.35mm for a frequency of 50 Hz to 0.5 mm for a frequency of 25 Hz. The core laminations (in the form of strips) are joined. The joints in the alternate layers are staggered in order to avoid the presence of narrow gaps right through the cross-section of the core. Such staggered joints are said to be Imprecated. Constructional distinguished from each other merely by the manner in which the primary and secondary coils are placed around the laminated core. The two types are known as:

1) Core Type; 2) Shell Type;

In the so-called core type transformers, the windings surround a considerable part of the core. Where as shell type transformer, the core surrounds a considerable part of the windings. In the simplified diagram for the core type transformers, the primary and secondary windings are shown located on the opposite legs of the core, but in actual construction, these are always interleaved to reduce leakage flux. As shown in the figure, half the primary and half the secondary windings have been placed side by side or concentrically on each limb, not primary on one limp and the secondary on the other. In both core and shell type transformers, the individual laminations are cut in the form of long strips of Ls, Es and Is. In order to avoid high reluctance at the joints where the laminations are butted against each other, the alternate layers are stacked differently to eliminate these joints. a) Core-type transformer

Figure (9) core type transformer The coils are form-wound and are of cylindrical type. The general form of these coils may be circular or oval or rectangular. In small size core-type transformers, a simple rectangular core is used with cylindrical coils, which are either circular or rectangular in form. But for large size core-type transformers, round or circular coils are used which are so wound as to fit over a cruciform core section. The circular coils are used in most of the core-type transformers because of their mechanical strength. Such coils are wound in helical layers with different layers insulated from each other by paper, cloth, or cooling ducts. Since the low voltage (LV) winding is easiest to insulate, it is placed nearest to the core.

Because of lamination and insulation, the net or effective core area is reduced, due allowance for which has to be made. It is found that in general, the reduction in core cross-sectional area due to the presence of paper, etc. is of the order of 10% approx.

Rectangular cores with rectangular cylindrical coils can be used for small size core-type transformers. For large size transformers, circular cylindrical coils are preferred. Obviously, a considerable amount of useful space is wasted. A common improvement on square-core is to employ cruciform core which demands at least two sizes of core strips. For very large transformers, further core stepping is done which not only gives high space factor but also results in reduced length of the mean turn and consequent I2R loss. b) Shell-type transformers

Figure (10) shell type transformer

The coils are form wound but are multilayer disc type usually wound in the form of pancakes. The different layers of such multilayer discs are insulated from each other by paper. The complete winding consists of stacked discs with insulation space between the coils, the spaces forming horizontal and cooling ducts. It may be pointed out that cores and coils of transformers must be provided with rigid mechanical bracing in order to prevent movement and possible insulation damage. Good bracing reduces vibration and the objectionable noise _ a humming sound operation. The spiral _core transformer employs the newest development in core construction. The core is assembled of a continuous strip or ribbon of transformer steel wound in the form of a circular or elliptical cylinder. Such construction allows the core flux to follow the grain of the iron. Cold _ rolled steel of high silicon content enables the designer to use considerably higher operating flux densities with lower loss per kg. The use of higher flux density reduces the weight per KVA. Hence, the advantages of such construction are _ during

1. A relatively more rigid core 2. Lesser weight and size per kVA rating 3. Lower iron losses at higher operating flux densities 4. Lower cost of manufacture.

G. Mathematical Working of a Transformer An alternating voltage applied to primary circuit P circulates an alternating current through P and this current produces an alternating flux in the steel core. If the whole of the flux produced by P passes through secondary circuit S, the emf induced in each turn is the same for P and S. Hence, if N1 and N2 be the number-of turns on P and S respectively,

Total em. induced in S = N2 x emf. per turn = Total emf. induced in P = N1 x emf. per turn =

N2 N1

When the secondary is on open circuit, its terminal voltage is the same as the induced emf. The primary current is then very small, so that the applied voltage V1 is practically equal and opposite to the emf. induced in P. Hence: V2 = V1 = N2 N1

Since the full-load efficiency of a transformer is nearly 100 percent, I1V1 x primary power factor = I2 V2 x secondary power factor. But the primary and secondary power factors at full load are nearly equal, I1 / I2 = V2 /V1

An alternative and more illuminating method of deriving the relationship between the primary and secondary currents is based upon a comparison of the primary and secondary ampere-turns. When the secondary is on open circuit, the primary current is such that the primary ampere-turns are just sufficient to produce the flux necessary to induce an emf. that is practically equal and opposite to the applied voltage. This magnetizing current is usually about 3- 5 per cent of the full-load primary current. When a load is connected across the secondary terminals, the secondary current by Lenzs Law produces a demagnetizing effect. Consequently the flux and the emf induced in the primary are reduced slightly. But this small change can increase the difference between the applied voltage and the emf. induced in the primary from, say, 0.05 pet cent to, say, 1 per cent, in which case the new primary current would be 20 times the no-load current. The demagnetizing ampere-turns of the secondary are thus nearly neutralized by the increase in the primary ampere-turns; and since the primary ampere-turns on no load are very small compared with the full-load ampere-turns.

What is a Bridge Rectifier?


A bridge rectifier is an arrangement of four or more diodes in a bridge circuit configuration which provides the same output polarity for either input polarity. It is used for converting an alternating current (AC) input into a direct current (DC) output. A bridge rectifier provides full-wave rectification from a two-wire AC input, therefore resulting in lower weight and cost when compared to a rectifier with a 3-wire input from a transformer with a center-tapped secondary winding.

Types of Bridge Rectifiers


There are many different kinds of bridge rectifiers and at Future Electronics we stock many of the most common types categorized by maximum average rectified current, maximum reverse voltage, maximum peak current, forward voltage, packaging type and maximum reverse current. The parametric filters on our website can help refine your search results depending on the required specifications. The most common sizes for maximum average rectified current are 1A, 1.5 A, 4 A, 25 A and 35 A. We also carry bridge rectifiers with maximum average rectified current as high as 1000 A. Forward voltage can range from 450 mV to 1.1 kV, with the most common bridge rectifier semiconductor chips having a forward voltage of 1.1 V or 1 V.

Bridge Rectifiers from Future Electronics


Future Electronics has a full selection of bridge rectifier chips from several manufacturers that can be used to design a full wave bridge rectifier circuit, half wave rectifier or any other type of circuits that may require a bridge rectifier. Simply choose from the bridge rectifier technical attributes below and your search results will quickly be narrowed to match your specific bridge rectifier application needs. If you have a preferred brand, we deal with several manufacturers such as Central Semiconductor, Diodes Inc., Fairchild, IXYS, Micro Commercial Comp or Vishay, among other manufacturers. You can easily refine your bridge rectifier product search results by clicking your preferred bridge rectifier brand below from our list of manufacturers.

Applications for Bridge Rectifiers:


The primary application of bridge rectifiers is to transform an AC supply into DC power. All electronic devices require direct current, so bridge rectifiers are used inside the power supplies of almost all electronic equipment. Bridge rectifiers are also used for detecting the amplitude of modulated radio signals. The signal may be amplified before it is detected. If it is not, then a very low voltage drop diode or a diode biased with a fixed voltage must be used. Rectifiers are also used to supply polarized voltage for welding applications. Control of the output current is required in such circuits, and this may be achieved by replacing some of the diodes in a bridge rectifier with thyristors, which are diodes whose voltage output can be regulated by switching on and off with phase fired controllers.

Choosing the Right Bridge Rectifier:


When you are looking for the right bridge rectifiers, with the FutureElectronics.com parametric search, you can filter the results by various attributes: by Maximum Average Rectified Current (0.15 A, 1A, 1.5A, 25 A, 35 A,), Maximum Peak Current (12 A, 50 A, 200 A, 300 A,) and Forward Voltage (450 mV to 1.1 kV) to name a few. You will be able to find the right semiconductor chip from several manufacturers that can be used to design a half wave rectifier, full wave bridge rectifier circuit or any other circuits requiring a bridge rectifier.

Bridge Rectifiers in Production Ready Packaging or R&D Quantities


If the quantity of bridge rectifiers required is less than a full reel, we offer customers many of our programmable bridge rectifier products in tube, tray or individual quantities that will avoid unneeded surplus. In addition, Future Electronics offers clients a unique bonded inventory program that is designed to eliminate potential problems that may arise from an unpredictable supply of products containing raw metals and products with erratic or long lead times. Talk with your nearest Future Electronics branch and find out more on how you and your company can avoid possible shortages.

ENCODER AND DECODER ENCODER:


An encoder is a device used to change a signal (such as a bitstream) or data into a code. The code may serve any of a number of purposes such as compressing information for transmission or storage, encrypting or adding redundancies to the input code, or translating from one code to another. In digital electronics this would mean that a decoder is a multipleinput, multiple-output logic circuit(2n-n).

DECODER:
A decoder is a device which does the reverse of an encoder, undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode. In digital electronics this would mean that a decoder is a multiple-input, multiple-output logic circuit(n-2 ).
n

HT12E FEATURES:
Operating voltage 2.4V~5V for the HT12A 2.4V~12V for the HT12E

Low power and high noise immunity CMOS technology Low standby current: 0.1_A (type.) at VDD=5V HT12A with a 38kHz carrier for infrared transmission medium Minimum transmission word Four words for the HT12E One word for the HT12A

Built-in oscillator needs only 5% resistor Data code has positive polarity Minimal external components HT12A/E: 18-PIN DIP/20-PIN SOP package

The 212 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the application flexibility of the 212 series of encoders. The HT12A additionally provides a 38 kHz carrier for infrared systems.

PIN DESCRIPTION:

PIN A0-A7: Input pins for address A0~A7 setting PIN AD8~AD11: Input pins for address/data AD8~AD11 setting PIN D8~D11: Input pins for data D8~D11 setting and transmission enable, active low PIN DOUT: Encoder data serial transmission output PIN L/MB: Latch/Momentary transmission format selection PIN: PIN : Transmission enable, active low

PIN OSC1: Oscillator input pin.

PIN OSC2: Oscillator output pin. PIN X1: 455 kHz resonator oscillator input. PIN X2: 455 kHz resonator oscillator output PIN VSS: Negative power supply, grounds PIN VDD: Positive power supply

FUNCTIONAL DESCRIPTION OPERATION The 212 series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low). This cycle will repeat itself as long as the transmission enable (TE or D8~D11) is held low. Once the transmission enables returns high the encoder output completes its final cycle and then stops as shown below.

INFORMATION WORD If L/MB=1 the device is in the latch mode (for use with the latch type of data decoders). When the transmission enable is removed during a transmission, the DOUT pin outputs a complete word and then stops. On the other hand, if L/MB=0 the device is in the momentary mode (for use with the momentary type of data decoders). When the transmission enable is removed during a transmission, the DOUT outputs a complete word and then adds 7 words all with the 1 data code. An information word consists of 4 periods as illustrated below.

ADDRESS/DATA WAVEFORM Each programmable address/data PIN can be externally set to one of the following two logic states as shown below. ADDRESS/DATA PROGRAMMING (PRESET) The status of each address/data pin can be individually pre-set to logic high or low. If a transmission - enable signal is applied, the encoder scans and transmits the status of the 12 bits of address/ data serially in the order A0 to AD11 for the HT12E encoder and A0 to D11 for the HT12A encoder. During information transmission these bits are transmitted with a preceding synchronization bit. If the trigger signal is not applied, the chip enters the standby mode and consumes a reduced current of less than 1A for a supply voltage of 5V. Usual applications preset the address pins with individual security codes using DIP switches or PCB wiring, while the data is selected by push buttons or electronic switches. HT12D FEATURES: Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology Low standby current Capable of decoding 12 bits of information Pair with Holteks 212 series of encoders Binary address setting Received codes are checked 3 times Address/Data number combination HT12D: 8 address bits and 4 data bits HT12F: 12 address bits only Built-in oscillator needs only 5% resistor Valid transmission indicator Easy interface with an RF or an infrared transmission medium Minimal external components The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holteks 212 series of encoders. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The

decoders receive serial addresses and data from a programmed 212 series of encoders that are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission.

The 212 series of decoders are capable of decoding the information that consists of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used to decode 12 bits of address information.

PIN DESCRIPTION:

PIN A0~A11: Input pins for address A0~A11 setting PIN D8~D11: Output data pins PIN DIN: Serial data input pin PIN VT: Valid transmission, active high PIN OSC1: Oscillator input pin PIN OSC2: Oscillator output pin PIN VSS: Negative power supply (GND) PIN VDD: Positive power supply

FUNCTIONAL DESCRIPTION OPERATION


The 212 series of decoders provides various combinations of addresses and data pins in different packages so as to pair with the 212 series of encoders. The decoders receive data that are transmitted by an encoder and interpret the first N bits of code period as addresses and the last 12_N bits as data, where N is the address code number. A signal on the DIN pin activates the oscillator which in turn decodes the incoming address and data. The decoders will then check the received address three times continuously. If the received address codes all match the contents of the decoders local address, the 12_N bits of data are decoded to activate the output pins and the VT pin is set high to indicate a valid transmission. This will last unless the address code is incorrect or no signal is received. The output of the VT pin is high only when the transmission is valid. Otherwise it is always low.

OUTPUT TYPE
Of the 212 series of decoders, the HT12F has no data output pin but its VT pin can be used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins whose data remain unchanged until new data are received.

DECODER TIMING:

Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources.

This RF

module comprises

of

an RF

Transmitter and

an RF

Receiver.

The

transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter.

The RF module is often used alongwith a pair of encoder/decoder. The encoder is used for encoding parallel data for transmission feed while reception is decoded by a decoder. HT12EHT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair ICs.

Pin Diagram:

Pin Description: RF Transmitter

Pin No Function 1 2 3 4 Ground (0V) Serial data input pin Supply voltage; 5V Antenna output pin

Name Ground Data Vcc ANT

RF Receiver

Pin No Function 1 2 3 4 5 6 7 8 Ground (0V) Serial data output pin Linear output pin; not connected Supply voltage; 5V Supply voltage; 5V Ground (0V) Ground (0V) Antenna input pin

Name Ground Data NC Vcc Vcc Ground Ground ANT

LCD:
LCD can be abbreviated as Liquid Crystal display has the distinct advantage of having a low power requirement than that of LED. It is typically in the order of microwatts for display as compared to the same order of milliwatts for LED. It does however require an external or internal light source and is limited to a temperature range of 0 to 60 degrees C. Life time is an area because LCD can degrade chemically. The types receiving major interest today are the Field-effect and the dynamic-scattering units. Liquid crystal is a material that will flow like a liquid whose molecular structure has some properties normally associated with solids for the light scattering units the greatest interest is in nematic liquid crystal having crystal structure. The individual molecules have rod like appearance. The indium-oxide conducting surface is transparent and the incident light will simply pass through and crystal appears clear. If a voltage is applied across conducting surfaces, the molecular arrangement is disturbed, with the result the result that regions will be established with different indices of refraction. The incident light is therefore reflected in different directions at the interface between regions of different indices of refraction with the result that the scattered light has a frosted glass appearance. As indicated earlier LCD does not generate its own light but depends on an external or internal source .Under dark conditions it would be necessary for the unit to have its own internal light source either behind or to the side of the LCD. During the day, or in lighted areas, a reflector can be put behind the LCD to reflect the light back through the display for maximum intensity. For optimum operation we can use a combination of transmissive and reflective modes called transflective.

LCD JHD 162A:


Fig. below shows front view of LCD JHD162A:

Back view of the LCD:

There are 16 pins in all. They are numbered from left to right 1 to 16 (if you are reading from the backside). LCD shown above is marked to indicate which the 1st pin was and which the 16th was. You can see the markings right next to 1st and 16th pins. We notice that there is a fine film covering the LCD display in the first pic? We should not remove it until you finish soldering wires and connectors to the pins. Otherwise, the flux and the alcohol that you use during the soldering process will ruin the LCD.

Pin Description:
Pin 1 and 2 are the power supply pins. They need to be connected to the negative rail and the positive rail of a +5v power supply respectively. To get a stable +5v Power supply, you can use a 7805 voltage regulator. It will regulate any voltage that you give it into +5v. Pin 3 is the contrast setting pin. It is said that it must be connected to a potentiometer to control the contrast. However, it works if you just connect a variable resistor in series with it to GND. The lower the resistance, the greater the contrast. Set it at around 1.5K 2K. If you set the value too low or short the pin directly to ground, you will see only dark boxes on the screen. You must set the voltage to around 1-1.5V for optimum contrast. Pins 4, 5 and 6 are control pins of the LCD. Pins 7 to 14 are the Data pins of the LCD. Pin 7 is the least significant bit and pin 14 is the most significant bit (MSB) of the data inputs. If you want to display some number or letter on the display, you have to input the appropriate codes for that character on these pins. These pins are also used for giving certain commands to the display like clearing the display or moving the cursor to a different location. Upon giving the correct signals to the 3 control pins, the character codes or the commands that you have given to the Data pins will be written to the display or executed by the LCD respectively. Pins 15 and 16: Most LCDs have a backlight. A backlight is a light within the LCD panel which makes seeing the characters on screen easier. When you leave your cell phone or mp3 player untouched for sometime, the screen goes dark. That is the backlight turning off. It is possible to use the LCD without the backlight as well. Many LCDs come without a backlight. If your LCD has only 14 pins, then it has no backlight. However, the working of the LCD still remains the same even if your LCD doesnt have a backlight. The Backlight is nothing but an LED. So, a resistor must be connected in series with it to limit the current. The allowable current is 100ma. Then it is best to have a variable resistor (or a transistor) and adjust the current till it is around 90mA.

The RS Pin: The LCD has basically two operating modes: Instruction mode and Character Mode. Depending on the status of this pin, the data on the 8 data pins (D0-D7) is treated as either an instruction or as character data. You have to activate the command mode if you want to give an Instruction to the LCD. Example Clear the display, Move cursor to home etc. You have to activate the character mode if you want to tell the LCD to display some character. To set the LCD in Instruction mode, you set the 4th pin of the LCD (R/S) to GND. To put it in character mode, you connect it to Vcc. The Enable Pin The enable pin has a very simple function. It is just the clock input for the LCD. The instruction or the character data at the data pins (D0-D7) is processed by the LCD on the falling edge of this pin. The Enable pin should be normally held at Vcc by a pull up resistor. When a momentary button switch is pressed, the Pin goes low and back to high again when you leave the switch. Your instruction or character will be executed on the falling edge of the pulse. (i.e. the moment the switch closes) The RW Pin Generally, we always use the LCD to show things on the screen. However, in some rare cases, we may need to read from the LCD what it is displaying. In such cases, the R/W pin is used. For all practical purposes, the R /W pin has to be permanently connected to GND.

MICRCONTROLLER

Introduction :
A decade back the process and control operations were totally implemented by the

Microprocessors only. But now a days the situation is totally changed and it is occupied by the new devices called Microcontroller. The development is so drastic that we cant find any electronic gadget without the use of a microcontroller. This microcontroller changed the embedded system design so simple and advanced that the embedded market has become one of the most sought after for not only entrepreneurs but for design engineers also.

What is a Microcontroller?
A single chip computer or A CPU with all the peripherals like RAM, ROM, I/O Ports, Timers , ADCs etc... on the same chip. For ex: Motorolas 6811, Intels 8051, Zilogs Z8 and PIC 16X etc

MICROPROCESSORS & MICROCONTROLLERS: Microprocessor:


A CPU built into a single VLSI chip is called a microprocessor. It is a device and additional external circuitry are added general-purpose

to make it a microcomputer. The

microprocessor contains arithmetic and logic unit (ALU), Instruction decoder and control unit, Instruction register, Program counter (PC), clock circuit (internal or external), reset circuit (internal or external) and registers. But the microprocessor has no on chip I/O Ports, Timers , Memory etc. For example, Intel 8085 is an 8-bit microprocessor and Intel 8086/8088 a 16-bit microprocessor.

The block diagram of the Microprocessor is shown in Fig.1

Fig.1 Block diagram of a Microprocessor.

MICROCONTROLLER :
A microcontroller is a highly integrated single chip, which consists of on chip CPU

(Central Processing Unit), RAM (Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only Memory), I/O (input/output) serial and parallel, timers, interrupt controller. For example, Intel 8051 is 8-bit microcontroller and Intel 8096 is 16-bit microcontroller. The block diagram of Microcontroller is shown in Fig.2.

Fig.2.Block Diagram of a Microcontroller

Distinguish between Microprocessor and Microcontroller S.No Microprocessor 1 Microcontroller

A microprocessor is a general A microcontroller is a dedicated chip which purpose device which is called a is also called single chip computer. CPU

A microprocessor do not contain A microcontroller includes RAM, ROM, onchip I/OPorts, Timers, Memories serial etc.. and parallel interface, timers,

interrupt circuitry (in addition to CPU) in a single chip.

Microprocessors

are

most Microcontrollers

are

used

in

small,

commonly used as the CPU in minimum component designs performing microcomputer systems 4 Microprocessor instructions control-oriented applications. are Microcontroller instructions are both bit addressable as well as byte addressable. have instruction sets

mainly nibble or byte addressable 5

Microprocessor instruction sets are Microcontrollers mainly intended

for catering to catering to the control of inputs and outputs. system Microcontroller based system design is rather simple and cost effective of The instruction set of a Microcontroller is simple with less number of

large volumes of data. 6 Microprocessor based

design is complex and expensive 7 The Instruction set

microprocessor is complex with very large number of instructions.

instructions. For, ex: PIC microcontrollers have only 35 instructions.

A microprocessor has zero status A microcontroller has no zero flag. flag

EVOLUTION OF MICROCONTROLLERS :
The first microcontroller TMS1000 was introduced by Texas Instrumentsin the year 1974. In the year 1976, Motorola designed a Microprocessor chip called 6801 which

replaced its earlier chip 6800 with certain add-on chips to make a computer. This paved the way for the new revolution in the history of chip design and gave birth to a new entity called Microcontroller. Later the Intel company produced its first Microcontroller 8048 with a CPU and 1K bytes of EPROM, 64 Bytes of RAM an 8-Bit Timer and 27 I/O pins in 1976. Then followed the most popular controller 8051 in the year 1980 with 4K bytes of ROM,128 Bytes of RAM , a serial port, two 16-bit Timers , and 32 I/O pins. The 8051 family has many additions and improvements over the years and remains a most acclaimed tool for todays circuit designers. INTEL introduced a 16 bit microcontroller 8096 in the year 1982 . Later INTEL introduced 80c196 series of 16-bit Microcontrollers for mainly industrial applications. Microchip, another company has introduced an 8-bit Microcontroller PIC 16C64 in the year 1985.The 32-bit microcontrollers have been developed by IBM and Motorola. MPC 505 is a 32-bit RISC controller of Motorola. The 403 GA is a 32 -bit RISC embedded controller of IBM. In recent times ARM company (Advanced RISC machines) has developed and introduced 32 bit controllers for high-end application devices like mobiles , Ipods etc...

TYPES OF MICROCONTROLLERS :
Microcontrollers can be classified on the basis of internal bus width, architecture, memory and instruction set as 4-bit,8-bit,16-bit and 32-bit micrcontrollers. 4-bit Microcontrollers: These 4-bit microcontrollers are small size, minimum pin count and low cost controllers which are widely used for low end applications like LED & LCD display drivers ,portable battery chargers etc.. Their power consumption is also low. The popular 4-bit controllers are Renasa M34501 which is a 20 pin DIP chip with 4kB of ROM,256 Bytes of RAM,2-Counters and 14 I/O Pins. Similarly ATAM862 series from ATMEL. 8-bit Microcontrollers : These are the most popular and widely used microcontrollers .About 55% of all CPUs sold in the world are 8-bit microcontrollers only.The 8-bit microcontroller has 8-bitinternal bus and the ALU performs all the arithmetic and logical operations on a byte instruction. The well known 8-bit microcontroller is 8051 which was

designed by Intel in the year 1980 for the use in embedded systems. Other 8-bit microcontrollers are Intel 8031/8052 and Motorola MC68HC11 and AVR Microcontrollers, Microchips PIC Microcontrollers 12C5XX ,16C5X and 16C505 etc... 16-bit Microcontrollers : When the microcontroller performs 16-bit arithmetic and logical operations at an instruction, the microcontroller is said to be a 16-bit microcontroller. The internal bus width of 16-bit microcontroller is of 16-bit. These microcontrollers are having increased memory size and speed of operation when compared to 8-bit

microcontrollers.These are most suitable for programming in Highlevel languages like C or C++ .They find applications in disk drivers,modems,printers,scanners and servomotor control. Examples of 16-bit microcontrollers are Intel 8096 family and Motorola MC68HC12 and MC68332 families, The performance and computing capability of 16 bit microcontrollers are enhanced with greater precision as compared to the 8-bit microcontrollers. 32-Bit Microcontrollers :These microcontrollers used in highend applications like Automative control, Communication networks,Robotics,Cell phones ,GPRS & PDAs

etc..For EX:PIC32,ARM 7,ARM9 ,SHARP LH79520 ,ATMEL 32 (AVR) ,Texas Instruments . TMS320F2802x/2803x etc..are some of the popular 32-bit microcontrollers.

COMMERCIAL MICROCONTROLLERS
There are various manufacturers who are supplying various types of microcontrollers suitable for different applications depending on the power consumption and the available features..They are given below in tables . First the various members of INTEL 51 family are given in below table.

INTEL MCS 51 Family


Microcontroller On RAM (Bytes) 8031 8032 8051 128 256 128 chip On chip Timers/Counters Interrupts Serial ports

program memory None None 4K ROM 2 3 2 5 6 5

1 1 1

8052 8751 8752

256 128 256

8K ROM 4K EPROM 8K EPROM

3 2 3

6 5 6

1 1 1

The following table gives the 4-bit microcontrollers from different manufacturers.

4-Bit Microcontrollers.

8-Bit Microcontrollers.

16-Bit Microcontrollers The following table gives the list of PIC microcontrollers from Micro chip Inc

Microcontroller Pins

I/O Lines

On chip ADCs

EPROM X 12 words

On

chip

RAM

(Bytes) 25 24 25 72 232 454 454 36 678

16C54 16C55 16C56 16C57 17C42A 17C43 17C44 17C71 17C752

18 28 18 28 40 40 40 18 40

12 20 12 20 33 33 33 13 33

None None None None None None None 8bit ADCs 10Bit ADC

512 512 1k 2k 2k 4k 8k 1kx14 8kx16

MICROCONTROLLER DEVELOPMENT TOOLS:


To develop an assembly language program we need certain program development tools. An assembly language program consists of Mnemonics which are nothing but short abbreviated English instructions given to the controller.The various development tools required for Microcontroller programming are explained below. 1. Editor : An Editor is a program which allows us to create a file containing the assembly language statements for the program. Examples of some editors are PC write Wordstar. As we type the program the editor stores the ACSII codes for the letters and numbers in

successive RAM locations. If any typing mistake is done editor will alert us to correct it. If we leave out a program statement an editor will let you move everything down and insert a line. After typing all the program we have to save the program . This we call it as source file. The next step is to process the source file with an assembler. Ex: Sample. asm 2.Assembler : An Assembler is used to translate the assembly language mnemonics into machine language( i.e binary codes). When you run the assembler it reads the source file of your program from where you have saved it. The assembler generates a filee with the extension .hex. This file consists of hexadecimal values encoding a sequence of data and their starting offset or absolute address. 3.Compiler : A compiler is a program which converts the high level language program like C into binary or machine code. Using high level languages it is easy to manage complex data structures which are often required for data manipulation. Because of its ease , flexibility and debug options now a days the compilers have become very popular in the market. Compilers like Keil ,Ride and IAR workbench are very popular. 3. Debugger/Simulator : A debugger is a program which allows execute the program, and troubleshoot or debug it. The debugger allows to look into the contents of registers and memory locations after the program runs. We can also change the contents of registers and memory locations and rerun the program. Some debuggers allows to stop the program after each instruction so that you can check or alter memory and register contents. This is called single step debug. A debugger also allows to set a breakpoint at any point in the program. If

we insert a break point , the debugger will run the program up to the instruction where the breakpoint is put and then stop the execution. A simulator is a software program which virtually executes the instructions similar to a microcontroller and shows the results. This will help in evaluating the results without committing any errors. By doing so we can detect the possible logic errors INTEL 8051 MICRCONTROLLER : The 8051 microcontroller is a very popular 8-bit microcontroller introduced by Intel in the year 1981 and it has become almost the academic standard now a days. The 8051 is based on an 8-bit CISC core with Harvard architecture. Its 8-bit architecture is optimized for control applications with extensive Boolean processing. It is available as a 40-pin DIP chip and works at +5 Volts DC. The salient features of 8051 controller are given below. SALIENT FEATURES : The salient features of 8051 Microcontroller are i. 4 KB on chip program memory (ROM or EPROM)). ii. 128 bytes on chip data memory(RAM). iii. 8-bit data bus iv. 16-bit address bus v. 32 general purpose registers each of 8 bits vi. Two -16 bit timers T0 and T1 vii. Five Interrupts (3 internal and 2 external). ix. Four Parallel ports each of 8-bits (PORT0, PORT1,PORT2,PORT3) with a total of 32 I/O lines.

x. One 16-bit program counter and One 16-bit DPTR ( data pointer) xi. One 8-bit stack pointer xii. One Microsecond instruction cycle with 12 MHz Crystal. xiii. One full duplex serial communication port.

ARCHITECTURE & BLOCK DIAGRAM OF 8051 MICROCONTROLLER: The architecture of the 8051 microcontroller can be understood from the block diagram. It has Harward architecture with RISC (Reduced Instruction Set Computer) concept. The block diagram of 8051 microcontroller is shown in Fig 3. below1.It consists of an 8-bit ALU, one 8-bit PSW(Program Status Register), A and B registers , one 16-bit Program counter , one 16-bit Data pointer register(DPTR),128 bytes of RAM and 4kB of ROM and four parallel I/O ports each of 8-bit width.

Fig.3. Block Diagram of 8051 Microcontroller 8051 has 8-bit ALU which can perform all the 8-bit arithmetic and logical operations in one machine cycle. The ALU is associated with two registers A & B A and B Registers : The A and B registers are special function registers which hold the results of many arithmetic and logical operations of 8051.The A register is also called the Accumulator and as its name suggests, is used as a general register to accumulate the

results of a large number of instructions. By default it is used for all mathematical operations and also data transfer operations between CPU and any external memory.

The B register is mainly used for multiplication and division operations along with A register. MUL AB : DIV AB.

It has no other function other than as a location where data may be stored. The R registers: The "R" registers are a set of eight registers that are named R0, R1, etc. up to and including R7. These registers are used as auxillary registers in many operations. The "R" registers are also used to temporarily store values. Program Counter(PC) : 8051 has a 16-bit program counter .The program counter always points to the address of the next instruction to be executed. After execution of one instruction the program counter is incremented to point to the address of the next instruction to be executed.It is the contents of the PC that are placed on the address bus to find and fetch the desired instruction.Since the PC is 16-bit width ,8051 can access program addresses from 0000H to FFFFH ,a total of 6kB of code. Stack Pointer Register (SP) : It is an 8-bit register which stores the address of the stack top. i.e the Stack Pointer is used to indicate where the next value to be removed from the stack should be taken from. When a value is pushed onto the stack, the 8051 first increments the value of SP and then stores the value at the resulting memory location. Similarly when a value is popped off the stack, the 8051 returns the value from the memory location indicated by SP, and then decrements the value of SP. Since the SP is only 8-bit wide it is incremented or decremented by two . SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL, LCALL, RET, and RETI. It is also used intrinsically whenever an interrupt is triggered. STACK in 8051 Microcontroller : The stack is a part of RAM used by the CPU to store information temporarily. This information may be either data or an address .The CPU needs this storage area as there are only limited number of registers. The register used to access the stack is called the Stack pointer which is an 8-bit register..So,it can take values of 00 to FF H.When the 8051 is powered up ,the SP register contains the value 07.i.e the RAM location value 08 is the first location being used for the stack by the 8051 controller. There are two important instructions to handle this stack.One is the PUSH and the Other is the POP. The loading of data from CPU registers to the stack is done by PUSH and the loading of the contents of the stack back into aCPU register is done by POP.

EX : MOV R6 ,#35 H MOV R1 ,#21 H PUSH 6 PUSH 1 In the above instructions the contents of the Registers R6 and R1 are moved to stack and they occupy the 08 and 09 locations of the stack.Now the contents of the SP are incremented by two and it is 0A Similarly POP 3 instruction pops the contents of stack into R3 register.Now the contents of the SP is decremented by 1 In 8051 the RAM locations 08 to 1F (24 bytes) can be used for the Stack.In any program if we need more than 24 bytes of stack ,we can change the SP point to RAM locations 30-7F H.this can be done with the instruction MOV SP,# XX. Data Pointer Register(DPTR) : It is a 16-bit register which is the only user-accessible. DPTR, as the name suggests, is used to point to data. It is used by a number of commands which allow the 8051 to access external memory. When the 8051 accesses external memory it will access external memory at the address indicated by DPTR. This DPTR can also be used as two 8-registers DPH and DPL. Program Status Register (PSW) : The 8051 has a 8-bit PSW register which is alsoknown as Flag register.In the 8-bit register only 6-bits are used by 8051.The two unused bits are user definable bits.In the 6-bits four of them are conditional flags .They are Carry CY,Auxiliary Carry-AC, Parity-P,and Overflow-OV .These flag bits indicate some conditions that resulted after an instruction was executed.

The bits PSW3 and PSW4 are denoted as RS0 and RS1 and these bits are used th select the bank registers of the RAM location. The meaning of various bits of PSW register is shown below. CY AC PSW.7 PSW.6 Carry Flag Auxiliary Carry Flag

FO RS1 RS0 OV --P

PSW.5 PSW.4 PSW.3 PSW.2 PSW.1 PSW.0

Flag 0 available for general purpose . Register Bank select bit 1 Register bank select bit 0 Overflow flag User difinable flag Parity flag .set/cleared by hardware.

The selection of the register Banks and their addresses are given below. RS1 0 0 1 1 RS0 0 1 0 1 Register Bank 0 1 2 3 Address 00H-07H 08H-0FH 10H-17H 18H-1FH

Memory organization : The 8051 microcontroller has 128 bytes of Internal RAM and 4kB of on chip ROM .The RAM is also known as Data memory and the ROM is known as program memory. The program memory is also known as Code memory .This Code memory holds the actual 8051 program that is to be executed. In 8051 this memory is limited to 64K .Code memory may be found on-chip, as ROM or EPROM. It may also be stored

completely off-chip in an external ROM or, more commonly, an external EPROM. The 8051 has only 128 bytes of Internal RAM but it supports 64kB of external RAM. As the name suggests, external RAM is any random access memory which is off-chip. Since the memory is off-chip it is not as flexible interms of accessing, and is also slower. For example, to increment an Internal RAM location by 1,it requires only 1 instruction and 1 instruction cycle but to increment a 1-byte value stored in External RAM requires 4 instructions and 7 instruction cycles. So, here the external memory is 7 times slower.

Internal RAM OF 8051 :


This Internal RAM is found on-chip on the 8051 .So it is the fastest RAM available, and it is also the most flexible in terms of reading, writing, and modifying its contents. Internal RAM is volatile, so when the 8051 is reset this memory is cleared. The 128 bytes of internal RAM is organized as below. (i) Four register banks (Bank0,Bank1, Bank2 and Bank3) each of 8-bits (total 32 bytes). The default bank register is Bank0. The remaining Banks are selected with the help of RS0 and RS1 bits of PSW Register. (ii) 16 bytes of bit addressable area and (iii) 80 bytes of general purpose area (Scratch pad memory) as shown in the diagram below. This area is also utilized by the microcontroller as a storage area for the operating stack.

The 32 bytes of RAM from address 00 H to 1FH are used as working registers organized as four banks of eight registers each.The registers are named as R0-R7 .Each register can be addressed by its name or by its RAM address. For EX : MOV A, R7 or MOV R7,#05H

Internal ROM (On chip ROM): The 8051 microcontroller has 4kB of on chip ROM but it can be extended up to 64kB.This ROM is also called program memory or code memory. The CODE segment is accessed using the program counter (PC) for opcode fetches and by DPTR for data. The external ROM is accessed when the EA(active low) pin is connected to ground or the contents of program counter exceeds 0FFFH.When the Internal ROM address is exceeded the 8051 automatically fetches the code bytes from the external program memory.

SPECIAL FUNCTION REGISTERS (SFRs) : In 8051 microcontroller there certain registers which uses the RAM addresses from 80h to FFh and they are meant for certain specific operations .These registers are called Special function registers (SFRs).Some of these registers are bit addressable also. The list of SFRs and their functional names are given below. In these SFRs some of them are related to I/O ports (P0,P1,P2 and P3) and some of them are meant for control operations (TCON,SCON, PCON..) and remaining are the auxillary SFRs, in the sense that they don't directly configure the 8051.

S.No 1 2 3 4 5

Symbol ACC* B* PSW* SP DPL DPTR DPH

Name of SFR Accumulator B-Register Program Status word register Stack Pointer Register Data pointer low byte Data pointer high byte Port 0 Port 1 Port 2 Port 3 Interrupt Priority control Interrupt Enable control Tmier mode register Timer control register Timer 0 Higher byte Timer 0 Lower byte Timer 1Higher byte Timer 1 lower byte Serial control register Serial buffer register Power control register

Address (Hex) 0E0 0F0 0DO 81 82 83 80 90 0A 0B 0B8 0A8 89 88 8C 8A 8D 8B 98 99 87

P0* P1*

8 9 10 11 12 13 14 15 16 17 18 19 20

P2* P3* IP* IE* TMOD TCON* TH0 TL0 TH1 TL1 SCON* SBUF PCON

The * indicates the bit addressable SFRs Table:SFRs of 8051 Microcontroller PARALLEL I /O PORTS : The 8051 microcontroller has four parallel I/O ports , each of 8-bits .So, it provides the user 32 I/O lines for connecting the microcontroller to the peripherals. The four ports are P0 (Port 0), P1(Port1) ,P2(Port 2) and P3 (Port3). Upon reset all the ports are output ports. In order to make them input, all the ports must be set i.e a high bit must be sent to all the port pins. This is normally done by the instruction SETB. Ex: MOV A,#0FFH MOV P0,A PORT 0: Port 0 is an 8-bit I/O port with dual purpose. If external memory is used, these port pins are used for the lower address byte address/data (AD0-AD7), otherwise all bits of the port are either input or output.. Unlike other ports, Port 0 is not provided with pull-up resistors internally ,so for PORT0 pull-up resistors of nearly 10k are to be connected externally as shown in the fig.2. Dual role of port 0: Port 0 can also be used as address/data bus(AD0-AD7), allowing it to be used for both address and data. When connecting the 8051 to an external memory, port 0 provides both address and data. The 8051 multiplexes address and data through port 0 to save the pins. ALE indicates whether P0 has address or data. When ALE = 0, it provides data D0D7, and when ALE =1 it provides address and data with the help of a 74LS373 latch. ; A = FF ; make P0 an input port

Port 1: Port 1 occupies a total of 8 pins (pins 1 through 8). It has no dual application and acts only as input or output port. In contrast to port 0, this port does not need any pull-up resistors since pull-up resistors connected internally. Upon reset, Port 1 is configured as an output port. To configure it as an input port , port bits must be set i.e a high bit must be sent to all the port pins. This is normally done by the instruction SETB. For Ex : MOV A, #0FFH ; A=FF HEX MOV P1,A ; make P1 an input port by writing 1s to all of its pins

Port 2 : Port 2 is also an eight bit parallel port. (pins 21- 28). It can be used as input or output port. As this port is provided with internal pull-up resistors it does not need any external pull-up resistors. Upon reset, Port 2 is configured as an output port. If the port is to be used as input port, all the port bits must be made high by sending FF to the port. For ex, MOV A, #0FFH MOV P2, A ; A=FF hex ; make P2 an input port by writing all 1s to it

Dual role of port 2 : Port2 lines are also associated with the higher order address lines A8A15. In systems based on the 8751, 8951, and DS5000, Port2 is used as simple I/O port.. But, in 8031-based systems, port 2 is used along with P0 to provide the 16-bit address for the external memory. Since an 8031 is capable of accessing 64K bytes of external memory, it needs a path for the 16 bits of the address. While P0 provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the address. In other words, when 8031 is connected to external memory, Port 2 is used for the upper 8 bits of the 16 bit address, and it cannot be used for I/O operations. PORT 3 : Port3 is also an 8-bit parallel port with dual function.( pins 10 to 17). The port pins can be used for I/O operations as well as for control operations. The details of these

additional operations are given below in the table. Port 3 also do not need any external pullup resistors as they are provided internally similar to the case of Port2 & Port 1. Upon reset port 3 is configured as an output port . If the port is to be used as input port, all the port bits must be made high by sending FF to the port. For ex, MOV A, #0FFH MOV P3, A ; A= FF hex ; make P3 an input port by writing all 1s to it

Alternate Functions of Port 3 : P3.0 and P3.1 are used for the RxD (Receive Data) and TxD (Transmit Data) serial communications signals. Bits P3.2 and P3.3 are meant for external interrupts. Bits P3.4 and P3.5 are used for Timers 0 and 1 and P3.6 and P3.7 are used to provide the write and read signals of external memories connected in 8031 based systems

S.No 1

Port 3 bit P3.0 10

Pin No RxD

Function

P3.1

11

TxD

3 4 5

P3.2 P3.3 P3.4

12 13 14 T0

P3.5

15

T1

7 8

P3.6 P3.7

16 17 Table: PORT 3 alternate functions

Interrupt Structure: An interrupt is an external or internal event that disturbs the microcontroller to inform it that a device needs its service. The program which is associated with the interrupt is called the interrupt service routine (ISR) or interrupt handler. Upon receiving the interrupt signal the Microcontroller , finish current instruction and saves the PC on stack. Jumps to a fixed location in memory depending on type of interrupt Starts to execute the interrupt service routine until RETI (return from interrupt)Upon executing the RETI the microcontroller returns to the place where it was interrupted. Get pop PC from stack.

The 8051 microcontroller has FIVE interrupts in addition to Reset. They are Timer 0 overflow Interrupt Timer 1 overflow Interrupt External Interrupt 0(INT0) External Interrupt 1(INT1) Serial Port events (buffer full, buffer empty, etc) Interrupt

Each interrupt has a specific place in code memory where program execution (interrupt service routine) begins. External Interrupt 0: 0003 H Timer 0 overflow: 000B H

External Interrupt 1: 0013 H Timer 1 overflow: Serial Interrupt : 001B H 0023 H

Upon reset all Interrupts are disabled & do not respond to the Microcontroller. These interrupts must be enabled by software in order for the Microcontroller to respond to them. This is done by an 8-bit register called Interrupt Enable Register (IE). Interrupt Enable Register :

EA : Global enable/disable. To enable the interrupts this bit must be set High. --: Undefined-reserved for future use.

ET2 : Enable /disable Timer 2 overflow interrupt. ES : Enable/disable Serial port interrupt.

ET1 : Enable /disable Timer 1 overflow interrupt. EX1 : Enable/disable External interrupt1. ET0 : Enable /disable Timer 0 overflow interrupt. EX0 : Enable/disable External interrupt0 Upon reset the interrupts have the following priority.(Top to down). The interrupt with the highest PRIORITY gets serviced first. 1. External interrupt 0 (INT0) 2. Timer interrupt0 (TF0) 3. External interrupt 1 (INT1) 4. Timer interrupt1 (TF1) 5. Serial communication (RI+TI) Priority can also be set to high or low by 8-bit IP register.- Interrupt priority register

IP.7: reserved IP.6: reserved IP.5: Timer 2 interrupt priority bit (8052 only) IP.4: Serial port interrupt priority bit IP.3: Timer 1 interrupt priority bit IP.2: External interrupt 1 priority bit IP.1: Timser 0 interrupt priority bit IP.0: External interrupt 0 priority bit

TIMERS in 8051 Microcontrollers : The 8051 microcontroller has two 16-bit timers Timer 0 (T0) and Timer 1(T1) which can be used either to generate accurate time delays or as event counters. These timers are accessed as two 8-bit registers TLO, THO & TL1 ,TH1 because the 8051 microcontroller has 8-bit architecture. TIMER 0 : The Timer 0 is a 16-bit register and can be treated as two 8-bit registers (TL0 & TH0) and these registers can be accessed similar to any other registers like A,B or R1,R2,R3 etc Ex : The instruction Mov TL0,#07 moves the value 07 into lower byte of Timer0. Similarly Mov R5,TH0 saves the contents of TH0 in the R5 register.

TIMER 1 : The Timer 1 is also a 16-bit register and can be treated as two 8-bit registers (TL1 & TH1) and these registers can be accessed similar to any other registers like A,B or R1,R2,R3 etc Ex : The instruction MOV TL1,#05 moves the value 05 into lower byte of Timer1. Similarly MOV R0,TH1 saves the contents of TH1 in the R0 register

TMOD Register : The various operating modes of both the timers T0 and T1 are set by an 8-bit register called TMOD register. In this TMOD register the lower 4-bits are meant for Timer 0 and the higher 4-bits are meant for Timer1.

GATE: This bit is used to start or stop the timers by hardware .When GATE= 1 ,the timers can be started / stopped by the external sources. When GATE= 0, the timers can be started or stopped by software instructions like SETB TR0 or SETB TR1 C/T (clock/Timer) : This bit decides whether the timer is used as delay generator or event counter. When C/T = 0 ,the Timer is used as delay generator and if C/T=1 the timer is used as an event counter. The clock source for the time delay is the crystal frequency of 8051. M1,M0 (Mode) : These two bits are the timer mode bits. The timers of the 8051 can be configured in three modes.Mode0, Mode1 and Mode2.The selection and operation of the modes is shown below. S.No 1 0 M0 0 M1 0 Mode Operation 13-bit Timer mode 8-bit Timer/counter. THx with TLx as 5-bit prescalar 2 0 1 1 16-bit Timer mode.16-bit timer /counter without pre-scalar 3 1 0 2 8-bit auto reload. THx contains a value that is to be loaded into TLx each time it overflows 4 1 1 3 Split timer mode

PIN Diagram of 8051 Microcontroller : The 8051 microcontroller is available as a 40 pin DIP chip and it works at +5 volts DC. Among the 40 pins , a total of 32 pins are allotted for the four parallel ports P0,P1,P2 and P3 i.e each port occupies 8-pins .The remaining pins are VCC, GND, XTAL1, XTAL2, RST, EA ,PSEN.

XTAL1,XTAL2: These two pins are connected to Quartz crystal oscillator which runs the on-chip oscillator. The quartz crystal oscillator is connected to the two pins along with a capacitor of 30pF as shown in the circuit. If we use a source other than the crystal oscillator, it will be connected to XTAL1 and XTAL2 is left unconnected.

RST: The RESET pin is an input pin and it is an active high pin. When a high pulse is applied to this pin the microcontroller will reset and terminate all activities. Upon reset all the registers except PC will reset to 0000 Value and PC register will reset to 0007 value.

(External Access): This pin is an active low pin. This pin is connected to ground when microcontroller is accessing the program code stored in the external memory and connected to Vcc when it is accessing the program code in the on chip memory. This pin should not be left unconnected. (Program Store Enable) : This is an output pin which is active low. When the microcontroller is accessing the program code stored in the external ROM ,this pin is connected to the OE (Output Enable) pin of the ROM. ALE (Address latch enable): This is an output pin, which is active high. When connected to external memory , port 0 provides both address and data i.e address and data are multiplexed through port 0 .This ALE pin will demultiplex the address and data bus .When the pin is High , the AD bus will act as address bus otherwise the AD bus will act as Data bus. P0.0- P0.7(AD0-AD7) : The port 0 pins multiplexed with Address/data pins .If the microcontroller is accessing external memory these pins will act as address/data pins otherwise they are used for Port 0 pins. P2.0- P2.7(A8-A15) : The port2 pins are multiplexed with the higher order address pins .When the microcontroller is accessing external memory these pins provide the higher order address byte otherwise they act as Port 2 pins. P1.0- P1.7 :These 8-pins are dedicated for Port1 to perform input or output port operations. P3.0- P3.7 :These 8-pins are meant for Port3 operations and also for some control operations like Read,Write,Timer0,Timer1 ,INT0,INT1 ,RxD and TxD

ADDRESSING MODES OF 8051 :


The way in which the data operands are accessed by different instructions is known as the addressing modes. There are various methods of denoting the data operands in the instruction. The 8051 microcontroller supports mainly 5 addressing modes. They are 1.Immediate addressing mode 2.Direct Addressing mode 3.Register addressing mode 4. Register Indirect addressing mode 5.Indexed addressing mode Immediate addressing mode : The addressing mode in which the data operand is a constant and it is a part of the instruction itself is known as Immediate addressing mode. Normally the data must be preceded by a # sign. This addressing mode can be used to transfer the data into any of the registers including DPTR. Ex: MOV A , # 27 H : The data (constant) 27 is moved to the accumulator register

ADD R1 ,#45 H : Add the constant 45 to the contents of the accumulator MOV DPTR ,# 8245H :Move the data 8245 into the data pointer register. MOV P1,#21 H Direct addressing mode: The addressing mode in which the data operand is in the RAM location (00 -7FH) and the address of the data operand is given in the instruction is known as Direct addressing mode. The direct addressing mode uses the lower 128 bytes of Internal RAM and the SFRs MOV R1, 42H : Move the contents of RAM location 42 into R1 register MOV 49H,A : Move the contents of the accumulator into the RAM location 49. ADD A, 56H : Add the contents of the RAM location 56 to the accumulator

Register addressing mode :The addressing mode in which the data operand to be manipulated lies in one of the registers is known as register addressing mode. MOV A,R0 : Move the contents of the register R0 to the accumulator ADD A,R6 :Add the contents of R6 register to the accumulator MOV P1, R2 : Move the contents of the R2 register into port 1 MOV R5, R2 : This is invalid .The data transfer between the registers is not allowed. Register Indirect addressing mode :The addressing mode in which a register is used as a pointer to the data memory block is known as Register indirect addressing mode. MOV A,@ R0 :Move the contents of (accumulator) MOV @ R1 , B : Move the contents of B into RAM location whose address is held by R1 When R0 and R1 are used as pointers, they must be preceded by @ sign One of the advantages of register indirect addressing mode is that it makes accessing the data more dynamic than static as in the case of direct addressing mode. Indexed addressing mode : This addressing mode is used in accessing the data elements of lookup table entries located in program ROM space of 8051. Ex : MOVC A,@ A+DPTR The 16-bit register DPTR and register A are used to form the address of the data element stored in on-chip ROM. Here C denotes code .In this instruction the contents of A are added to the 16-bit DPTR register to form the 16-bit address of the data operand. Interfacing of ADC 0804 to 8051 Microcontroller : ADC 0804 is a single channel analog to digital converter i.e., it can take only one analog signal. ADC 0804 has 8 bit resolution. The higher resolution ADC gives smaller step size. Step size is smallest change that can be measured by an ADC. For an ADC with resolution of 8 bits, the step size is 19.53mV (5V/255). The time taken by the ADC to convert analog data into digital form depends on the frequency of clock source. The conversion time of ADC 0804 is around 110us. To use the internal clock a capacitor and resistor are used as shown in the circuit. The input to the ADC is given from a regulated power supply and a 10K potentiometer RAM location whose address is in R0 into A

The 8051 Microcontroller is used to provide the control signals to the ADC. CS(chip select) pin of ADC is directly connected to ground. The pin P1.1, P1.0 and P1.2 are connected to the pin WR, RD and INTR of the ADC respectively. When the input voltage from the preset is varied the output of ADC varies also varies.

CAPACITOR
A capacitor (originally known as a condenser) is a passive two-terminal electrical component used to store energy electrostatically in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric (insulator); for example, one common construction consists of metal foils separated by a thin layer of insulating film. Capacitors are widely used as parts ofelectrical circuits in many common electrical devices. When there is a potential difference across the conductors, an electric field develops across the dielectric, causing positive charge to collect on one plate and negative charge on the other plate. Energy is stored in the electrostatic field. An ideal capacitor is characterized by a single constant value, capacitance. This is the ratio of the electric charge on each conductor to the potential difference between them. The SI unit of capacitance is the farad, which is equal to one coulomb per volt. The capacitance is greatest when there is a narrow separation between large areas of conductor, hence capacitor conductors are often calledplates, referring to an early means of construction. In practice, the dielectric between the plates passes a small amount of leakage current and also has an electric field strength limit, the breakdown voltage. The conductors and leads introduce an undesired inductance and resistance. Capacitors are widely used in electronic circuits for blocking direct current while allowing alternating current to pass. In analog filter networks, they smooth the output of power supplies. In resonant circuits they tune radios to particular frequencies. In electric power transmission systems they stabilize voltage and power flow

Different types of Capacitor

Resistor
Resistor

A typical axial-lead resistor Type Passive

Working principle Electric resistance Electronic symbol

Axial-lead resistors on tape. The tape is removed during assembly before the leads are formed and the part is inserted into the board. In automated assembly the leads are cut and formed. A resistor is a passive two-terminal electrical component that implements electrical

resistance as a circuit element. The current through a resistor is in direct proportion to the voltage across the resistor's terminals. This relationship is represented by Ohm's law:

where I is the current through the conductor in units of amperes, V is the potential difference measured across the conductor in units of volts, and R is the resistance of the conductor in units of ohms. The ratio of the voltage applied across a resistor's terminals to the intensity of current in the circuit is called its resistance, and this can be assumed to be a constant (independent of the voltage) for ordinary resistors working within their ratings. Resistors are common elements of electrical networks and electronic circuits and are ubiquitous in electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickelchrome). Resistors are also implemented within integrated circuits, particularly analog devices, and can also be integrated into hybrid and printed circuits. The electrical functionality of a resistor is specified by its resistance: common commercial resistors are manufactured over a range of more than nineorders of magnitude. When specifying that resistance in an electronic design, the required precision of the resistance may require attention to themanufacturing tolerance of the chosen resistor, according to its specific application. The temperature coefficient of the resistance may also be of concern in some precision applications. Practical resistors are also specified as having a maximum power rating which must exceed the anticipated power dissipation of that resistor in a particular circuit: this is mainly of concern in power electronics applications. Resistors with higher power ratings are physically larger and may require heat sinks. In a high-voltage circuit, attention must sometimes be paid to the rated maximum working voltage of the resistor. While there is no minimum working voltage for a given resistor, failure to account for a resistor's maximum rating may cause the resistor to incinerate when current is run through it. Practical resistors have a series inductance and a small parallel capacitance; these specifications can be important in high-frequency applications. In alow-noise amplifier or pre-amp, the noise characteristics of a resistor may be an issue. The unwanted inductance, excess noise, and temperature coefficient are mainly dependent on the technology used in manufacturing the resistor.

Crystal oscillator

A miniature 16 MHz quartz crystalenclosed in a hermetically sealed HC-49/S package, used as the resonator in a crystal oscillator.

Quartz crystal resonator (left) and quartz crystal oscillator (right) A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency.[1][2][3] This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits incorporating them became known as crystal oscillators,[1] but other piezoelectric materials including polycrystalline ceramics are used in similar circuits. Quartz crystals are manufactured for frequencies from a few tens of kilohertz to hundreds of megahertz. More than two billion crystals are manufactured annually. Most are used for consumer devices such as wristwatches, clocks, radios, computers, and cellphones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes.

Semiconductor
A semiconductor is a solid that has electrical conductivity in between that of a conductor and that of an insulator, and can be controlled over a wide range, either permanently or dynamically.[1] Semiconductors are tremendously important in technology. Semiconductor devices, electronic components made of semiconductor materials, are essential in modern electrical devices. Examples range from computers to cellular phones to digital audio players. Silicon is used to create most semiconductors commercially, but dozens of other materials are used as well.

Overview
Semiconductors are very similar to insulators. The two categories of solids differ primarily in that insulators have larger band gaps energies that electrons must acquire to be free to move from atom to atom. In semiconductors at room temperature, just as in insulators, very few electrons gain enough thermal energy to leap the band gap from the valence band to the conduction band, which is necessary for electrons to be available for electric current conduction. For this reason, pure semiconductors and insulators in the absence of applied electric fields, have roughly similar resistance. The smaller bandgaps of semiconductors, however, allow for other means besides temperature to control their electrical properties. Semiconductors' intrinsic electrical properties are often permanently modified by introducing impurities by a process known as doping. Usually, it is sufficient to approximate that each impurity atom adds one electron or one "hole" (a concept to be discussed later) that may flow freely. Upon the addition of a sufficiently large proportion of impurity dopants, semiconductors will conduct electricity nearly as well as metals. Depending on the kind of impurity, a doped region of semiconductor can have more electrons or holes, and is named Ntype or P-type semiconductor material, respectively. Junctions between regions of N- and Ptype semiconductors create electric fields, which cause electrons and holes to be available to move away from them, and this effect is critical to semiconductor device operation. Also, a density difference in the amount of impurities produces a small electric field in the region which is used to accelerate non-equilibrium electrons or holes.

In addition to permanent modification through doping, the resistance of semiconductors is normally modified dynamically by applying electric fields. The ability to control resistance/conductivity in regions of semiconductor material dynamically through the application of electric fields is the feature that makes semiconductors useful. It has led to the development of a broad range of semiconductor devices, like transistors and diodes. Semiconductor devices that have dynamically controllable conductivity, such as transistors, are the building blocks of integrated circuits devices like the microprocessor. These "active" semiconductor devices (transistors) are combined with passive components implemented from semiconductor material such as capacitors and resistors, to produce complete electronic circuits. In most semiconductors, when electrons lose enough energy to fall from the conduction band to the valence band (the energy levels above and below the band gap), they often emit light, a quantum of energy in the visible electromagnetic spectrum. This photoemission process underlies the light-emitting diode (LED) and the semiconductor laser, both of which are very important commercially. Conversely, semiconductor absorption of light in photodetectors excites electrons to move from the valence band to the higher energy conduction band, thus facilitating detection of light and vary with its intensity. This is useful for fiber optic communications, and providing the basis for energy from solar cells. Semiconductors may be elemental materials such as silicon and germanium, or compound semiconductors such as gallium arsenide and indium phosphide, or alloys such as silicon germanium or aluminium gallium arsenide.

Band structure
Band structure of a semiconductor showing a full valence band and an empty conduction band. There are three popular ways to describe the electronic structure of a crystal. The first starts from single atoms. An atom has discrete energy levels. When two atoms come close each energy levels splits into an upper and a lower level, whereby they delocalize across the two atoms. With more atoms the number of levels increases, and groups of levels form bands. Semiconductors contain many bands. If there is a large distance between the highest occupied state and the lowest unoccupied space, then a gap will likely remain between occupied and unoccupied bands even after band formation.

A second way starts with free electrons waves. When fading in an electrostatic potential due to the cores, due to Bragg reflection some waves are reflected and cannot penetrate the bulk, that is a band gap opens. In this description it is not clear, while the number of electrons fills up exactly all states below the gap. A third description starts with two atoms. The split states form a covalent bond where two electrons with spin up an spin down are mostly in between the two atoms. Adding more atoms now is supposed not to lead to splitting, but to more bonds. This is the way silicon is typically drawn. The band gap is now formed by lifting one electron from the lower electron level into the upper level. This level is known to be anti-bonding, but bulk silicon has not been seen to lose atoms as easy as electrons are wandering through it. Also this model is most unsuitable to explain how in graded hetero-junction the band gap can vary smoothly. Like in other solids, the electrons in semiconductors can have energies only within certain bands (ie. ranges of levels of energy) between the energy of the ground state, corresponding to electrons tightly bound to the atomic nuclei of the material, and the free electron energy, which is the energy required for an electron to escape entirely from the material. The energy bands each correspond to a large number of discrete quantum states of the electrons, and most of the states with low energy (closer to the nucleus) are full, up to a particular band called the valence band. Semiconductors and insulators are distinguished from metals because the valence band in the semiconductor materials is very nearly full under usual operating conditions, thus causing more electrons to be available in the conduction band. The ease with which electrons in a semiconductor can be excited from the valence band to the conduction band depends on the band gap between the bands, and it is the size of this energy bandgap that serves as an arbitrary dividing line (roughly 4 eV) between semiconductors and insulators. The electrons must move between states to conduct electric current, and so due to the Pauli exclusion principle full bands do not contribute to the electrical conductivity. However, as the temperature of a semiconductor rises above absolute zero, the range of energy values of the electrons in a given band are increased, and some electrons are likely to be found in with energy states of the conduction band, which is the band immediately above the valence band. The current-carrying electrons in the conduction band are known as "free electrons", although they are often simply called "electrons" if context allows this usage to be clear.

Doping
The property of semiconductors that makes them most useful for constructing electronic devices is that their conductivity may easily be modified by introducing impurities into their crystal lattice. The process of adding controlled impurities to a semiconductor is known as doping. The amount of impurity, or dopant, added to an intrinsic (pure) semiconductor varies its level of conductivity. Doped semiconductors are often referred to as extrinsic.

Dopants
The materials chosen as suitable dopants depend on the atomic properties of both the dopant and the material to be doped. In general, dopants that produce the desired controlled changes are classified as either electron acceptors or donors. A donor atom that activates (that is, becomes incorporated into the crystal lattice) donates weakly-bound valence electrons to the material, creating excess negative charge carriers. These weakly-bound electrons can move about in the crystal lattice relatively freely and can facilitate conduction in the presence of an electric field. (The donor atoms introduce some states under, but very close to the conduction band edge. Electrons at these states can be easily excited to conduction band, becoming free electrons, at room temperature.) Conversely, an activated acceptor produces a hole. Semiconductors doped with donor impurities are called n-type, while those doped with acceptor impurities are known as p-type. The n and p type designations indicate which charge carrier acts as the material's majority carrier. The opposite carrier is called the minority carrier, which exists due to thermal excitation at a much lower concentration compared to the majority carrier. For example, the pure semiconductor silicon has four valence electrons. In silicon, the most common dopants are IUPAC group 13 (commonly known as group III) and group 15 (commonly known as group V) elements. Group 13 elements all contain three valence electrons, causing them to function as acceptors when used to dope silicon. Group 15 elements have five valence electrons, which allows them to act as a donor. Therefore, a silicon crystal doped with boron creates a p-type semiconductor whereas one doped with phosphorus results in an n-type material.

Effect on band structure


Band diagram of a p+n junction. The band bending is a result of the positioning of the Fermi levels in the p+ and n sides. Doping a semiconductor crystal introduces allowed energy states within the band gap but very close to the energy band that corresponds with the dopant type. In other words, donor impurities create states near the conduction band while acceptors create states near the valence band. The gap between these energy states and the nearest energy band is usually referred to as dopant-site bonding energy or EB and is relatively small. For example, the EB for boron in silicon bulk is 0.045 eV, compared with silicon's band gap of about 1.12 eV. Because EB is so small, it takes little energy to ionize the dopant atoms and create free carriers in the conduction or valence bands. Usually the thermal energy available at room temperature is sufficient to ionize most of the dopant. Dopants also have the important effect of shifting the material's Fermi level towards the energy band that corresponds with the dopant with the greatest concentration. Since the Fermi level must remain constant in a system in thermodynamic equilibrium, stacking layers of materials with different properties leads to many useful electrical properties. For example, the p-n junction's properties are due to the energy band bending that happens as a result of lining up the Fermi levels in contacting regions of p-type and n-type material. This effect is shown in a band diagram. The band diagram typically indicates the variation in the valence band and conduction band edges versus some spatial dimension, often denoted x. The Fermi energy is also usually indicated in the diagram. Sometimes the intrinsic Fermi energy, Ei, which is the Fermi level in the absence of doping, is shown. These diagrams are useful in explaining the operation of many kinds of semiconductor devices.

Preparation of semiconductor materials


Semiconductors with predictable, reliable electronic properties are necessary for mass production. The level of chemical purity needed is extremely high because the presence of impurities even in very small proportions can have large effects on the properties of the material. A high degree of crystalline perfection is also required, since faults in crystal structure (such as dislocations, twins, and stacking faults) interfere with the semiconducting properties of the material. Crystalline faults are a major cause of defective semiconductor devices. The larger the crystal, the more difficult it is to achieve the necessary perfection. Current mass production processes use crystal ingots between four and twelve inches (300 mm) in diameter which are grown as cylinders and sliced into wafers. Because of the required level of chemical purity and the perfection of the crystal structure which are needed to make semiconductor devices, special methods have been developed to produce the initial semiconductor material. A technique for achieving high purity includes growing the crystal using the Czochralski process. An additional step that can be used to further increase purity is known as zone refining. In zone refining, part of a solid crystal is melted. The impurities tend to concentrate in the melted region, while the desired material recrystalizes leaving the solid material more pure and with fewer crystalline faults.

You might also like