You are on page 1of 49

CHAPTER-1

INTRODUCTION TO OUR PROJECT

1.1. INTRODUCTION
Electronics Voting Machine is advanced voting system instead of manual voting. There is
no security arrangement in the manual voting. Voting process used in many purposes like
election, employee etc. Security is a prime concern in our day-to-day life. Everyone wants
to be as much secure as possible in voting. The Microcontroller based Voting Machine
system overcome that problem as well as provide the security for accurate voting. In our
Project we have LCD, power supply, Microcontroller etc. The system is fully controlled by
the 8 bit microcontroller AT89S52 which has an 8Kbytes of ROM for the program memory.

The Microcontroller will continuously monitors all the input users and two switches gives
commands to the controller taking input from the user and declare the result respectively.
LCD is used to display the result.
1. Election Transparency: all the processes of handling and counting ballots to be
completely open to public view. Nothing to be hidden or secret except, of course, each
individual's voting choices.
2. Trust of the voter in the EVM registering the vote : We plan to implement voter
verifiable paper record (VVPR) to which voter can look up instantly and decide on whether
the vote he casted is registered correctly in the system increasing the reliability of the
system.
We have made a module which interfaces with the voter and directs to the procedure of
voting. The Liquid Crystal Display unit provides the voter friendly interface guiding
through the procedure of voting. The keypad is used to enter the details and other actions to
be taken by the voter, which are integrated with the display unit.
We learnt a lot many aspects of design and especially SD card interfacing is the most
interesting part. Also the product can be used for several types of elections not only just the
State or Assembly Elections.

Fig 1.1 Hardware Design

1
1.2. MODULAR DISCRIPTION OF THE PROJECT
Our project is electronic voting machine. It consists of three main units:
Microcontroller(AT89S52)
Liquid crystal display
Power supply

1.2.1. MICROCONTROLLER (AT89S52)


The AT89S52 is a low power, is performance CMOS 8-bit microcontroller with 8k bytes of
in-system programmable flash memory. This device is manufactured using Atmels high-
density non volatile memory technology. Microcontroller AT89S52 works as per
instructions given to it. This is the central processing unit of our project. The
microcontroller takes the inputs and according to the program stored in its memory it give
us output.

1.2.2. LIQUID CRYSTAL DISPLAY


A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light
modulating properties of liquid crystals(LCs). LCs does not emit light directly. LCDs
therefore need a light source and are classified as passive display.

1.2.3. POWER SUPPLY


Almost all electronic circuit required DC power supply. DC power supply is a circuit which
converts the ac waveform of power line to direct voltage of constant amplitude. An ideal
regulated power supply is designed to provide a pre-determined dc voltage which is
independent of the current drawn from the source.

2
1.3. BLOCK DIAGRAM OF PROJECT

Fig 1.2 Block diagram of project

3
CHAPTER-2
PROJECT CIRCUIT DIAGRAM

2.1. CIRCUIT DIAGRAM OF PROJECT

Fig 2.1 Circuit diagram of project

4
CHAPTER-3
DETAILED DISCRIPTION OF PROJECT

3.1. GENERAL INTODUCTION:


A microcontroller (C) is a computer on a chip. It is a type of microprocessor emphasizing
high integration, low power consumption, self-sufficiency and cost-effectiveness, in
contrast to a general-purpose microprocessor. In addition to the usual arithmetic and logic
elements of a general purpose microprocessor, the microcontroller typically integrates
additional elements such as read-write memory for data storage, read-only memory, such as
flash for code storage, EEPROM for permanent data storage, peripheral devices, and
input/output interfaces... Power consumption while sleeping may be just nano watts,
making them ideal for low power and long lasting battery applications.
Microcontrollers are frequently used in automatically controlled products and devices, such
as automobile engine control systems, remote controls, office machines, appliances, power
tools, and toys.

3.1.1. KEY FEATURES OF MICROCONTROLLER


8 bit microcontroller.
RAM expandable externally to 64 Kbytes.
Supports both ISP & parallel programming.
IAP (In Application Programming).
5V operating voltage from 0 to 40 MHz
PCA (Programmable Counter Array) with PWM and capture/compare functions.
Four 8-bit I/O ports.
Two 16-bit timers/counters.
8 interrupt sources with 4 priority levels.
TTL and CMOS compatible logic levels.
Full-duplex enhanced UART.
8 bit stack pointer.

5
3.1.2. PIN DIAGRAM OF MICROCONTROLLER

Fig 3.1 Pin diagram of microcontroller

6
3.1.3. Pin Description
Vcc (Pin 40)
Provides voltage to the chip +5V
GND (Pin 20)
Ground
XTAL1 (Pin 19) and XTAL2 (Pin 18)
Crystal oscillator connected to pins 18,19. Two capacitors of 30 pf value. Time for
machine cycle: 11.0592/12=1.085 sec
RST (Pin 9)
RESET Pin
a) Active high: On applying a high pulse to this pin microcontroller will reset and
terminate all activities
b) INPUT pin
c) Minimum to machine cycles required to make RESET
External Access: EA 31
Connected to VCC for on chip ROM
Connected to Ground for external ROM containing the code input pin
Program Store Enable: PSEN 29
Output pin
In case of external ROM with code it is connected to the OE pin of the ROM
Address Latch Enable: ALE 30
Output pin, Active high
In case of external ROM, ALE is used to de multiplex (PORT 0) the address and data
bus by connecting to the G pin of 74LS373 chip
I/O ports pins and their Functions:
Four ports P0, P1,P2,P3 with 8 pins each, making a total of 32 input/output pins
On RESET all ports are configured as output. They need to be programmed to make
them function as inputs
PORT 0
Pins 32-39
Can be used as both input and output
External pull up resistors of 10K need to be connected
Dual role: 8051 multiplexes address and data through port 0 to save pins. AD0-AD7
ALE is used to de multiplex data and address bus
PORT 1
Pins 1 through 8
Both input and output
No dual function
Internal pull up resistors
PORT 2
7
Pins 21 through 28
No pull up resistors required
Both input and output
Dual function: Along with port 0 used to provide the 16-bit address for external
memory. It provides higher address A8-A16

PORT 3
Pins 10 through 17
No external pull up resistors required

3.1.4. BLOCK DIAGRAM OF MICROCONTROLLER

Fig 3.2 Block Diagram of Microcontroller

The AT89S52 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes


of Downloadable Flash programmable and erasable read only memory and 2K bytes of
EEPROM. The device is manufactured using Atmels high density nonvolatile memory
technology and is compatible with the industry standard 80C51 instruction set and pinout.
The on-chip Downloadable Flash allows the program memory to be reprogrammed in-
system through an SPI serial interface or by a conventional nonvolatile memory
programmer. By combining a versatile 8-bit CPU with Downloadable Flash on a monolithic
chip, the Atmel AT89S52 is a powerful microcomputer which provides a highly flexible
and cost effective solution to many embedded control applications.
8
3.2. LIQUID CRYSTAL DISPLAY:
A liquid crystal display (LCD) is a thin, flat electronic visual display that uses the light
modulating properties of liquid crystals (LCs). LCs does not emit light directly. LCDs
therefore need a light source and are classified as "passive" displays. Some types can use
ambient light such as sunlight or room lighting. There are many types of LCDs that are
designed for both special and general uses. They can be optimized for static text, detailed
still images, or dynamic, fast-changing, video content.
They are used in a wide range of applications including: computer monitors, television,
instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer
devices such as video players, gaming devices, clocks, watches, calculators, and
telephones. LCDs have displaced cathode ray tube (CRT) displays in most applications.
They are usually more compact, lightweight, portable, and lower cost. They are available in
a wider range of screen sizes than CRT and other flat panel displays.
LCDs are more energy efficient, and offer safer disposal, than CRTs. Its low electrical
power consumption enables it to be used in battery-powered electronic equipment. It is an
electronically-modulated optical device made up of any number of pixels filled with liquid
crystals and arrayed in front of a light source (backlight) or reflector to produce images in
color or monochrome.

Fig 3.3. LCD

9
3.2.1 PIN DESCRIPTION TABLE:

Pin Symbol Description

1 VSS Ground

2 VCC +5V power supply

3 VEE Power supply to control contrast

4 RS RS = 0 to select command register

RS = 1 to select data register

5 R/W R/W = 0 for write

R/W = 1 for read

6 E Enable

7 DB0 The 8-bit data bus

8 DB1 The 8-bit data bus

9 DB2 The 8-bit data bus


Table 3.1 Pin
description 10 DB3 The 8-bit data bus of LCD
11 DB4 The 8-bit data bus
Vcc, Vss and Vee:
12 DB5 The 8-bit data bus
While VCC and VSS
provide +5V 13 DB6 The 8-bit data bus and ground,
respectively, VEE is used
for 14 DB7 The 8-bit data bus controlling
LCD contrast.

RS(Register select):

There are two very important registers inside the LCD. The RS pin is used for their
selection. If RS = 0, the instruction/command code register is selected, allowing the user to
send a command such as clear display, cursor at home, etc. If RS = 1 the data register is
selected, allowing the user to send data to be displayed on the LCD.

10
R/W(Read/Write):

R/W input allows the user to write information to the LCD or read information from it.
R/W = 1 when reading; R/W = 0 when writing.

E(Enable):

The enable pin is used by the LCD to latch information presented to its data pins. When
data is supplied to data pins, a high-to-low pulse must be applied to this pin in order for the
LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns
wide.

Data pins (D0-D7):

The 8-bit data pins, D0 - D7, are used to send information to the LCD or read the contents
of the LCD's internal registers. To display letters and numbers, we send ASCII codes for
the letters A - Z, a - z, and numbers 0 - 9 to these pins while making RS = 1.

There are also instruction command codes that can be sent to the LCD to clear the display
or force the cursor to the home position or blink the cursor.

We also use RS = 0 to check the busy flag bit to see if the LCD is ready to receive
information. The busy flag is D7 and can be read when R/W = 1 and RS = 0; if R/W= 1, RS
= 0. When D7 = 1 (busy flag = 1), the LCD is busy taking care of internal operations and
will not accept any new information. When D7 = 0, the LCD is ready to receive new
information. It is recommended to check the busy flag before writing any data to the LCD.

3.3. POWER SUPPLY:


3.3.1. Summary of circuit features

Brief description of operation: Gives out well regulated +5V output, output current
capability of 100 mA

Circuit protection: Built-in overheating protection shuts down output when


regulator IC gets too hot

Circuit complexity: Very simple and easy to build

Circuit performance: Very stable +5V output voltage, reliable operation

11
Availability of components: Easy to get, uses only very common basic components

Design testing: Based on datasheet example circuit, I have used this circuit
successfully as part of many electronics projects

Applications: Part of electronics devices, small laboratory power supply

Power supply voltage: Unregulated DC 8-18V power supply

Power supply current: Needed output current + 5 mA

3.3.2. INTRODUCTION
The +5 volt supply is useful for both analog and digital circuits. DTL, TTL, and CMOS ICs
will all operate nicely from a +5 volt supply. In addition, the +5 volt supply is useful for
circuits that use both analog and digital signals in various ways. More importantly for our
purposes, the +5 volt supply will be used as the primary reference for regulating all of the
other power supplies the we will build. We can do this very easily if we use operational
amplifiers as the controlling elements in the power supply circuits. We'll see how this
works after completing the basic +5 volt supply.

3.3.3. CIRCUIT DIAGRAM

Fig 3.4 Circuit diagram of Power Supply


The +5 volt power supply is based on the commercial 7805 voltage regulator IC. This IC
contains all the circuitry needed to accept any input voltage from 8 to 18 volts and produce
a steady +5 volt output, accurate to within 5% (0.25 volt). It also contains current-limiting
circuitry and thermal overload protection, so that the IC won't be damaged in case of
excessive load current; it will reduce its output voltage instead.

The 1000f capacitor serves as a "reservoir" which maintains a reasonable input voltage to
the 7805 throughout the entire cycle of the ac line voltage. The two rectifier diodes keep
12
recharging the reservoir capacitor on alternate half-cycles of the line voltage, and the
capacitor is quite capable of sustaining any reasonable load in between charging pulses.

The 10f and .01f capacitors serve to help keep the power supply output voltage constant
when load conditions change. The electrolytic capacitor smooths out any long-term or low
frequency variations. However, at high frequencies this capacitor is not very efficient.
Therefore, the .01f is included to bypass high-frequency changes, such as digital IC
switching effects, to ground.

The LED and its series resistor serve as a pilot light to indicate when the power supply is
on. I like to use a miniature LED here, so it will serve that function without being obtrusive
or distracting while I'm performing an experiment. I also use this LED to tell me when the
reservoir capacitor is completely discharged after power is turned off. Then I know it's safe
to remove or install components for the next experiment.

3.4. TRANSFORMER

A transformer is an electrical device that transfers energy between two circuits


through electromagnetic induction. A transformer may be used as a safe and
efficient voltage converter to change the AC voltage at its input to a higher or lower voltage
at its output. Other uses include current conversion, isolation with or without changing
voltage and impedance conversion.

Fig 3.5 Transformer

13
3.4.1 Basic Principal of Transformer:

The operation of a transformer is based on two principles of the laws of electromagnetic


induction: An electric current through a conductor, produces a magnetic field surrounding
the conductor, and a changing magnetic field in the vicinity of a conductor induces a
voltage across the ends of that conductor.

Fig 3.6 Basic principle of transformer

The ideal transformer induces secondary voltage VS as a proportion of the primary


voltage VP and respective winding turns as given by the equation

where,

a is the winding turns ratio, the value of these ratios being respectively higher and
lower than unity for step-down and step-up transformers,
VP designates source impressed voltage,
3.5. Diode:
A diode is a specialized electronic component with two electrodes called the anode and the
cathode. Most diodes are made with semiconductor materials such as silicon, germanium,
or selenium. Some diodes are comprised of metal electrodes in a chamber evacuated or
filled with a pure elemental gas at low pressure. Diodes can be used as rectifiers, signal
limiters, voltage regulators, switches, signal modulators, signal mixers, signal
demodulators, and oscillators.

14
Fig 3.7 Diode

The fundamental property of a diode is its tendency to conduct electric current in only one
direction. When the cathode is negatively charged relative to the anode at a voltage greater
than a certain minimum called forward break over, then current flows through the diode. If
the cathode is positive with respect to the anode, is at the same voltage as the anode, or is
negative by an amount less than the forward break over voltage, then the diode does not
conduct current. This is a simplistic view, but is true for diodes operating as rectifiers,
switches, and limiters. The forward break over voltage is approximately six tenths of a volt
(0.6 V) for silicon devices, 0.3 V for germanium devices, and 1 V for selenium devices.

3.6. Regulator:
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not
give the fixed voltage output.

Fig 3.8 Regulator


15
The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx
indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated
power supply. Capacitors of suitable values can be connected at input and output pins
depending upon the respective voltage levels.

CHAPTER-4

COMPONENTS

4.1 LIST OF COMPONENTS

S. No. Name of component Quantity

1. Microcontroller (AT89S52) 1

2. Crystal (11.592MHZ) 1

3. PCB 1

4. Capacitor 10f,0.1f,330f 5

5. Resistor 1K, 10 K 2

6. Switches 7

7. Diode (IN 4001) 4

8. IC7805 voltage regulator 1

9. Transformer (9v-0v-9v) 1

10. Ply board 1

16
11. Wires 1

12. LED 1

13. Soldering wire 1

14. Soldering iron 1

Table 4.1 List of components

17
4.2. DISCRIPTION OF COMPONENTS
4.2.1. DIODE:
A Diode is a semiconductor device which allows current to flow through it in only one
direction. Although a transistor is a semiconductor device, it does not operate the way a
diode does. A diode is specially made to allow current to flow through it only one direction.
Some ways in which the diode can be used are listed here.
A diode can be used as a rectifier that converts AC(Alternating Current) to DC.
Direct Current for a power supply.
Diodes can be used to separate the signals from radio frequencies.
Diode can be used as an ON/OFF switch that controls current.
When the small voltage is applied to the diode in the forward direction, current flows
easily. Because the diode has a certain amount of resistance, the voltage will drop slightly
as current flows through the diode. A typical diode causes a voltage drop of about 0.6-1
volt(VF).This voltage drop need to be taken into consideration in a circuit which uses many
diodes in series. Also, the amount of current passing through the diode must be considered.

When voltage is applied in the reverse direction through a diode, the diode will have a great
resistance to current flow. Different diodes have different characteristics when reverse
biased. Diode should be selected depending on how it will be used in the circuit. The
current that will flow through a diode biased in the reversed direction will vary from
several mA to just A, which is very small. The limiting voltages and currents permissible
must be considered on a case by case basis.

4.2.2 LIGHT EMMITING DIODE


Light emitting diodes must be chosen according to hoe they will be used, because they are
various kinds. The diodes are available in several colors.

18
Fig 4.1 LEDs
The most common colors are red and green, but there are even blue ones. The device on the
LED one side is for the green, other side is for red LED. When both are turned on
simultaneously, it becomes orange. When an LED is new out of the package, the polarity of
the device can be determine by looking at the leads. The longer lead is anode side, and the
short one is cathode side. The polarity of an LED can also be determine by using a
resistance meter, or even a 1.5v battery. When using a test meter to determine polarity, set
the meter to a low resistance measurement range. Connect the probes of the meter to LED.
If the polarity is correct, the LED will glow. If the LED does not glow, switch the meter
probes to the opposite leads on the LED. The voltage drop of an LED is comparatively
stable at just about 2v.

4.2.3. RESISTORS
Resistor
The resistors function is to reduce the flow of electric current. There are two classes of
resistor; fixed resistor and variable resistors. They are also classified according to the
material from which they are made. The typical of resistor is made up of either carbon film
or metal film. There are other types as well, but these are the most common. The resistance
value of the resistor is not the only thing to consider when selecting a resistor for use in a
circuit . The tolerance when the electrical power rating of the resistor are also important.
The tolerance of a resistor are also important. the tolerance of a resistor denotes how it is to
the rated resistance value.

Fixed Resistors
A fixed resistor is one in which the value of fixed resistance cannot change.

Carbon Film Resistor


This is the most general purpose, cheap resistor. Usually the tolerance of the resistance
value is 5%. Power rating of 1/8W, 1/4W and 1/2W are frequently used. Carbon film
resistors have a disadvantage; they tends to be electrically noisy.

Variable Resistors
There are two general ways in which variable resistors are used. One is the variable resistor
which value is easily changed, like the volume adjustment of Radio. The other is semi-fixed
resistor that is not meant to be adjusted by anyone but a technician. It is used to adjust the
operating condition of the circuit by the technician. Semi-fixed resistors are used to
compensate for the inaccuracies of the resistors,and to fine-turn a circuit. The rotation angle
of the variable resistor is usually about 300 degrees. Some variable resistors must be turned
many times to use the whole range of resistance they offer. This allows for very precise
19
adjustments of their value. These are called potentiometers or Trimmer Potentiometers.

4.2.4. CAPACITORS
The capacitors function is to store electricity, or electrical energy. The capacitor also
functions as a filter, passing alternating current (AC), and blocking direct current (DC).
This symbol F is used to indicate a capacitor in a circuit diagram. The capacitor is
constructed with two electrode plates facing each other, but separated by as insulator. When
DC voltage applied to the capacitor, an electric charge is stored on each electrode. While
the capacitor is charging up, current flows. The current will stop flowing when the
capacitor has fully charged.

Breakdown voltage
when using a capacitor, we must pay attention to the maximum voltage which can be used.
This is the breakdown voltage. The breakdown voltage depends on the kind of capacitor
being used. We must be especially careful with electrolytic capacitors because the
breakdown voltage is comparatively low. The breakdown of electrolytic capacitors is
displayed as working voltage. The breakdown voltage is the voltage that when exceeded
will cause the dielectric (insulator) inside the capacitor to break down and conduct. When
this happens, the failure can be catastrophic.

Electrolytic Capacitors(Electrochemical type Capacitors)


Aluminum is used for the electrodes by using a thin oxidization membrane.Large value of
capacitance can be obtained in comparison with the size of capacitor, because the dielectric
used is very thin. The most important characteristics of electrolyte capacitor is that they
have polarity. They have positive and negative electrode this means that it is very important
which way round they are connected.

Fig 4.2. Electolytic Capacitors

20
From the left to right:
1F (50) [ diameter 5 mm, high 12 mm] 47F (16V) [diameter 6 mm, high 5 mm]
100F (25V) [diameter 5 mm, high 11 mm]
220F (25V) [diameter 8 mm, high 12 mm]
1000F(50) [diameter 18 mm, high 40 mm]
The size of the capacitor sometimes depends on the manufacturer. So the sizes shown here
on this page are just examples.

Ceramic Capacitors
Ceramic capacitors are constructed with materials such as titanium acid barium used as the
dielectric. Internally, these capacitors are not constructed as a coil, so they can be used in
high frequency applications.

Fig 4.3 Ceramic Capacitors


Typically, they are used in circuits which bypass high frequency signals to ground. These
capacitors have a shape of disk. Their capacitance is comparatively small. The capacitor on
the left is a 100F capacitor with a diameter of about 3 mm. The capacitor on the right side
is printed with 103, so 10103pF becomes 0.01 F. The diameter of the disk is about 6 mm.
Ceramic capacitors have no polarity. Ceramic capacitors should not be used for analog
circuits, because they can distort the signal.

Variable capacitors
Variable capacitors are used for adjustment etc of frequency mainly. When adjusting the
value of a variable capacitor, it is advisable to be careful.

21
Fig 4.4 Variable capacitors
One of the components leads is connected to the adjustment screw of the capacitor. This
means that the value of capacitor is affected by the capacitance of the screw driver in our
hand. It is better to use a screw driver to adjust these components.

4.2.5. PCB (Printed circuit Board)


With the help of P.C.B it is easy to assemble circuit with neat clean products. P.C.B is made
of Bakelite with surface pasted with copper track-layout. For each components leg, hole is
made. Connection pin is passed through the hole and is soldered.

Fig 4.5 PCB (Printed circuit Board)

22
CHAPTER-5
ADVANTAGES AND APPLICATIONS

5.1. ADVANTAGES:
Low Cost
Easy to use
Used for voting purposes
Time saving

5.2. DISADVANTAGES:
Security issue is the main drawback of the electronic voting machine. The attacks
might be happened from the webpage, network, to the extent of servers database.
Inequality problem because for those people with low salary might not able to
afford the equipment for electronic voting.

5.3. APPLICATIONS:
It is used for election voting.
It is used for employee voting.

5.4. PROBLEM FACED:


During soldering, many of the connection become short circuit. So we desolder the
connection and did soldering again.
A leg of the crystal oscillator was broken during mounting. So it has to be replaced.
LEDs get damaged when we switched ON the supply so we replace it by the new
one.

5.5. TROUBLESHOOT
Care should be taken while soldering. There should be no shorting of joints.
Proper power supply should maintain.
Project should be handled with care since IC are delicate.
Component change and check again circuit.

23
24
CHAPTER- 6
CONCLUSION

We have successfully completed our project BI-DIRECTIONAL VISITOR COUNTER.


The complete working projects hardware is shown in following figure.

Fig 6.1 Hardware of complete project (OFF state)

Fig 6.2 Hardware of complete project (ON state)

25
CHAPTER-7
DATA SHEETS

7.1. MICROCONTROLLER:

26
7.2 LCD DISPLAY:

27
28
29
CHAPTER-8
PROGRAM CODE

KEIL PROGRAMING
Open Kiel from the Start menu
The Figure below shows the basic names of the windows referred in this document

30
Select New Project from the Project Menu.

Name the project Toggle.a51


Click on the Save Button.

31
The device window will be displayed.
Select the part you will be using to test with. For now we will use the Dallas
Semiconductor part at89s52.
Double Click on the Atmel Semiconductor.

32
Scroll down and select the at89s52 Part
Click OK

33
Click File Menu and select New.

A new window will open up in the Keil IDE.

34
Copy the example to the Right into the new window. This file will
toggle Ports 1 and 2 with a delay.
ORG 0H
MOV A, #55H
AGAIN:
MOV P1, A
MOV P2, A
ACALL DELAY
CPL A
SJMP AGAIN
DELAY:
MOV R3, #200
OUTER: MOV R2, #0255
INNER: DJNZ R2, INNER
DJNZ R3, OUTER
RET
END
Click on File menu and select Save

35
Name the file Toggle.a51
Click the Save Button

Expand Target 1 in the Tree Menu

36
Click on Project and select Targets, Groups, Files

Click on Groups/Add Files tab Under Available Groups select Source Group 1 Click Add

37
Expand the Source Group 1 in the Tree menu to ensure that the file was added to the project

38
Click on Target 1 in Tree menu Click on Project Menu and select Options for Target 1

39
Select Target Tab Change Xtal (Mhz) from 50.0 to 11.0592

40
Select Output Tab Click on Create Hex File check box Click OK Button

41
Click on Project Menu and select Rebuild all Target Files In the Build Window it should
report
0 Errors (s), 0 Warnings You are now ready to Program your Part

42
Comment out line ACALL DELAY by placing a Semicolon at the beginning. This will
allow you to see the port change immediately. Click on the File Menu and select Save

43
Click on Project Menu and select Rebuild all Target Files In the Build Window it should
report 0 Errors (s), 0 Warnings Click on Debug Menu and Select Start/Stop Debug
Session

44
The Keil Debugger should be now be Running.

45
Click on Peripherals. Select I/O Ports, Select Port 1

46
A new window should port will pop up. This represent the Port and
Pins

Step through the code by pressing F11 on the Keyboard. The Parallel Port 1 Box should

47
change as
you completely step through the code.

To exit out, Click on Debug Menu and Select Start/Stop Debug Session

CHAPTER-9
48
BIBLIOGRAPHY AND REFERENCES

www.alldatasheets.com

www.atmel.com

The 8051 microcontroller: KENNETH J.AYALA

The 8051 microcontroller and embedded systems: MUHAMMAD ALI


MAZIDI

E BALAGURUSAMY, programming in ANSI C, Tata McGraw Hill, May


2010.

49

You might also like