You are on page 1of 42

J.I.E.T.

JIND
A Project Report
On

MICROCONTROLLER BASED COUNTDOWN

TIMER
Submitted for partial fulfillment of B.ECH in ELECTRONICS &COMMUNICATION ENGINEERING

SUBMITTED TO: Er.Harbinder jindal (ECE Dept.)

SUBMITTED BY: ABHIMANYU KUMAR ANKUSH KUMAR RAGHIB KHAN

PROJECT COMPLETION CERTIFICATE

This

is

to

certify

that

ABHIMANYU

KUMAR

(1608439),

RAGHIB

KHAN

(1608441),ANKUSH KUMAR(1608447)has

successfully completed the Minor Project for

the partial fulfillment of requirements of the B.tech. as prescribed by the Board OF Technical Education Haryana.

This work is the record of authentic work carried out by the student during the period of training and is submitted during the Academic Year 2010 2011.

Er.------------(HOD ECE Deptt.)

Preface

Project

is very important for B.ech students. This training provides them

opportunity to be familiar with the company environment. During this training they can show and can enhance their practical skills and gain practical knowledge and experience for future. This is best way through which the students can learn the latest technologies being used in the companies.

Acknowledgement
I want to express my sincere gratitude and thanks to Er. HARBINRER JINDAL( ECE Deptt), JIND INSTITUTE OF ENGINEERING AND TECHNOLOGY for granting me permission for my PROJECT WORK MICROCONTROLLER BASED COUNTDOWN TIMER I express my sincere thanks to Mr.Vikas Gupta for his cooperative attitude and consistence guidance, due to which I was able to complete my Project successfully.

INTRODUCTION TO MICROCONTROLLERS

A micro-controller can be compared to a small stand alone computer, it is a very powerful device, which is capable of executing a series of pre-programmed tasks and interacting with other hardware devices. Being packed in a tiny integrated circuit (IC) whose size and weight is usually negligible, it is becoming the perfect controller for robots or any machines requiring some kind of intelligent automation. A single microcontroller can be sufficient to control a small mobile robot, an automatic washer machine or a security system. Any microcontroller contains a memory to store the program to be executed, and a number of input/output lines that can be used to interact with other devices, like reading the state of a sensor or controlling a motor.

Nowadays, microcontrollers are so cheap and easily available that it is common to use them instead of simple logic circuits like counters for the sole purpose of gaining some design flexibility and saving some space. Some machines and robots will even rely on a multitude of microcontrollers, each one dedicated to a certain task. Today, microcontrollers are an indispensable tool for the robotics hobbyist as well as for the engineer. Starting in this field can be a little difficult, because you usually can't understand how everything works inside that integrated circuit, so you have to study the system gradually, a small part at a time, until you can figure out the whole image and understand how the system works. The underlying principle mainly relies up on the ability

of DTMF (Double Tune Multi Frequency) ICs to generate DTMF corresponding to a number or code in the number pad and to detect the same number or code from its corresponding DTMF. In detail, a

DTMF the

generator

generates networks,

two

frequencies the

corresponding transmitter

to

number or code in the number pad which will be transmitted through communication constituting section which is simply equivalent to a mobile set. In the receiver part, the DTMF detector IC, for example IC MT 8870 detects the number or code represented by DTMF back, through the inspection of the two transmitted frequencies. The DTMF frequencies representing the number/ codes are shown below.

The 8051 microcontroller architecture

The 8051 is the name of a big family of microcontrollers. The device which we are going to use along this report is the 'AT89S52' which is a typical 8051 microcontroller manufactured by Atmel. Note that this part doesn't aim to explain the functioning of the different components of a 89S52 microcontroller, but rather to give you a general idea of the organization of the chip and the available features, which shall be explained in detail along this report. The block diagram provided by Atmel in their datasheet showing the architecture the 89S52 device can seem very complicated, and since we are going to use the its own assembly language to program it, a simpler architecture can be represented as the figure 1.2.A.

This figures shows the main features and components that the designer can interact with. You can notice that the 89S52 has 4 different ports, each one having 8 Input/output lines providing a total of 32 I/O lines. Those ports can be used to output DATA and orders do other devices, or to read the state of a sensor, or a switch. Most of the ports of the 89S52 have 'dual function' meaning

that they can be used for two different functions: the fist one is to perform input/output operations and the second one is used to implement special features of the microcontroller like counting external pulses, interrupting the execution of the program according to external events, performing serial data transfer or connecting the chip to a computer to update the software.

Each port has 8 pins, and will be treated from the software point of view as an 8-bit variable called 'register', each bit being connected to a different Input/output pin. You can also notice two different memory types: RAM and EEPROM. Shortly, RAM is used to store variable during program execution, while the EEPROM memory is used to store the program itself, that's why it is often referred to as the 'program memory'. The memory organization will be discussed in detail later. The special features of the 89S52 microcontroller are grouped in the blue box at the bottom of figure 1.2.A. At this stage of the report, it is just important to note that the 89S52 incorporates hardware circuits that can be used to prevent the processor from executing various repetitive tasks and save processing power for more complex calculations. Those simple tasks can be counting the number of external pulses on a pin, or generating precise timing sequences.

Fig 1.2.A

It is clear that the CPU (Central Processing Unit) is the heart of the microcontroller, It is the CPU that will Read the program from the FLASH memory and execute it by interacting with the different peripherals discussed above. Figure 1.2.B shows the pin configuration of the 89S52, where the function of each pin is written next to it, and, if it exists, the dual function is written between brackets. The pins are written in the same order as in the block diagram of figure 1.2.A, except for the VCC and GND pins which I usually note at the top and the bottom of any device.

Note that the pin that have dual functions, can still be used normally as an

input/output pin. Unless you program uses their dual functions, All the 32 I/O pins of the microcontroller are configured as input/output pins.

FIG. COUNTDOWN TIMER

Most of the function of the pins of the 89S52 microcontroller will be discussed in detail, except for the pins required to control an external memory, which are the pins number 29, 30 and 31. Since we are not going to use any external memory, pins 29 and 30 will be ignored through all the report, and pin 31 (EA) always connected to VCC (5 Volts) to enable the micro-controller to use the internal on chip memory rather than an external one (connecting the pin 31 to ground would indicate to the microcontroller that an external memory is to be used instead of the internal one).

MEMORY ORGANISATION

A RAM stands for Random Access Memory, it has basically the same purpose of the RAM in a desktop computer, which is to store some data required during the execution time of different programs. While an EEPROM, also called FLASH memory is a more elaborated ROM (Read Only Memory) which is the

memory where the program being executed is stored. Even if that's not exactly true, you can compare an EEPROM to the Hard-Disk of a desktop computer from a general point of view. The EEPROM term stands for Electronically Erasable and Programmable Read Only Memory.

In microcontrollers, like in any digital system, memory is organized in Registers, Which is the basic unit of construction of a memory. Each register is composed of a number of bits (usually 8) where the data can be stored. In the 8051 family of microcontrollers for example, most registers are 8-bit register, capable of storing values ranging from 0 to 255. In order to use bigger values, various register can be used simultaneously. Figure 1.3.A shows a typical 8-bit registers, where the notation D0 to D7 stands for the 8 DATA bits of the register. As you shall see, the RAM memory of the 89S52, which contains 256 registers, is divided into two main parts, the GPR part, and the SFR part. GPR stands for 'General Purpose Register' and are the registers that you can use to store any data during the execution of your program. SFRs (Special function Register) are registers used to control the functioning of the microcontroller and to assist the processor through the various operations being executed. For example, SFRs can be used to control Input/output lines, to retrieve data transmitted through the serial port of a desktop computer, or to configure one of the on-chip counters and timers. In a memory each register has a specific address which is used by the processor to read and write from specific memory location. Figure 1.3.B shows the memory organization of the 256 registers of the RAM of the 89S52 microcontroller. The address is noted in Hexadecimal format as this notation Typical register D7 D6 D5 D4 D3 D2 D1 D0 Figure 1.3.A

simplifies digital logic calculations for the designers, 00 corresponds to the first location and FF which is equal to 256 corresponds to the last location.

CLOCK CONCEPT

The clock concept is found in all modern digital electronics, it is a simple circuit that will generate pulses of electricity at a very specific frequency. Those pulses will cadence all the events happening inside a microcontroller, those pulses will also assure the synchronization of the events between various components inside the microcontroller. For example, if the CPU is waiting for some result of mathematical operation from the ALU (Arithmetic and Logic Unit), it will be known - according to very specific protocol - when and where the resulting data will be delivered to the CPU. The synchronization of those two devices is maintained because they share the same clock.

The clock has another very important role which is to enable the microcontroller to count timing, without a precise clock, it would be impossible to build a 'Real Time System', or any other device that relies on time measurements. It can be deduced that the precision of the timing of a microcontroller depends on the frequency of its clock.

In the 89S52 microcontroller, the clock can be fixed to different value by connecting a crystal to the pins 18 and 19. Those crystals are sold with the frequency written on them in Mega Hertz. The maximum operating frequency

of the AT89S52 is 33Mhz, however other manufacturers like PHILIPS built similar 8051 microcontrollers that can run at frequencies up to 120 Mhz.

Life cycle of a microcontroller project


Before passing to the next part of the report, it is important to have a general idea of the steps that are followed to realize a project, from the very beginning when you get an idea to the very end when you finalize your project. As you can see in figure 1.5.A, after you settle on the choice of your project in the 'brain storming' part, its imperative to imagine how it can be implemented from the hardware point of view, before passing to the programming phase, because programming is much more flexible than the hardware design. In other words, you start by designing the hardware, then you work on the programming while taking in consideration the eventual constraints imposed by the hardware design.

Fig 1.5.A

The hardware design includes all the aspects of the electronic connections between other devices, like the compatibility of the voltage levels, or the required number of pins, etc...

After you're done with a first version of your program, you can transfer it to the microcontroller mounted on the board that you realized already, resulting in a first prototype. The transfer of the code is done using a special device called 'burner' or 'programmer' that connect to the computer, reads the HEX file generated by the compiler, and sends it to the 'program memory' of the microcontroller. The prototype will be used to test your project, correct eventual errors and enhance its performance, tacking in account the famous rule that states that any project never works the first time, at least it does not work as you expected! Your project will always stay in the prototyping cycle, even if you decide that it is functioning correctly, simply because perfect machines or inventions do not exist, so there is always some room for little changes and updates.

I/O port detailed structure


It is important to have some basic notions about the structure of an I/O port in the 8051 architecture. You will notice along this report how this will affect our choices when it comes to connect I/O devices to the ports. Actually, the I/O ports configuration and mechanism of the 8051 can be confusing, due to the fact that a pin acts as an output pin as well as an input pin in the same time. Figure 3.1.A shows the internal diagram of a single I/O pin of port 1. The first thing you have to notice is that there are tow different direction for the data flow from the microcontroller's processor and the external pin: The Latch value and the Pin value. The latch value is the value that the microcontroller tries to output on the pin, whiles the pin value, is the actual logic state of the pin, regardless of the latch value that was set by the processor in the first place. The microcontroller reads the state of a pin through the Pin value line, and writes through the latch value line. If you imagine the behavior of the simple circuit in figure 3.1.A, you'll notice that the I/O pin should follow the voltage of the Latch value, providing 5V through the pull-up resistor, or 0V by connecting the pin directly to the GND through the transistor.

Figure 3.1.A

When the pin is pulled high by the pull-up resistor, the pin can output 5V but can also be used as an input pin, because there is no any risk of short-circuit due to the presence of a resistor. This can be easily verified by connecting the pin to 0V or to 5V, the tow possible outcomes are both un harmful for the microcontroller, and the PIN value line will easily follow the value imposed by the external connection.

Now imagine the opposite configuration, where the latch value would be low, causing the pin to provide 0V, being directly connected to GND through the transistor. If in this situation, an external device tries to raise the pin's voltage to 5V, a short circuit will occur and some damage may be made to the microcontroller's port or to the external device connected to that pin.

To summarize, in the 8051 architecture, to use a PIN as an input pin, you have to output '1', and the pin value will follow the value imposed by the device connected to it (switch, sensor, etc...). If you plan to use the pin as an output pin, then just output the required value without taking any of this in consideration. Even if some ports like P3 and P0 can have a slightly different internal composition than P1, due to the dual functions they assure, understanding the structure and functioning of port 1 as described above is fairly enough to use all the ports for basic I/O operations.

Introduction to 89S52 Peripherals


Figure 4.1 below shows a simplified diagram of the main peripherals present in the 89S52 and their interaction with the CPU and with the external I/O pins. You can notice that there are 3 timers/Counters. We use the expression "Timer/Counter" because this unit can be a counter when it counts external pulses on it's corresponding pin, and it can be a timer when it counts the pulses provided by the main clock oscillator of the microcontroller. Timer/Counter 2 is a special counter, that does not behave like the tow others, because it have a

couple

of

extra

functionality.

The serial port, using a UART (Universal Asynchronous Receive Transmit) protocol can be used in a wide range of communication applications. With the UART provided in the 89S52 you can easily communicate with a serial port equipped computer, as well as communicate with another microcontroller. This last application, called Multi-processor communication, is quite interesting, and can be easily implemented with 2 89S52 microcontrollers to build a very powerful multi-processor controllers.

If all the peripherals described above can generate interrupt signals in the CPU according to some specific events, it can be useful to generate an interrupt signal from an external device, that may be a sensor or a Digital to Analog converter. For that purpose there are 2 External Interrupt sources (INT0 and INT1).

Figure 4.1: 89s52 Peripherals

This was a presentation of the available peripheral features in a 89S52 microcontroller. Through this report, we are going to study how to setup and use external interrupts and the 2 standard timers (T0 and T1). For simplicity, and to keep this report, a quick and straight forward one, The UART and the Timer/Counter 2 shall be discussed in separate parts.

External Interrupts
Let's start with the simplest peripheral which is the external interrupt, which can be used to cause interruptions on external events (a pin changing its state from 0 to 1 or vice-versa). Interruption is a mean of stopping the flow of a program, as a response to a certain event, to execute a small program called 'interrupt routine'.

As we noticed in figure 4.1, in the 89S52, there are two external interrupt sources, one connected to the pin P3.2 and the other to P3.3. They are configured using a number of SFRs (Special Function Registers). Most of those SFRs are shared by other peripherals as you shall see in the rest of the part.
The IE register

Figure 4.2.A: IE Register

The first register we have to configure (by turning On or Off the right bits) is the IE register, shown in figure 4.2.A. IE stands for 'Interrupt Enable', and it

is used to allow different peripherals to cause software interruption. To use any of the interrupts, the bit EA (Enable ALL) must be set to 1, then, you have enable each one of the interrupts to be used with its individual enable bit. For the external interrupts, the two bits EX0 and EX1 are used for External Interrupt 0 and External Interrupt 1. The rest of the bits of IE register are used for other interrupt sources like the 3 timers overflow (ETx) and the serial interface (ES).

The TCON register

figure 4.2.B: TCON Register

Similarly, you have to set the bits IT0 and IT1 in the TCON register, shown in figure 4.2.B. The bits IT0/IT1 are used to configure the type of signal on the corresponding pins (P3.2/P3.3) that generated an interrupt according to the following table:
IT0/IT1 = 1 IT0/IT1 = 0 External interrupt caused by a falling edge signal on P3.2/P3.3 External interrupt caused by a low level signal on P3.2/P3.3

If IT0 or IT1 is set to 0, an interruption will keep reoccurring as long as P3.2 or P3.3 is set to 0. This mode isn't easy to mange, and most programmers tends to use external interrupts triggered by a falling edge (transition from 1 to 0).

Timer/Counter
The timer is a very interesting peripheral, that is imperatively present in every microcontroller. It can be used in tow distinct modes:

Timer: Counting internal clock pulses, which are fixed with time, hence, we can say that it is very precise timer, whose resolution depends on the frequency of the main CPU clock (note that CPU clock equals the crystal frequency over 12). Counter: Counting external pulses (on the corresponding I/O pin), which can be provided by a rotational encoder, an IR-barrier sensor, or any device that provide pulses, whose number would be of some interest.

Sure, the CPU of a microcontroller could provide the required timing or counting, but the timer/counter peripheral relieves the CPU from that redundant and repetitive task, allowing it to allocate maximum processing power for more complex calculations.

So, like any other peripheral, a Timer/Counter can ask for an interruption of the program, which - if enabled - occurs when the counting registers of the Timer/Counter are full and overflow. More precisely, the interruption will occur at the same time the counting register will be reinitialized to its initial value.

INTRODUCTION TO THE PROJECT

MICROCONTROLLER MODULE SNAPSHOT

COMPONENT DESCRIPTION OF 8051 MODULE

S.no 1. 2. 3. 4. 5. 6. 7. 8.

Component Description Resistance Led Diode IC Crystal Oscillator DC Jack 12 V supply Switch Electolytic Capacitor 1000f (1)

Quantity 1 1 4 1 1 1 1 2

9. 10.

10f(1) Port Connectors(each of 8 4 pin) Pin Connector 11

11.

Microcontroller AT89S52

Diode
The PN Junction and the Diode Effect

Light-Emitting Diodes

Light-emitting diodes (LED) emit light in proportion to the forward current through the diode. LEDs are low voltage devices that have a longer life than incandescent lamps. They respond quickly to changes in current (10 MHz). LEDs have applications in optical-fiber communication and diode lasers. They produce a narrow spectrum of coherent red or infrared light that can be well collimated. As an electron in the conduction band recombines with a hole in the valence band, the electron makes a

transition to a lower-lying energy state and releases energy in an amount equal to the band-gap energy. Normally the energy heats the material. In an LED this energy goes into emitted infrared or visible light.

Light-Sensitive Diodes
If light of the proper wavelength is incident on the depletion region of a diode while a reverse voltage is applied, the absorbed photons can produce additional electron-hole pairs. Photo-diodes or photocells signals. can receive and

frequency-modulated

light

LEDs

photodiodes are often used in optica

Resistor
A resistor is an electrical component that limits or regulates the flow of electrical current in an electronic circuit. Resistors can also be used to provide a specific voltage for an active device such as a transistor.

All other factors being equal, in a direct-current (DC) circuit, the current through a resistor is inversely proportional to its resistance, and directly proportional to the voltage across it. This is the well-known Ohm's Law. In alternating-current (AC) circuits, this rule also applies as long as the resistor does not contain inductance or capacitance. Resistors can be fabricated in a variety of ways. The most common type in electronic devices and systems is the carboncomposition resistor. Fine granulated carbon (graphite) is mixed with clay and hardened. The resistance depends on the proportion of carbon to clay; the higher this ratio, the lower the resistance. Another type of resistor is made from winding Nichrome or similar wire on an insulating form. This component, called a wirewound resistor, is able to handle higher currents than a carbon-composition resistor of the same physical size. However, because the wire is wound into a coil, the component acts as an inductors as well as exhibiting resistance. This does not affect performance in DC circuits, but can have an adverse effect in AC circuits because

inductance renders the device sensitive to changes in frequency.

RESISTOR COLOUR CODE

CAPACITOR

A capacitor is a passive electronic component that stores energy in the form of an electrostatic field. In its simplest form, a capacitor consists of two conducting plates separated by an insulating material called the dielectric. The capacitance is directly proportional to the surface areas of the plates, and is inversely proportional to the separation between the plates. Capacitance also depends on the dielectric constant of the substance separating the plates. The standard unit of capacitance is the farad, abbreviated F. This is a large unit; more common units are the microfarad, abbreviated F (1 F =10-6F) and the pico farad, abbreviated pF (1 pF = 10-12 F). Capacitors can be fabricated onto integrated circuit (IC)chips. They are commonly used in conjunction with transistors in dynamic random access memory (DRAM). The capacitors help maintain the contents of memory. Because of their tiny physical size, these components have low capacitance. They must be recharged thousands of times per second or the DRAM will lose its data.

Large capacitors are used in the power supplies of electronic equipment of all types, including computers and their peripherals. In these systems, the capacitors smooth out the rectified utility AC, providing pure, battery-like DC.

COLOUR CODING OF CAPACITORS


COLOR CODES FOR CAPACITORS Although the capacitance value may be printed on the body of a capacitor, it may also be indicated by a color code. The color code used to represent capacitance values is similar to that used to represent resistance values. The color codes currently in use are the Joint Army-Navy (JAN) code and the Radio Manufacturers' Association (RMA) code. For each of these codes, colored dots or bands are used to indicate the value of the capacitor. A mica capacitor, it should be noted, may be marked with either three dots or six dots. Both the three- and the six-dot codes are similar, but the sixdot code contains more information about electrical ratings of

the capacitor, such as working voltage and temperature coefficient. The capacitor shown in figure 3-21 represents either a mica capacitor or a molded paper capacitor. To determine the type and value of the capacitor, hold the capacitor so that the three arrows point left to right (>). The first dot at the base of the arrow sequence (the left-most dot) represents the capacitor TYPE. This dot is either black, white, silver, or the same color as the capacitor body. Mica is represented by a black or white dot and paper by a silver dot or dot having the same color as the body of the capacitor. The two dots to the immediate right of the type dot indicate the first and second digits of the capacitance value. The dot at the bottom right represents the multiplier to be used. The multiplier represents pico farads. The dot in the bottom center indicates the tolerance value of the capacitor.

A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.[1] The idea of the seven-segment display is quite old. In 1910, for example, a seven-segment display illuminated by incandescent bulbs was used on a power-plant boiler room signal panel A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the arabic numerals. Often the seven segments are arranged in an oblique (slanted) arrangement, which aids readability. In most applications, the seven segments are of nearly uniform shape and size (usually elongated hexagons, though trapezoids and rectangles can also be used), though in the case of adding machines, the vertical segments are longer and more oddly shaped at the ends in an effort to further enhance readability. Each of the numbers 0, 6, 7 and 9 may be represented by two or more different glyphs on seven-segment displays.

LED-based 7-segment display showing the 16 hex digits.

The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment

bisects the rectangle horizontally. There are also fourteen-segment displays and sixteensegment displays (for full alphanumerics); however, these have mostly been replaced by dotmatrix displays. The segments of a 7-segment display are referred to by the letters A to G, as shown to the right, where the optional DP decimal point (an "eighth segment") is used for the display of non-integer numbers. The animation to the left cycles through the common glyphs of the ten decimal numerals and the six hexadecimal "letter digits" (AF). It is an image sequence of a "LED" display, which is described technology-wise in the following section. Notice the variation between uppercase and lowercase letters for AF; this is done to obtain a unique, unambiguous shape for each letter (otherwise, a capital D would look identical to an 0 (or less likely O) and a capital B would look identical to an 8 Seven-segment displays may use a liquid crystal display (LCD), arrays of light-emitting diodes (LEDs), or other light-generating or controlling techniques such as cold cathode gas discharge, vacuum fluorescent, incandescent filaments, and others. For gasoline price totems and other large signs, vane displays made up of electromagnetically flipped light-reflecting segments (or "vanes") are still commonly used. An alternative to the 7-segment display in the 1950s through the 1970s was the cold-cathode, neon-lamp-like nixie tube. Starting in 1970, RCA sold a display device known as the Numitron that used incandescent filaments arranged into a seven-segment display. [3] In a simple LED package, typically all of the cathodes (negative terminals) or all of the anodes (positive terminals) of the segment LEDs are connected together and brought out to a common pin; this is referred to as a "common cathode" or "common anode" device. Hence a 7 segment plus decimal point package will only require nine pins (though commercial products typically contain more pins, and/or spaces where pins would go, in order to match industry standard pinouts). Integrated displays also exist, with single or multiple digits. Some of these integrated displays incorporate their own internal decoder, though most do not each individual LED is brought out to a connecting pin as described. Multiple-digit LED displays as used in pocket calculators and similar devices used multiplexed displays to reduce the number of IC pins

required to control the display. For example, all the anodes of the A segments of each digit position would be connected together and to a driver pin, while the cathodes of all segments for each digit would be connected. To operate any particular segment of any digit, the controlling integrated circuit would turn on the cathode driver for the selected digit, and the anode drivers for the desired segments; then after a short blanking interval the next digit would be selected and new segments lit, in a sequential fashion. In this manner an eight digit display with seven segments and a decimal point would require only 8 cathode drivers and 8 anode drivers, instead of sixty-four drivers and IC pins. Often in pocket calculators the digit drive lines would be used to scan the keyboard as well, providing further savings; however, pressing multiple keys at once would produce odd results on the multiplexed display. Seven segment displays can be found in patents as early as 1908 (in U.S. Patent 974,943, F W Wood invented an 8-segment display, which displayed the number 4 using a diagonal bar), but did not achieve widespread use until the advent of LEDs in the 1970s. They are sometimes even used in unsophisticated displays like cardboard "For sale" signs, where the user either applies color to pre-printed segments, or (spray)paints color through a sevensegment digit template, to compose figures such as product prices or telephone numbers. For many applications, dot-matrix LCDs have largely superseded LED displays, though even in LCDs 7-segment displays are very common. Unlike LEDs, the shapes of elements in an LCD panel are arbitrary since they are formed on the display by a kind of printing process. In contrast, the shapes of LED segments tend to be simple rectangles, reflecting the fact that they have to be physically moulded to shape, which makes it difficult to form more complex shapes than the segments of 7-segment displays. However, the high common recognition factor of 7-segment displays, and the comparatively high visual contrast obtained by such displays relative to dot-matrix digits, makes seven-segment multiple-digit LCD screens very

SOFTWARE STRUCTURE

1. File 1 is a .ASM file and is the file in which you have written your program. 2. File 2 is a .HEX file 3. File 3 is a shortcut to the .ASM file 4. File 4 is a .LST which contains all the commands, important definitions of the labels and the addresses of each command.

How to transfer the generated HEX file in the Controller: 1. Connect the 8051 development kit to the PC with the help of USB cable provided with the kit. Now open another icon named PLC_8051 to load the HEX file. The following window will appear. Select the chip used in the programmer.

2.

Now open the source file from the folder in which you have saved the written program in the .HEX format. After loading the HEX file the program is transferred to the controller through the USB cable. The following window will appear during program transferring and completion of the transfer process.

The process of writing the program in the CONTROLLER is done successfully.

PROGRAM

REFERENCES
BOOKS:

8051 MICROCONTROLLER AND EMBEDDED SYSTEMS BY MUHAMMAD ALI MAZIDI AND JANICE GILLISPIE MAZIDI

EXTERNAL:

www.ikalogic.com www.8051tutorials.com

You might also like