This action might not be possible to undo. Are you sure you want to continue?
Secure Data Communication using Encryption Decryption
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
In this project we have shown the concept of secure wireless data communication. By secure data communication we mean that the problems of data theft are also solved. At the transmission end a keypad is attached to the transmitting microcontroller which is used to select the characters to be transmitted to the receiver end. The characters which are chosen at the transmitter end are also made to display on the LCD which made the user to select a particular character to be transmitted. At the receiver end, two microcontrollers are present. Transmitter end will generate a code at the beginning which will decide that which microcontroller has to work at the receiver end. At a time only one microcontroller will work and perform the specified task. When user selects the mode of data transmission a code will be generated by the transmitter which will be received at the receiving end and both microcontrollers at receiver end will start to receive and display data on LCD screen. So when a particular character is received from the transmitter the receiver will display it on LCD screen. In our present system there are two types of wireless communication for local area networks (LAN). One of which is working on Radio Frequencies or Electromagnetic microwave links. These both types are very much prone to the radio wave interference i.e. any mobile phone signal or RF signal with high power can affect and produce interference to these wireless links. Infrared rays/laser or light rays, these wireless LANS are immune to noise or interference but there is no security against data theft normally known as hacking. As these types of media's are light waves so they are RF noise free but still data theft is the main issue. In my project it is going to use the same area and secure transmission. This is main need to develop this project.
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
But with the use of IR (Infrared Rays) these problems can be eliminated as infrared rays are not prone to electromagnetic rays and are unidirectional. This is main need to develop this project. As it is going to implement the H/W, first of all system will be economically cheap and as the software developed for this project is “embedded C” based which is a very commonly used programming language and also the most reliable language for H/W interfacing. So it is very easy to understand the software protocol. Infrared rays/laser or light rays, these wireless LANS are immune to noise or interference but there is no security against data theft normally known as hacking. Increased use of LAPTOP computers within the enterprise and increase in worker mobility has fuelled the demand for wireless networks. In my project it is going to implement encryption technique to overcome the problem of data theft. This is main need to develop this project. OBJECTIVE AND SCOPE OF THE PROJECT:-
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
implementation for WLAN implementation is to generate a secure LAN for multimedia communication using single level encryption techniques. The main motive of the project is to generate a multi terminal secure communication media, in simple words we have to generate a LAN which will be first of all wireless that is not any wire or physical connections will be used to connect the transmitter and the receiver, and second is to develop a secure link i.e. the data transmitted from the transmitter for first site should only be decoded by the first user and the data sent for the second terminal should only reach to the second terminal. Every terminal on the N/W will be having separate encryption and decryption key. So the data encrypted at the transmitter for a specific receiver terminal will be received or detected by all but the receiver with the right decryption key will only be capable to decrypt the received data in right format. Thus if an unwanted or unauthorized user will try to trespass in order to get an access to the data link will be misinformed as he wouldn’t be having the right decryption key to decode the message. Even then as the encryption key is a secure code, formula or the process to be performed at the data to be transmitted before transmission, so the user with the right decryption key or the formula to decode the encrypted data will only be able to decrypt or decode the data received all other users will not be able to decode the data received. In hardware unit Infrared is used as media. As the IR rays are light rays so there will not be any effect of radio frequencies or RF signals in the surrounding.
www.final-yearprojects.co.cc | www.troubleshoot4free.com/fyp/
To show the multi terminal communication we are going to implement for one transmitter and two receivers. User will have an option to choose one of the two receiving terminal with different decryption keys, and according to the receiver terminal chosen by the user the corresponding encryption key will be selected. Encryption/Decryption Encryption is the conversion of data into a form, called a cipher text that cannot be easily understood by unauthorized people. Decryption is the process of converting encrypted data back into its original form, so it can be understood. The use of encryption/decryption is as old as the art of communication. In wartime, a cipher, often incorrectly called a code, can be employed to keep the enemy from obtaining the contents of transmissions. (Technically, a code is a means of representing a signal without the intent of keeping it secret; examples are Morse code and ASCII.) Simple ciphers include the substitution of letters for numbers, the rotation of letters in the alphabet, and the "scrambling" of voice signals by inverting the sideband frequencies. More complex ciphers work according to sophisticated computer algorithms that rearrange the data bits in digital signals. In order to easily recover the contents of an encrypted signal, the correct decryption key is required. The key is an algorithm that undoes the work of the encryption algorithm. Alternatively, a computer can be used in an attempt to break the cipher. The more complex the encryption algorithm, the more difficult it becomes to eavesdrop on the communications without access to the key.
that is.com/fyp/ Encryption/decryption is especially important in wireless communications. such as a credit-card purchase online. encryption/decryption is a good idea when carrying out any kind of sensitive transaction. want to set up a key-escrow arrangement. steal. including that of the United States.co. or the discussion of a company secret between different departments in the organization.troubleshoot4free. This is because wireless circuits are easier to tap than their hard-wired counterparts. Decryption keys would be stored in a supposedly secure place. as the strength of encryption/decryption increases. used only by authorities. the harder it is for unauthorized people to break it -. implementing the key escrow scheme would be better than doing nothing to prevent criminals from freely using encryption/decryption. so does the cost. These governments. and used only if backed up by a court order. Once the data to be sent is selected by . While most companies and their customers view it as a means of keeping secrets and minimizing fraud. However. The stronger the cipher -. Supporters claim that while this is a possibility. in general. In recent years.the better. TRANSMITTER PART: Microcontroller unit: This module is the heart of the transmitter part which controls all the activities. some governments view strong encryption as a potential vehicle by which terrorists might evade authorities. or alter the keys.www. Opponents of this scheme argue that criminals could hack into the keyescrow database and illegally obtain. This refers to ciphers that are essentially unbreakable without the decryption keys.final-yearprojects. This means everyone who uses a cipher would be required to provide the government with a copy of the key.cc | www. Nevertheless. a controversy has arisen over so-called strong encryption.
Then it is amplified and decoded by the Darling tone Amplifier and fed to the both receivers. Once this enter switch is pressed the data displayed on the LCD is selected and transmitted immediately. we do not required to specify which LCD combination must glow for a particular alphabet or digit. RECEIVER PART IR Receiver and Decoder: IR receiver (Photodiode) receives the light rays transmitted by the transmitter section and converts them back into the electrical signal. Then it transmits this encoded data serially through its serial transmit pin. It is an intelligent LCD module.troubleshoot4free.www. First switch is used to increment the data.com/fyp/ the user then it encodes the data with the defined encryption algorithm and got the final cipher text. and third switch is the enter switch which is used to select the data. as it has inbuilt controller which convert the alphabet and digit into its ASCII code and then display it by its own i.e.final-yearprojects. 2nd switch is used to decrement the data. .co. Liquid crystal display (LCD): LCD makes this instrument user friendly by displaying everything on the display. Encoder and IR transmitter: A single transistor is here used as encoder/switch which receive the data bits from the MCU and according to the data bits switch ON/OFF (ON for bit ‘1’ & OFF for bit ‘0’) the IR transmitter. And IR transmitter receives theses electrical signals (voltage levels: LOW or HIGH) and convert them into the light rays and transmits them in the air.cc | www. User interface unit: Three switches keypad is used as user interface unit to select the data to be transmitted. This electrical signal reproduced here is very weak.
small offices etc. Wireless LAN Using IR Technology Implementing the wireless LAN using IR technology is very much advantageous. Liquid crystal display (LCD): Each receiver section contains a LCD to display the data decrypted by each section.com/fyp/ Microcontroller unit: There are two receiver parts in our project.co. Each of them employed a microcontroller unit which receive the amplified signal from the amplifier through its serial receive pin and then each MCU tries to decrypt the received data according to their keys.www.troubleshoot4free.cc | www.final-yearprojects. it is more suitable. But specific to some application like LANs for small lab environment. At the same time it has got some restrictions. Advantages Cheap High Bandwidth possible (>100 Mbits/s) No spectral regulation Confined to room of operation Security Separate networks in adjacent rooms without cross-talk Electrical immunity Won’t cause interference to sensitive electronics Or be affected by electrical / radio interference Disadvantages .
schedules. A. The communication can be between one portable communication device and another or between a portable device and a tethered device. Applications The primary commercial applications are as follows: Short term cable-less connectivity for information exchange (business cards. called an access point or base station. Wireless infrared communication systems can be characterized by the application for which they are designed or by the link type.troubleshoot4free. other regions of the optical spectrum can be used (so the term “wireless optical communications" instead of “wireless infrared communications" is sometimes used).www.final-yearprojects. file sharing) between two users.com/fyp/ High and varying noise from ambient light sources Signal blocked by solid objects Multi-path propagation – limits data rate Mobile device power consumption Wireless Infrared communications Introduction: Wireless infrared communications refers to the use of free-space propagation of light waves in the near infrared band as a transmission medium for communication. personal digital assistants. This can either be an extension of . Typical portable devices include laptop computers. Wireless local area networks (WLANs) provide network connectivity inside buildings. and portable telephones. as described below. while the base stations are usually connected to a computer with other networked connections.co.cc | www. Although infrared light is usually used.
troubleshoot4free. the link is always maintained between any transmitter and any receiver in the same vicinity by reflecting or “bouncing" the transmitted information-bearing light off reflecting surfaces such as ceilings.final-yearprojects.co. The simplest link type is the point-to-point system.com/fyp/ existing LANs to facilitate mobility. B.cc | www. and most of the transmitted light is directed toward the receiver. point-to-point systems are also called directed LOS systems. the . or established more permanently by aiming a mobile unit at a base station unit in the LAN replacement application. Here. such as wireless mice.www. The links can be created temporarily for a data exchange session between two users. The line-of. Wireless input and control devices. Building-to-building connections for high-speed network access or metropolitan or campus area networks. Link Type Another important way to characterize a wireless infrared communication system is by the “link type". which means the typical or required arrangement of receiver and transmitter. the transmitter and receiver must be pointed at each other to establish a link. The two most common configurations are: the point-to-point system and the diffuse system.sight (LOS) path from the transmitter to the receiver must be clear of obstructions. wireless game controllers. walls. Also. the transmitter employs a wide transmit beam and the receiver has a wide field-of-view. remote controls. Hence. There. the transmitter and receiver are non-directed. or to establish “ad hoc" networks where there is no LAN. and remote electronic keys. and furniture. In diffuse systems.
troubleshoot4free.co. this can be difficult to implement and additionally. However. it is difficult to detect such a signal following non directed propagation. Receivers and Transmitters A transmitter or source converts an electrical signal to an optical signal. or some combination of these techniques. one can use direct detection using a photo detector. Instead. This coherent detection technique is best when the signal phase can be maintained. At the demodulator (usually referred to as a detector in optical systems) the modulation can be extracted by mixing the received signal with a carrier light wave. The two most appropriate types of device are the light-emitting diode . in non directed propagation. An effective solution is to use intensity modulation.cc | www.com/fyp/ LOS path is not required. Hence. amplitude. and more expensive narrowline width sources are required.www. Hence.directed non-LOS systems. or frequency modulation. These systems are well suited to the wireless LAN application. it is difficult to achieve the required mixing efficiency. which for intensity modulation. freeing the user from knowing and aligning with the locations of the other communicating devices. is also the original modulating signal. Optical Design: Modulation and demodulation What characteristic of the transmitted wave will be modulated to carry information from the transmitter to the receiver? Most communication systems are based on phase.final-yearprojects. diffuse systems are also called non. However. most systems use intensity modulation with direct detection (IM/DD) to achieve optical modulation and demodulation. where the transmitted signal’s intensity or power is proportional to the modulating signal. The photo detector current is proportional to the received optical signal intensity.
. low-cost sources and detectors. most short-range commercial systems currently use LEDs.com/fyp/ (LED) and semiconductor laser diode (LD). Silicon p-i-n photodiodes are ideal for wireless infrared communications as they have good quantum efficiency in this band and are inexpensive. the near IR is outside the visible range of light. LEDs have a naturally wide transmission pattern. Safety: There are two safety concerns when dealing with infrared communication systems. Hence. their high modulation bandwidth. Eye safety is a concern because of a combination of two effects: the cornea is transparent from the near violet to the near IR. The availability of LEDs and silicon photodiodes operating in the 800 nm to 1000 nm range is the primary reason for the use of this band. Another important consideration is the spectral distribution of the dominant noise source: background lighting. Eye safety is much simpler to achieve for an LED than for a laser diode.troubleshoot4free. and so are suited to non directed links. Transmission wavelength and Noise The most important factor to consider when choosing a transmission wavelength is the availability of effective.final-yearprojects. Although laser diodes offer several advantages over LEDs that could be exploited.co. Avalanche photodiodes are not used here since the dominant noise source is background light-induced shot noise rather than thermal circuit noise. However.www. The principal advantages of laser diodes are their high energy-conversion efficiency.cc | www. and their relatively narrow spectral width. and so the eye does not protect itself from damage by closing the iris or closing the eyelid. which usually have very narrow transmit beams. A receiver or detector converts optical power into electrical current by detecting the photon flux incident on the detector surface. the retina is sensitive to damage from light sources transmitting in these bands.
www.com/fyp/ IR Light Emitter Principle of Operation Because they emit at wavelengths which provide a close match to the peak spectral response of silicon photo detectors.final-yearprojects. It should be mentioned here that there are also a number of integrated transceivers that the designer can choose as well.troubleshoot4free. There are many off-the-shelf.co. both GaAs and GaAlAs.cc | www. IR LED emitters that can be used for a discrete infrared transceiver circuit design. commercially available. In general. there are four characteristics of IR emitters that designers have to be wary of: • Rise and Fall Time • Emitter Wavelength • Emitter Power • Emitter Half-angle .
The basic .www.final-yearprojects. or they can move away from one another and form a current.cc | www. These electrons and "holes" can recombine and emit photons.troubleshoot4free. leaving behind "holes".co. This is the basics of semiconductor light detectors. Radiant Power Description In this system IR LED used is The QED233 / QED234 which is a 940 nm GaAs / AlGaAs LED encapsulated in a clear untainted. QED234 Features • Wavelength=940nm • Chip material =GaAs with AlGaAs window • Package type: T-1 3/4 (5mm lens diameter) • Matched Photo sensor: QSD122/123/124. 40° • High Output Power • Package material and color: Clear. plastic • Ideal for remote control applications Semiconductor Light Detectors Energy entering a semiconductor crystal excites electrons to higher levels. plastic T-1 3/4 package. unstinted. QSE 973. • Medium Emission Angle.com/fyp/ Wavelength vs.
Electrons and holes are swept out by the electric field. leading to a current. In avalanche photodiode. Photodiodes usually have a large sensitive detecting area that can be several hundreds microns in diameter.5 µs. but have an additional layer in which an average of M secondary electron –hole pairs are generated through impact ionization for each primary pair. Photo transistors are not typically used in IrDA standard-compatible systems because of their slow speed. like P-I-N photodiodes. A photo transistor may be used. electric field is concentrated in a thin intrinsic layer. In P-I-N photodiode. if the data rate is limited to 9. .6 kb with a pulse width of 19.www. electron hole pairs are created in the depletion region of a p-n junction in proportion to the optical power.com/fyp/ optical receiver converts the modulated light coming from the space back in to a replica of the original signal applied to the transmitter. however.final-yearprojects. A photodiode is packaged in such a way as to allow light to strike the PN junction.co. IR Light Detector The most common device used for detecting light energy in the standard data stream is a photodiode.cc | www. Types of optical detector • P-N photodiode • P-I-N photodiode • Avalanche photodiode In P-N photodiode.troubleshoot4free. Photo transistors typically have ton/toff of 2 µs or more.
Description The QSE973 is a silicon PIN photodiode encapsulated in an infrared transparent. it is common practice to apply a reverse bias to the device.cc | www.com/fyp/ Characteristic Curve of a Reverse Biased Photodiode In infrared applications.troubleshoot4free.final-yearprojects. black. This capacitance is an important factor in speed.co.www. Refer to Figure 3. There will be a reverse current that will vary with the light level. plastic T092 package. . there is an intrinsic capacitance that varies with the reverse bias voltage. Like all diodes.17 for a characteristic curve of a reverse biased photodiode.
each of which performs a particular function. This is a convenient scale of light flux. POWER SUPPLY Power supplies are designed to convert high voltage AC mains to a suitable low voltage supply for electronics circuits and other devices. mm) Link Distance To select an appropriate IR photo-detect diode.co.712 sq. The amount of light energy. A power supply can be broken down into a series of blocks.cc | www.troubleshoot4free. or irradiance that is present at the active-input interface is typically given in µW/cm2. the amount of light that may be expected at that distance and the current that will be generated by the photodiode given a certain amount of light energy. the designer must keep in mind the distance of communication. .com/fyp/ 1 _ + • Daylight filter • T092 package 2 QSE 973 Features • PIN photodiode • Receipting angle 90° • Chip size = .www. inches (2.final-yearprojects.1072 sq.
Regulator – eliminates ripple by setting DC output to a fixed voltage.www.co. Smoothing – smooth’s the DC from varying greatly to a 4.final-yearprojects. . small ripple. Step-down transformers reduce voltage. Rectifier – converts AC to DC.troubleshoot4free. TRANSFORMER Transformers convert AC electricity from one voltage to another with little loss of power. but the DC output is varying. Transformers work only with AC and this is one of the reasons why mains electricity is AC.17 Each of the block has its own function as described below 1. Transformer – steps down high voltage AC mains to low voltage AC. The two types of transformers • • Step-up transformers increase voltage. 3.com/fyp/ For example a 5V regulated supply: Figure IV. 2.cc | www.
called the turn ratio.troubleshoot4free. Transformers waste very little power so the power out is (almost) equal to the power in. instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer.co. Turns ratio = Vp = Np Vs Ns . The two lines in the middle of the circuit symbol represent the core.www. Note that as voltage is stepped down current is stepped up.18 Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V in UK) to a safer low voltage. and a small number of turns on its secondary (output) coil to give a low output voltage. A step-down transformer has a large number of turns on its primary (input) coil which is connected to the high voltage mains supply. The input coil is called the primary and the output coil is called the secondary.final-yearprojects.cc | www.com/fyp/ Transformer Figure IV. The ratio of the number of turns on each coil. determines the ratio of the voltages. There is no electrical connection between the two coils.
It is called a full-wave rectifier because it uses all AC wave (both positive and negative sections).co.cc | www. changing over the connections so the alternating directions of AC are converted to the one direction of DC.7V when conducting and there are always two diodes conducting. but it is also available in special packages containing the four diodes required. 1. In this alternate pairs of diodes conduct.troubleshoot4free. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand the peak voltages).www.com/fyp/ And Where Power Out = Power In Vs × Is = Vp × Ip Vp = primary (input) voltage Np = number of turns on primary coil Ip = primary (input) current Ns = number of turns on secondary coil Is = secondary (output) current Vs = secondary (output) voltage BRIDGE RECTIFIER A bridge rectifier can be made using four individual diodes. as shown in the diagram below.4V is used up in the bridge rectifier because each diode uses 0.final-yearprojects. .
4 × RMS value). Figure IV. and then discharges as it supplies current to the output.cc | www.www.final-yearprojects.20 Note that smoothing significantly increases the average DC voltage to almost the peak value (1.co.troubleshoot4free.4V is lost in the . supplying current to the output when the varying DC voltage from the rectifier is falling. The capacitor charges quickly near the peak of the varying DC.com/fyp/ OUTPUT – Full-wave Varying DC SMOOTHING Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS (1.
They are also rated by the maximum current they can pass. Smoothing is not perfect due to the capacitor voltage falling a little as it discharges. C = 5 × Io Vs × f Where C = smoothing capacitance in farads (F) Io = output current from the supply in amps (A) Vs = supply voltage in volts (V). Negative voltage regulators are available. giving a small ripple voltage.www.4 × 4. Smoothing capacitor for 10% ripple.cc | www.final-yearprojects.6 = 6. A larger capacitor will give fewer ripples. with smoothing this increases to almost the peak value giving 1.troubleshoot4free.co.21 Voltage regulator ICs are available with fixed (typically 5.com/fyp/ bridge rectifier). this is the peak value of the unsmoothed DC f = frequency of the AC supply in hertz (Hz). The capacitor value must be doubled when smoothing half-wave DC. mainly for use in . 12 and 15V) or variable output voltages.4V smooth DC. For many circuits a ripple which is 10% of the supply voltage is satisfactory and the equation below gives the required value for the smoothing capacitor. 50Hz in the UK REGULATOR Figure IV.
Working of Power Supply • Transformer Figure IV.co.troubleshoot4free. They include a hole for attaching a heat sink if necessary. Many of the fixed voltage regulator ICs has 3 leads and look like power transistors. heaters and special AC motors.23 .cc | www. Most regulators include some automatic protection from excessive current (‘overload protection') and overheating (‘thermal protection'). It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.www. • Transformer + Rectifier Figure IV. such as the 7805 +5V 1A regulator shown on the right.com/fyp/ dual supplies.22 The low voltage AC output is suitable for lamps.final-yearprojects.
com/fyp/ The varying DC output is suitable for lamps. heaters and standard motors.www.troubleshoot4free.final-yearprojects. It is suitable for electronic circuits. • Transformer + Rectifier + Smoothing + Regulator D 1 L 1 V M I NV GND 7 O 8 2 0 U most 1 N 4 0 0 7 2 5 T + 5 V J 1 3 2 1 D 1 0 0 0 u f V C 1 g n d D 3 D 4 3 .cc | www. • Transformer + Rectifier + Smoothing Figure IV.24 The smooth DC output has a small ripple.co. It is not suitable for electronic circuits unless they include a smoothing capacitor.
cc | www. aeronautics. I/O ports and timers to make them functional. A microcontroller has a CPU (a microprocessor) in addition to the fixed amount of RAM. there is no need for the computing power of a 486 or even . ROM and I/o ports needed to fit the task at hand. Cellular phones musical Instruments to Computers. FAX machines.www. and timers are all embedded together on the chip: therefore. I/O ports. This is the not the case with microcontrollers. engine control. Microcontroller versus Microprocessors: What is the difference between a microprocessor and microcontroller? The microprocessors (such as 8086. and number of I/O ports in microcontrollers make them ideal for many applications in which cost and space are critical.final-yearprojects. for example a TV remote control. ROM. the designer cannot add any external memory. The fixed amount of on chip RAM. The Microcontroller: In our day to day life the role of micro-controllers has been immense.com/fyp/ Figure IV. Camera. security systems and the list goes on. It is suitable for all electronic circuits. or timer to it. Exercise equipment. ROM. 68000 etc.25 The regulated DC output is very smooth with no ripple. They are used in a variety of applications ranging from home appliances. I/O.co.troubleshoot4free. and I/O ports make the system bulkier and much more expensive.purpose microprocessors. ROM. 80286. For this reason they are referred as general. they have the advantage of versatility such that the designer can decide on the amount of RAM. A system designer using general. ROM. Although the addition of external RAM. no ROM and no I/O ports on the chip itself. Video games.) contain no RAM.purpose microprocessor must add external RAM. In many applications.
printer. An embedded product uses a microprocessor (or microcontroller) to do one task and one task only. Software for a variety of applications can be loaded and run. It is interesting to know that some microcontroller’s manufactures have gone as far as integrating an ADC and other peripherals into the microcontrollers.final-yearprojects. network server. In many applications. mouse and so on. For example. video game player. sound card. the space it takes.com/fyp/ a 8086 microprocessor. Microprocessors and microcontrollers are widely used in embedded system products. modem. get data and print it. inside every mouse there is a microcontroller to perform the task of finding the mouse position and sending it to the PC.cc | www. CD-ROM driver. we often see a term embedded system. print server. A printer is an example of embedded system since the processor inside it performs one task only: namely. These applications most often require some I/O operations to read signals and turn on and off certain bits. there is only one application software that is burned into ROM.co. A PC contains or is connected to various embedded products such as the keyboard. Of course the reason a PC can perform myriad tasks is that it has RAM memory and an operating system that loads the application software into RAM and lets the CPU run it. or internet terminal. . Microcontrollers for Embedded Systems: In the literature discussing microprocessors.troubleshoot4free. disk controller.www. the power it consumes. In an embedded system. and the price per unit are much more critical considerations than the computing power. Each one of these peripherals has a microcontroller inside it that performs only one task. Contrasting this with a IBM PC which can be used for a number of applications such as word processor.
Intel Corporation introduced an 8-bit microcontroller called the 8051. they are all compatible with the original 8051 as far as the instructions are concerned.troubleshoot4free. The 8051 is an 8-bit processor. meaning the CPU can work on only 8. each 8.bit pieces to be processed by the CPU. in many years the manufacturers for generalpurpose microprocessors have targeted their microprocessor for the high end of the embedded market. This means that if you write your program for one. Philips Corporation. The 8051 became widely popular after Intel allowed other manufacturers to make any flavor of the 8051 they please with the condition that they remain code compatible with the 8051. This microcontroller had 128 bytes of RAM. two timers. Dallas Semiconductors. one serial port.final-yearprojects. 4K bytes of on-chip ROM. AT89C51 From ATMEL Corporation: This popular 8051 chip has on-chip ROM in the form of flash memory.cc | www. and four ports (8-bit) all on a single chip.bit wide. many manufacturers put only 4K bytes on the chip. Although 8051 can have a maximum of 64K bytes of on-chip ROM. The 8051 has a total of four I/O ports. The major 8051 manufacturers are Intel. Infineon.com/fyp/ Although microcontrollers are the preferred choice for many embedded systems. it will run on any one of them regardless of the manufacturer. there are times that a microcontroller is inadequate for the task. Introduction to 8051: In 1981. It is important to know that although there are different flavors of the 8051. This has led to many versions of the 8051 with different speeds and amount of on-chip ROM marketed by more than half a dozen manufacturers.co. Atmel.www. This is ideal for fast development since flash memory can be erased in . For this reason.
Notice that in flash memory you must erase the entire contents of ROM in order to program it again. Two-Level Interrupt Architecture.troubleshoot4free. To use the AT89C51 to develop a microcontrollerbased system requires a ROM burner that supports flash memory: However.co. a ROM eraser is not needed.www. 32 I/O lines. Two16-Bit Timer/Counters.com/fyp/ seconds compared to twenty minutes or more needed for the earlier versions of the 8051. 4 Kbytes of Flash. To eliminate the need for a PROM burner Atmel is working on a version of the AT89C51 that can be programmed by the serial COM port of the PC. Five Vector. The PROM burner does this erasing of flash itself and this is why a separate burner is not needed. .cc | www. Full Duplex Serial Port. Atmel Microcontroller AT89C51 Hardware features 40 pin Ic. 128 Bytes of RAM.final-yearprojects.
co. The Power Down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. If we need more code space for our application. timer/counters. Register and Relative Addressing. particularly for developing 89Cxx projects with C language.final-yearprojects. The Atmel Flash devices are ideal for developing. . the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.cc | www. Indirect. The Idle Mode stops the CPU while allowing the RAM.troubleshoot4free. Software features Bit Manipulations Single Instruction Manipulation Separate Program And Data Memory 4 Bank Of Temporary Registers Direct. Atmel offers a broad range of microcontrollers based on the 8051 architecture. since they can be reprogrammed easy and fast. with on-chip Flash program memory. In addition.www.com/fyp/ On Chip Oscillator and Clock Circuitry. serial port and interrupt system to continue functioning.
final-yearprojects.cc | www. XTAL1. P1. EA. The rest of the pins are designated as V cc. GND. RD. All these pins except PSEN and ALE are . address and interrupts.co. RST. where each port takes 8 pins. XTAL. a total of 32 pins are set aside for the four ports P0. P2.www. Out of 40 pins. WR.com/fyp/ Internal Architecture of AT89C51 Pin description: The 89C51 have a total of 40 pins that are dedicated for various functions such as I/O. and P3. and PSEN.troubleshoot4free.
respectively.final-yearprojects. PSEN and ALE are used mainly in 8031 based systems.cc | www. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source. Oscillator Characteristics: XTAL1 and XTAL2 are the input and output. XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure. as shown in Figure. The voltage source is +5V. of an inverting amplifier which can be configured for use as an on-chip oscillator. Vcc Pin 40 provides supply voltage to the chip. they must be connected in order for the system to work. GND Pin 20 is the ground.co. In other words. . regardless of whether the microcontroller is of the 8051 or the 8031 family.com/fyp/ used by all members of the 8051 and 8031 families.www.troubleshoot4free. The other two pins.
com/fyp/ Oscillator Connections It must be noted that there are various speeds of the 8051 family. In other words. Upon applying a high pulse to this pin. it must have a minimum duration of 2 machine cycles. Activating a power-on reset will cause all values in the registers to be lost.final-yearprojects. EA .troubleshoot4free. RST Pin 9 is the reset pin. a 20 MHz microcontroller requires a crystal frequency of no more than 20 MHz. In order to RESET input to be effective.cc | www. the high pulse must be high for a minimum of 2 machine cycles before it is allowed to go low. Speed refers to the maximum oscillator frequency connected to the XTAL.co. forcing the CPU to fetch the first code from ROM memory location 0000. Likewise. Notice that the value of Program Counter is 0000 upon reset. This is often referred to as a power –on reset.www. It is an input and is active high (normally low). For example. a 12 MHz chip must be connected to a crystal with 12 MHz frequency or less. This means that we must place the first line of source code in ROM location 0000 that is where the CPU wakes up and expects to find the first instruction. the microcontroller will reset and terminate all activities. When the 8051 is connected to a crystal oscillator and is powered up. we can observe the frequency on the XTAL2 pin using oscilloscope.
” It is the read strobe to external program memory.final-yearprojects. ready to be used as output ports. In other words. The ALE pin is used for demultiplexing the address and data by connecting to the G pin of the 74LS373 chip. it must be programmed. When the microcontroller is executing from external memory. For family members such as 8031 and 8032 in which there is no on-chip ROM. In such cases. Port 0 . ALE ALE (Address latch enable) is an output pin and is active high. I/O port pins and their functions The four ports P0.co. the EA pin is connected to the Vcc. PSEN stands for “program store enable. making them 8-bit ports. it cannot be left unconnected. PSEN This is an output pin.www. All the ports upon RESET are configured as output.troubleshoot4free. To use any of these as input port.” is pin number 31 in the DIP packages. It is input pin and must be connected to either V cc or GND. PSEN is activated twice each machine cycle. Therefore for the 8031 the EA pin must be connected to ground to indicate that the code is stored externally.cc | www. port 0 provides both address and data. P2. In other words the microcontroller multiplexes address and data through port 0 to save pins. which stands for “external access. and P3 each use 8 pins. P1. When connecting a microcontroller to external memory. EA. code is stored on an external ROM and is fetched by the 8031/32.com/fyp/ All the 8051 family members come with on-chip ROM to store programs.
The microcontroller multiplexes address and data through port 0 to save pins. It can be used for input or output. the port must be programmed by writing 1 to all the bits of it.www. Upon reset. It can be used as input or output. port 1 is configures as an output port. it provides data D0-D7. port 0 provides both address and data.com/fyp/ Port 0 occupies a total of 8 pins (pins 32 to 39). . port 1 can be used as an input port by writing 1 to all its bits. When ALE=0. It can be used as input or output.co. Similar to port 0. but when ALE=1 it has address A0-A7.troubleshoot4free. it must be programmed as such by writing 1s to it. port 2 does not need any pullup resistors since it has pull-up resistors internally. In order to make port 0 an input port. Port 1 Port 1 occupies a total of 8 pins (pins 1 to 8). Port 2 Port 2 occupies a total of 8 pins (pins 21 to 28). With external pull-up resistors connected upon reset. Just like P1. Upon reset port 2 is configured as output port. port 0 is configured as output port. ALE is used for de-multiplexing address and data with the help of latch 74LS373. Port 0 is also designated as AD0-AD7. P2 and P3. This is due to fact that port 0 is an open drain. ALE indicates if P0 has address or data. To use the pins of port 0 as both input and output ports.cc | www. allowing it to be used for both data and address. this port does not require pull-up resistors since it has already pull-up resistors internally. unlike P1. each pin must be connected externally to a 10K-ohm pull-up resistor.final-yearprojects. Therefore. In contrast to port 0. To make port 2 as input port. When connecting a microcontroller to an external memory.
troubleshoot4free. This 4K bytes ROM memory has memory addresses of 0000 to 0FFFh.0 P3. It can be used as input or output. P3 does not need any pull-up resistors. addresses 0000h to FFFFh.1 P3. will cause the microcontroller to automatically fetch code bytes from external memory.www. Port 3 has an additional function of providing some extremely important signals such as interrupts.cc | www.6 P3. Internal ROM The 89C51 has 4K bytes of on-chip ROM.final-yearprojects. the same as P1 and P2 did not.3 P3.5 P3.com/fyp/ Port 3 Port 3 occupies a total of 8 pins (pins 10 to 17). Although port 3 is configured as output port upon reset. Some of the alternate functions of P3 are listed below: P3.7 RXD (Serial input) TXD (Serial output) INT0 (External interrupt 0) INT1 (External interrupt 1) T0 (Timer 0 external input) T1 (Timer 1 external input) WR (External memory write strobe) RD (External memory read strobe) Memory Space Allocation 1. by connecting the external access pin to ground. The program counter doesn’t care where the code is: the circuit . Code bytes can also be fetched exclusively from an external memory.4 P3.2 P3. this is not the way it is most commonly used.co. which exceed the internal ROM capacity. Program addresses higher than 0FFFh.
totally in external ROM or in a combination of internal and external ROM. A total of 16 bytes from locations 20h to 2Fh are set aside for bit addressable read/write memory and instructions. Serial Interface: . however. Serial data received from a distant source is converted to parallel form so that it can be easily transferred on the microcomputer buses. For transferring data over long distances.com/fyp/ designer decides whether the code is found totally in internal ROM. Therefore.final-yearprojects. parallel data transmission requires too many wires. These 80 locations of RAM are widely used for the purpose of storing data and parameters by 8051 programmers.www.co. Data Communication Concepts: Within a microcomputer data is transferred in parallel.troubleshoot4free. or what is normally called a scratch pad. data to be sent long distances is usually converted from parallel form to serial form so that it can be sent on a single wire or pair of wires. 2. A total of 80 bytes from locations 30h to 7Fh are used for read and write storage.cc | www. 2. A total of 32 bytes from locations 00 to 1Fh are set aside for register banks and the stack. because that is the fastest way to do it. These 128 bytes can be divided into three different groups as follows: 1. Internal RAM The 1289 bytes of RAM inside the 8051 are assigned addresses 00 to 7Fh.
A protocol defines the specific methods of coordinating transmission between a sender and receiver. and so on.troubleshoot4free. like any data transfer. Parallel I/O requires the entire bus while the serial I/O requires only one or pair of data lines for communication. Serial data can be sent synchronously or asynchronously.com/fyp/ Basic concepts concerning the serial communication can be classified into categories below: Interfacing requirements Transmission format Error check in data communication Standards in serial I/O Interfacing Requirements: The serial interface requirement is very much similar to parallel interface requirement. The primary difference between the parallel I/O and serial I/O is the number of lines used for data transfer. . when the receiver's capacity has been exceeded. For example.cc | www. speed. Computer identifies the peripheral through port address and enable if using the read and write signals. when one particular bit or byte ends and another begins.www. when to start the transmission and when to end it. requires coordination between the sender and receiver. Transmission Format: Transmission format for communication is concerned with the issues such as synchronization.final-yearprojects. errors and medium of transmission.co. direction of data flow. Serial Transmission Methods: Serial Communication.
Usually in the PC environment you will find 7 or 8 bit words. the only important issue is that both systems must be set at the same port speed. One important aspect of this method is that if either end of the communication loses its clock signal. if the sensing device senses something in between the 5 second lap it assumes that whatever is passing is a foreign object of some sorts and sounds an alarm.cc | www. By keeping streams short. When the receiving end of the communication receives the start bit it starts a short term timer. if on the 5 second lap nothing goes by it assumes that the product is missing and sounds an alarm. By introducing a start bit which indicates the start of a short data stream.troubleshoot4free. This method is known as asynchronous communication because the sending and receiving end of the communication are not precisely synchronized by the means of a signal line. The first one is synchronous communication.final-yearprojects.com/fyp/ Two serial transmission methods are used that correct serial bit errors.www. By checking the clock the receiving end can determine if a bit is missing or if an extra bit (usually electrically induced) has been introduced in the stream.Each stream of bits are broke up in 5 to 8 bits called words. there's not enough time for the timer to get out of sync. the communication is terminated. lets say that on a conveyor belt a product is passing through a sensing device every 5 seconds. the sending and receiving ends of the communication are synchronized using a clock that precisely times the period separating each bit. the position of each bit can be determined by timing the bits at regular intervals. by sending start bits in front of each 8 bit streams. the first is to accommodate all upper and lower case text characters in ASCII codes (the 127characters) the latter one is used to . the two systems don't have to be synchronized by a clock signal. The alternative method (used in PCs) is to add markers within the bit stream to help track each data bit.co. Here is an example of this method of communication.
this used as a data integrity check. The rates at which the data is sent . Five different parity bits can be used. The later two methods offer a means of detecting bit level transmission errors. This is often referred to as a data frame. the least significant bit of the word is sent first and the most significant bit is sent last. the parity bit is set to logical 1 if the result is odd.com/fyp/ exactly correspond to one byte. Bit Rates: Another important part of every asynchronous serial signal is the bit rate at which the data is transmitted. Sometimes it will add a parity bit between the last bit of the word and the first stop bit. When communicating the sender encodes the each word by adding a start bit in front and 1 or 2 stop bits at the end. the space parity bit is always set at a logical 0.cc | www. Note that you don't have to use parity bits. the even parity bit is set to logical 1 by counting the number of bits in the word and determining if the result is even.www. in the odd parity bit. This example uses an 8 bit word with even parity and 1 stop bit also referred to as an 8E1 setting. By convention. thus eliminating 1 bit in each frame. Fig : Asynchronous Serial Data Frame (8E1) In the example above you can see how the data frame is composed of and synchronized with the clock signal.troubleshoot4free.co.final-yearprojects. the mark parity bit is always set at a logical 1. this is often referred to as non parity bit frame.
so the rates are as follows. 100 and 150 bps. and a positive voltage level as a 1 bit. 9600. Once this change has occurred. Asynchronous Serial Communication: This section provides an overview of the protocol that governs the lowest level of data transmission--how serialized bits are sent over a single electrical line. the mark state employs a positive voltage level. When a sender is connected to a receiver over an electrical connecting line. The change from mark to space is known as the start bit. to determine whether a 0-bit or a 1-bit is present on the line.troubleshoot4free. you merely double the preceding rate. there is an initial state in which communication has not yet begun.co. called the idle or mark state. 2400. The start bit delineates the beginning of the transmission unit defined as a character frame. This standard rests on more than a century of evolution in teleprinter technology. Faster speeds are all based on the 300 bps rate.com/fyp/ is based on the minimum speed of 300 bps (bits per second).final-yearprojects. but these are not used in today’s technologies. . you may find some slower speeds of 50. 600. 19200 and 38400 which is the fastest speed supported by today’s BIOS’s. the receiver interprets a negative voltage level as a 0 bit. 1200. Changing the state of the line by shifting the voltage to a negative value is called a space. These transitions are shown in figure . 4800. The receiver then samples the voltage level at periodic intervals known as the bit time. and this triggers the synchronization necessary for asynchronous serial transmission. Because older electromechanical devices operate more reliably with current continually passing through them.www.cc | www.
After the data bits in the frame are sent. known as baud (in honor of telecommunication pioneer Emile Baudot).cc | www. a bit is sent so that the entire frame always contains an odd number of 1 bit. which the sender and receiver must agree upon prior to transmission.final-yearprojects. Note that because modern protocols can express more than one bit value within the sampling interval. 7. or 8 bits in length. Other . that is. how many bits of data constitute a character frame. Character frames of 7 or 8 data bits are commonly used for transmitting ASCII characters. The Serial Driver supports frames of 5. the sender and receiver agree on a serial data format. the baud rate and the data rate (bps) are not always identical.www. in even parity. the parity bit results in an even number of 1 bit. Conversely. Common values for the sampling rate are 1200 baud and 2400 baud.co. the sender can optionally transmit a parity bit for error-checking. No parity means that no additional bit is sent. In the case where one sampling interval can signal a single bit.troubleshoot4free. a baud rate of 1200 results in a transfer rate of 1200 bits per second (bps). There are various parity schemes. and what happens after those bits are sent.com/fyp/ Fig : The Format of Serialized Bits [Missing Image] The bit time is expressed in samples per second. This sampling rate must be agreed upon by sender and receiver prior to start of transmission in order for a successful transfer to occur. Prior to transmission. 6. In odd parity.
Using parity bits for error checking. or lengthened (added). 2 bit times.troubleshoot4free. This signal is known as the stop bit. the ability of the receiver to distinguish a character frame may be affected.com/fyp/ less-used parity schemes include mark parity. or 1-1/2 bit times.co.final-yearprojects. is now considered a rudimentary approach to error detection. and returns the transmission line back to idle status.cc | www. in which its value is always 0. therefore. various types of errors can occur. This noise can cause errors in transmission. Most communication systems employ more reliable techniques for error detection and correction. the sender places the line back to the mark state (positive voltage) for a minimum specified time interval. but exists at a lower level than the ASCII encoding scheme (which governs the encoding of information within the character frame Error Check In Data Communication: During transmission. This interval has one of several possible values: 1 bit time.www. When this occurs. The break signal is a special signal that falls outside the character frame. and space parity. regardless of the scheme. These errors need to be checked. The break signal resembles an ASCII NUL character (a string of 0-bits). by altering voltage levels so that a bit is reversed (flipped). resulting in a framing error. The break signal occurs when the line is switched from mark (positive voltage) to space (negative voltage) and held there for longer than a character frame. Electrical lines are always subject to environmental perturbations known as noise. To signify the end of the character frame. additional information for error checking is sent during transmission the receiver can check the received . in which the extra bit is always 1. shortened (dropped).
When data are transmitted as voltage. auto-reload. the commonly used standard is known as RS232C. The baud rate in the 8051 is programmable. When timer 1 is used to set the baud rate it must be programmed in mode 2. speed of data transfer.800 HZ. A standard may include such items as assignment of pin positions for signals.co. The rate of transmission is RS232C is restricted to a maximum of 20k baud and a distance of 50 feet.troubleshoot4free.com/fyp/ data against the error check information.6 KHZ. the receiver can request there retransmission of that data segment. The 8051’s serial communication UART circuitry divides the machine cycle frequency of 921.result is 28. voltage levels.0592 MHZ Machine cycle frequency = 11. checksum and redundancy check Standard in Serial I/O: The serial I/O technique is commonly used to interface terminals. .0592/12= 921. Three methods generally used for this purpose are parity check. printers etc.6 kHz by 32 once more before it is used by timer1 to set the baud rate . and if the error is detected.final-yearprojects.cc | www. a standard is normally defined by a professional organization (such as IEEE). This value is used to find the timer 1 value to set the bad rate. length of cable and mechanical specifications. This is done with the help of timer 1 Frequency of XTAL = 11. that is 8 bit. It is defined as reference to data terminal equipment (DTE) and data communication equipment (DCE). 8051 Serial Communication Programming Baud Rate in The 8051 The 8051 transfers and receives data serially at many different baud rates.www.
both are 16 bits wide.cc | www. and it is split in to TL1 & TH1. D1 5 D1 4 D1 3 TH1 D1 2 D1 1 D1 0 D 9 D 8 D 7 D 6 D 5 D 4 D 3 TL1 D 2 D 1 D 0 TMOD (Timer Mode) Register (20h) Both timers 0 & 1 use the same register. D1 5 D1 4 D1 3 D1 2 D1 1 D1 0 D 9 D 8 D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 Timer 1 Register Timer 1 is also 16 bits. # 4FH”moves the value 4FH in to TL0. These timers are.TMOD is an 8-bit register in which the lower 4 bits are set aside for timer 0 and the upper 4 bits are set aside for timer 1. the lower 2 bits are used to set the timer mode and upper 2 bits to specify the operation. and each 16 bit timer is accessed as two separate registers of low byte and high byte. They can be used either as timers to generate a time delay or as counters to count events happening outside the microcontroller. (MSB) (LSB) GATE C/T M1 M0 GATE C/T M1 M0 .final-yearprojects. the instruction “MOV TL0. In each case.For ex.to set the various timer operation modes. Timer 0 Register The low byte register is called TL0 and the high byte register is referred to as TH0.co.com/fyp/ Counter/Timer Programming The 8051 has two timers/counters. called TMOD. the low byte of timer 0.troubleshoot4free..www. timer 0 and timer 1.
and data bits of data framing. SCON (Serial Control) Register (50 H) The SCON register is an 8 bit register used to program the start bit.www. . Serial port mode spécifier.SBUF can be accessed like any other register in the 8051.com/fyp/ . Similarly. SM0 SM1 SM2 REN TB8 RB8 T1 R1 SM0 SM1 SM2 Serial port mode spécifier. The following describes various bits of the SCON register.co. it must be placed in the SBUF register.cc | www.troubleshoot4free. among other things.for a byte of data to be transferred via the TxD line.final-yearprojects.Timer 1 Timer 0 Mode Operating Mode M1 M0 C/T = 0 =1 Mode bit 1 Mode bit 0 for Timer for Counter 1 0 2 8-bit auto reload GATE = 0 When on/off is done by software = 1 when additional hardware is needed for on/off. SBUF Register SBUF is an 8 bit register used solely for special communication in the 8051. Used for multiprocessor communication. stop bit. SBUF holds the byte of data when it is received by the 8051’s RxD line.
Three pins are used as control lines these are Read/Write pin. another two pins are for Backlight & LCD ground and one pin is used for contrast change. LCD pin description Pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Symbol VSS VCC VEE RS R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 I/O I I I/O I/O I/O I/O I/O I/O I/O I/O I/O Description Ground +5V power supply Power supply to control contrast RS=0 to select command register. This LCD contains 16 pins.www. Not widely used. RS=1 to select data register. which are extended ASCII. 1 stop bit. Enable pin and Register select pin. R/W=1 for read Enable The 8 bit data bus The 8 bit data bus The 8 bit data bus The 8 bit data bus The 8 bit data bus The 8 bit data bus The 8 bit data bus The 8 bit data bus . Interfacing of Microcontroller with LCD The LCD. intelligent LCD. The main features of this LCD are: 16*2 display.troubleshoot4free. Mode SM0 SM1 0 1 Serial mode 1. Two pins are used for Backlight and LCD voltage.final-yearprojects. Transmit interrupt flag.co. in which 8 pins are used as 8-bit data I/O. Receive interrupt flag. which is used as a display in the system. 8 bit data.cc | www. is LMB162A. Not widely used.com/fyp/ REN TB8 RB8 T1 R1 Set/cleared by software to enable/disable reception. 1 start bit. used for alphanumeric characters & based on ASCII codes. R/W=0 for write.
troubleshoot4free. Variable voltage between Ground and Vcc is used to specify the contrast (or "darkness") of the 3 . their by relieving the CPU of the task of refreshing the LCD and also the ease of programming for characters and graphics.com/fyp/ Liquid Crystal Display: Liquid crystal displays (LCD) are widely used in recent years as compares to LEDs. HD 44780 based LCDs are most commonly used.final-yearprojects.cc | www. the ability to display numbers. VEE The voltage VCC and VSS provided by +5V and ground respectively while VEE is used for controlling LCD contrast. 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 6 5 4 3 2 1 0 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 6 5 4 3 2 1 0 G V D D D D D D D D E R R C V G n d c c 7 6 5 4 3 2 1 0 / S o c n W n t r a 2s t c d 1 LCD Pin Description Diagram VCC. VSS. characters and graphics. characters on the LCD screen. incorporation of a refreshing controller into the LCD. LCD pin description: The LCD discuss in this section has the most common connector used for the Hitachi 44780 based LCD is 14 pins in a row and modes of operation and how to program and interface with microcontroller is describes in this section. This is due to the declining prices of LCD.co.www.
final-yearprojects. the data register is selected. If RS=0. then allowing to user to send a command such as clear display. we send ASCII codes for the letters A-Z. We also use RS =0 to check the busy flag bit to see if the LCD is ready to receive the information. There are also command codes that can be sent to clear the display or force the cursor to the home position or blink the cursor. R/W (read/write) The R/W (read/write) input allowing the user to write information from it. To displays the letters and numbers. When D7 =0. the LCD is busy taking care of internal operations and will not accept any information. the LCD is ready to receive new information..troubleshoot4free. Interfacing of micro controller with LCD display: . a-z. when it read and R/W=0. The busy flag is D7 and can be read when R/W =1 and RS =0. are used to send information to the LCD or read the contents of the LCD’s internal registers. when D7 =1(busy flag =1). cursor at home etc. EN (enable) The enable pin is used by the LCD to latch information presented to its data pins. D0-D7.com/fyp/ RS (register select) There are two important registers inside the LCD. when it writing. a high power. When data is supplied to data pins. a high-to-low pulse must be applied to this pin in order to for the LCD to latch in the data presented at the data pins. D0-D7 (data lines) The 8-bit data pins. If RS=1. and numbers 0-9 to these pins while making RS =1.cc | www.www. as follows: if R/W =1 and RS =0. The RS pin is used for their selection as follows. the instruction command code register is selected. R/W=1. allowing the user to send data to be displayed on the LCD.co.
Before sending commands or data to the LCD module. the "S/C" bit is set (equal to "1") .www.1ms for clearing the display or moving the cursor/display to the "home position". it also frees up a microcontroller pin for other uses. Normally. 160µs for all other commands) and also the application software is simpler. by setting the "S/C" bit during the "Move Cursor/Shift Display" command.final-yearprojects. the cursor built into the LCD will increment to the next position (either right or left). Once the initialization is complete. During initialization. the microcontroller I/O pins have to be alternated between input and output modes. the "R/W" line is grounded.com/fyp/ In most applications. except that the "RS" line is set. In this case. the Module must be initialized.cc | www.co. This simplifies the application because when data is read back. "R/W" to ground and just wait the maximum amount of time for each instruction (4. the LCD can be written to with data or instructions as required. Each character to display is written like the control bytes. after each character is sent to the LCD.troubleshoot4free. Different LCD execute instructions at different rates and to avoid problems later on (such as if the LCD is changed to a slower unit).
7/RD P3.0/AD0 31 9 18 19 8 7 6 5 4 3 2 1 32 33 34 35 36 37 38 39 3 33pF 33pF VCC 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 VCC 22uF P3.co.2 P1.1/TXD P3.3/AD3 P0.0/A8 AT89C51 PSEN 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 1 VCC VCC Interfacing of Microcontroller with LCD LCD Command Code Code (HEX) 1 2 4 6 7 8 9 A C E F 10 14 18 1C 80 C0 38 Command to LCD Instruction Register Clear the display screen Return home Decrement cursor(shift cursor to left) Increment cursor(shift cursor to right) Shift display right Shift display left Display off. cursor blinking Display on.final-yearprojects.3/A11 P2.1/AD1 P0.3 P1. cursor on Display on.1/A9 P2. cursor off Display off.troubleshoot4free.4 P1.5 P1.5/T1 P3.0/RXD P2.2/INTO P3.7/AD7 P0.7 P1.6 P1.1 P1. cursor blinking Shift cursor position to left Shift cursor position to right Shift the entire display to left Shift the entire display to right Force cursor to the beginning of 1st line Force cursor to the beginning of 2nd line 2 line and 5×7 matrix 8.6/A14 P2.2 K .5/A13 P2.cc | www.4/AD4 P0.www.3/INT1 P3. cursor off Display on.5/AD5 P0.4/TO P3.4/A12 P2.6/AD6 P0.6/WR P3.com/fyp/ VCC EA/VPP 30 29 17 16 15 14 13 12 11 10 28 27 26 25 24 23 22 21 ALE/PROG RST XTAL2 XTAL1 P1.7/A15 P2.2/A10 P2.0 P0.2/AD2 P0.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.