SlideShare a Scribd company logo
1 of 60
A.Manikanta & B.Prabhukiran AEC,Bhongir
1
1. INTRODUCTION TO EMBEDDED SYSTEMS
An embedded system is a special-purpose system in which the computer is completely encapsulated
by the device it controls. Unlike a general-purpose computer, such as a personal computer, an
embedded system performs pre-defined tasks, usually with very specific requirements. Since the
system is dedicated to a specific task, design engineers can optimize it, reducing the size and cost of
the product. Embedded systems are often mass-produced, so the cost savings may be multiplied by
millions of items.
Physically, embedded systems range from portable devices such as digital watches and MP3 players,
to large stationary installations like traffic lights, factory controllers. Complexity varies from low,
with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
Embedded systems contain processing cores that are either microcontrollers or digital signal
processors (DSP). The key characteristic, however, is being dedicated to handle a particular task.
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce
the size and cost of the product and increase the reliability and performance. Some embedded systems
are mass-produced, benefiting from economies of scale.
Robotics and automation are a part of embedded systems itself. Robot development and automation
needs study of embedded systems.
Examples of Embedded System:-
I. automatic teller machines (ATMs)
II. avionics, such as inertial guidance systems, flight control hardware/software and other
integrated systems in aircraft and missiles
III. cellular telephones and telephone switches
IV. computer equipment such as routers and printers
V. engine controllers and antilock brake controllers for automobiles
VI. home automation products, like thermostats, air conditioners, sprinklers, and security
monitoring systems
VII. handheld calculators
VIII. household appliances, including microwave ovens, washing machines, television sets
IX. medical equipment
X. handheld computers
XI. videogame consoles
A.Manikanta & B.Prabhukiran AEC,Bhongir
2
1.2.SOFTWARE DEVELOPEMENT
1.2.1 ECLIPSE
1.2.1.1 INTRODUCTION
Developing programs using a text editor such as TextPad is simple and straightforward.While such
editors allow students to begin programming with a minimum of distractions, asprograms become
larger and more complicated, a more sophisticated tool for developingprograms is quite valuable. In
this chapter, we examine one particular tool for developinglarge programs, the Eclipse system. Eclipse
can be used to develop programs in Java and inC/C++ (plus various other languages as well). In this
chapter, we examine how to install Eclipse.
1.2.2 INTERACTIVE DEVELOPMENT ENVIRONMENTS
Interactive development environments (IDE) provide a wealth of features to support the programmer
that are not available in a simple editor. There are many IDE’s currently available, some are shareware
and some must be purchased and are often expensive. Most IDE’s provide similar facilities, such as
the ability to view different classes at the same time, debuggers that step through a program line-by-
line in order to assist in locating errors, etc. One of the newest and most popular IDE’s is the Eclipse
IDE which is available at no cost from the Eclipse website (http://www.eclipse.org/).
1.2.3 THE ECLIPSE IDE
Eclipse is an IDE (actually it is more than an IDE but we will concentrate on Eclipse as an IDE) that
was initially controlled by IBM but then IBM released the source code for Eclipse, making the project
open source. Eclipse development is taking place in several cities, including Winnipeg, Ottawa, and
Zurich, although there is also a large community of programmers who provide extensions to Eclipse in
order to improve the Eclipse environment. The facilities in Eclipse can be extended by defining “plug-
ins” which provide additional features or support additional languages.. Eclipse runs on most
operating systems, including Unix, Linux, Windows, and Mac OS X.
1.2. 4 TINA PRO :-
THE COMPLETE ELECTRONICS LAB FOR WINDOWS
INTRODUCTION:-TINA is a powerful yet affordable software package for designing, simulating
and analyzing electronic circuits. It works equally well with linear and nonlinear analog circuits,
digital and mixed circuits. Analysis results can be displayed as sophisticated diagrams or on a range of
virtual instruments. Comprehensive DTP tools and powerful text and equation editors can be used to
produce professional reports and presentations. The standard library contains over 20000 components
and can be extended by the user. Electronics engineers will find TINA an invaluable, easy to use and
high performance tool. TINA can also be used in the training environment. It includes unique tools for
testing students’ knowledge, monitoring progress and introducing troubleshooting techniques. With
A.Manikanta & B.Prabhukiran AEC,Bhongir
3
optional hardware it can be used to test real circuits for comparison with the results obtained from
simulation. Of great importance to educators, the package includes all the tools needed to
prepareeducational materials. The circuit diagrams and the calculated or measured results can be
printed or saved to files in standard Windows WMF format. These output files can be processed by a
number of well known software packages (Microsoft Word, Corel Draw etc.). Net lists can be
exported and imported in Pspice format and also to drive popular PCB packages such as ORCAD,
TANGO, PCAD, PROTEL, REDAC and EDS.
TINA has special operating modes for training and for examination. In these modes, under TINA’S
control, the students solve problems assigned by the teacher. The solution format depends on the types
of problems: they can be selected from a list, calculated numerically, or given in symbolic form. The
interpreter - providing a number of solution tools - can also be used for problem solving. If the student
cannot solve the problem, he/she can turn to the multi-level Advisor. The package includes all the
tools needed to produce educational materials. A collection of examples and problems worked out by
teachers is also part of the package. Another special educational function of TINA is the software or
hardware simulation of circuit faults to practice troubleshooting. Using TINA, you can transform
existing PC classrooms into contemporary electronics training labs at low cost.
THE BASIC SCREEN FORMAT:-
1. The menu bar
2. The cursor or pointer
A.Manikanta & B.Prabhukiran AEC,Bhongir
4
3. The Schematic window
4. The Tool bar
5. The Component bar
6. Find component tool
7. Open files tab
8. The TINA Task bar
9. The Help line
A.Manikanta & B.Prabhukiran AEC,Bhongir
5
1.3.PCB DESIGNING
1.3.1 INTRODUCTION:-
PCB Stands for "Printed Circuit Board." A PCB is a thin board made of fiberglass, composite epoxy,
or other laminate material. Conductive pathways are etched or "printed" onto board, connecting
different components on the PCB, such as transistors, resistors, and integrated circuits.
PCBs are used in both desktop and laptop computers. They serve as the foundation for many internal
computer components, such as video cards, controller cards, network interface cards, and expansion
cards. These components all connect to the motherboard, which is also a printed circuit board.
While PCBs are often associated with computers, they are used in many other electronic devices
besides PCs. Most TVs, radios, digital cameras, cell phones, and tablets include one or more printed
circuit boards. While the PCBs found in mobile devices look similar to those found in desktop
computers and large electronics, they are typically thinner and contain finer circuitry.
HISTORY :
The inventor of the printed circuit was the Austrian engineer Paul Eisler (1907–1995) who,
while working in England, made one circa 1936 as part of a radio set.
MATERIAL:
Conducting layers are typically made of thin copper foil. Insulating layers dielectric are
typically laminated together with epoxy resin prepreg. The board is typically coated with a solder
mask that is green in color. Other colors that are normally available are blue and red. There are
quite a few different dielectrics that can be chosen to provide different insulating values depending
on the requirements of the circuit. Some of these dielectrics are polytetrafluoroethylene (Teflon),
FR-4, FR-1, CEM-1 or CEM-3. Well known prepreg materials used in the PCB industry are FR-2
(Phenolic cotton paper), FR-3 (Cotton paper and epoxy), FR-4 (Woven glass and epoxy), FR-5
(Woven glass and epoxy), FR-6(Matte glass and polyester), G-10(Woven glass and epoxy), CEM-
1 (Cotton paper and epoxy), CEM-2 (Cotton paper and epoxy), CEM-3 (Woven glass and
epoxy),CEM-4 (Woven glass and epoxy), CEM-5 (Woven glass and polyester).
Thermal expansion is an important consideration especially with BGA and naked die technologies,
and glass fiber offers the best dimensional stability.
1.3.2 TYPES OF PRINTED CIRCUIT BOARDS
Single Sided Board:-This is the least complex of the Printed Circuit Boards, since there is only a
single layer of substrate. All electrical parts and components are fixed on one side and copper traces
are on the other side.
Double Sided Board:-This is the most common type of board, where parts and components are
attached to both sides of the substrate. In such cases, double-sided PCBs that have connecting traces
A.Manikanta & B.Prabhukiran AEC,Bhongir
6
on both the sides are used. Double-sided Printed Circuit Boards usually use through-hole construction
for assembly of components.
Multi Layered Board:-Multi layered PCB consists of several layers of substrate separated by
insulation. Most common multilayer boards are: 4 layers, 6 layers, 8 layers, and 10 layers. However,
the total number of layers that can be manufactured can exceed over 42 layers. These types of boards
are used in extremely complex electronic circuits.
1.3.3 PCB DESIGN STEPS IN OrCad 10.5
1.3.3.1 ENTRY OF SCHEMATIC DIAGRAM
Schematic diagram provides the functional flow and the graphical representation of an electronic
circuit. The entry of schematic diagram is the first step in PCB design using OrCad.
A schematic diagram consists of:-
 Electrical connections(nets)
 Junctions
 Integrated circuits symbols
 Discrete components symbols like resistors, capacitors etc.
 Input / output connectors
 Power and ground symbols
 Buses
 No connection symbols
 Components reference names
 Text
1.3.3.2 THE SCHEMATIC PAGE EDITOR:
The schematic page editor is used to display and edit schematic pages. So that one can parts; wires;
buses and draw graphics. The schematic page editor has a tool palette that you can use to draw and
place everything you need to create a schematic page. One can print from within the schematic page
editor, or from the project window.
A.Manikanta & B.Prabhukiran AEC,Bhongir
7
Fig 1.3.1 Schematic Page Editor
1.3.3.3 THE PART EDITOR:
The part editor is used to create and edit parts.
From the view menu of the part editor you can choose either part or package. In part view one can:-
 Create and edit parts and symbols, then store in new or existing libraries.
 Create and edit power and ground symbols, off-page connector symbols, and title block
 Use the tool palette’s electrical tools to place pins on parts, and its drawing tools to draw parts
and symbols.
1.3.3.4 THE SESSION LOG:
The session log lists the events that have occurred during the current Capture session, includes
message resulting from using capture’s tools. To display context-sensitive help for an error message,
put the cursor in the error message line in the session log press F1.The ruler along the top appears in
either inches or mill meters, depending on which measurement system is selected in the window panel.
Your tab setting are saved and used each time you start capture.
A.Manikanta & B.Prabhukiran AEC,Bhongir
8
Fig 1.3.2 Session Log window
One can search for information in the session log using the find command on the Edit menu. You can
also save the contents of the of the session log to a file, which is useful when working with Orcad’s
technical support to solve technical problems. The default filename is SESSION.TXT.
1.3.3.5 THE TOOLBAR:Capture’s toolbar is dock able (that means you can select and drag the
toolbar to new location) as well as resizable, and displays tool tips for each tool; by choosing a tool
button you can quickly perform a task. If tool button is dimmed, you can’t perform that task in the
current situation.
Fig 1.3.3 Toolbar
Some of the tools operate only on what you have selected, while others give you a choice of either
operating on what is selected or expanding the scope to entire project.
You can hide the toolbar, then display it again when u need it. For hiding select from the schematic
page editor’s view menu, choose TOOLBAR.
1.3.3.6 THE TOOL PALETTE:Capture has two tool palettes: one for the schematic page editor and
one for the part editor. Both tool palettes are dock able and resizable. They can also display tool tips
that identify each tool. The drawing tools on the two tool palettes are identical, however, each tool
palette has different electrical tools after you choose a tool, and you press the right mouse button to
display a context- sensitive pop-up menu.
A.Manikanta & B.Prabhukiran AEC,Bhongir
9
1.3.3.7 THE SCHEMATIC PAGE EDITOR TOOL PALETTE:
The first group of tools on the tool palette is electrical tools, used to place electrical connectivity
objects. The second group of tools is
Drawing tools, used to create graphical objects without electrical connectivity.
Fig1.3.4 schematic page editor tool palette
1.3.3.8 THE PART EDITOR TOOL PALETTE:
The first group of tools on the part palette is electrical tools, used to place pins and symbols. They
have been already explained above within the schematic page editor tools. The second group of tools
is drawing tools, used to create graphical objects without objects any electrical connectivity and is
described:
Pin Tools: Place pins on part
Pin Array: Place multiple pins on part
1.3.4 CREATING NET LIST FILE
Net-list file is a document file which contains information about the logical interconnections between
signals and pins. Before one create a net list file, be sure one’s project is completed, annotated and it is
free from electrical rule violations.
A net list file consists of nets, components, connectors, junctions, no connection symbol, power and
ground symbols.
1.3.4.1 CREATION OF NET LIST IN CAPTURE:
 Select your design in the project manager.
 From the tools, choose create net list. The net list dialog box displays.
 Choose a net list format tab.
 If necessary, set the part value and PCB foot print combined property strings to reflect the
information you want in the net list.
 Click ok to create the net list.
 In the net list file text box, enter a name for the output file. If the selected format creates an
additional file, enter its file name in the second text box.
A.Manikanta & B.Prabhukiran AEC,Bhongir
10
1.3.5 LAYOUT PLUS
Layout plus is one part for the PCB design in which we place as well as route the components an set
unit of measurement, grids, and spacing in OrCad. Within other soft wares you also have to place and
route the components in similar way. For the placement and routing of the components we normally
use auto-placement and auto-routing. Unfortunately, in a lot of soft wares some critical signals have to
be routed manually before auto-routing. In layout plus we also define the layer stacks, pad stacks and
via's.
1.3.5.1 STEPS FOR BOARD DESIGN:
 At first, we have created a net list from our schematic diagram by using capture.
 Layout plus includes design rules in order to guide logical placement and routing. That means,
load the net list into layout to create the board. At the same time you have to specify the board
parameters.
 Specify board parameters: Specifying global setting for the board, including nits of
measurements, grid, and spacing
 Place components: Use the components tool in order to place manually the components which
are fixed by the system designer on the board or otherwise use auto-placement.
 Route the board: Use different routing technologies to route the board and take advantage of
push and shove (a routing technology), which moves track you are currently routing as well as
you can also auto route the board.
 Provide finishing of the board: Layout supplies an ordered progression of commands on the
auto menu for finishing your design. These commands include design rule check, cleanup
design, rename components, back annotate, run post processor, and create reports.
1.3.5.2 THE DESIGN WINDOW:
The design window provides a graphical display of printed circuit board, it is primary window you use
when designing your board. It also provides tools to facilitate the design process such as to update
components and design rule violation.
A.Manikanta & B.Prabhukiran AEC,Bhongir
11
Fig 1.3.5 design window
1.3.5.3 MAIN WINDOW:
Method to create a board with Layout Plus:
 Ensure that net list with all footprints and necessary information has been created.
 Create a directory in which the schematic design, net list, and boar will co-exit and put the
schematic design and net list. OrCad provides a directory for this purpose.
 From the layout session frame’s file menu, choose New. The load template file in the dialog
box displayed.
Fig 1.3.6 main window
A.Manikanta & B.Prabhukiran AEC,Bhongir
12
1.3.5.4 DESIGN STEPS:
 Select the technology template (.TCH), then choose the open button and load the net list in
other box.
 Then apply the auto ECO.
 If necessary, respond to link footprints to component dialog.
 Draw the board outline by using the obstacle tool in the tool bar.
1.3.5.5 SETTING BOARD PARAMETERS:
There is some parameter which should be set before placing the components on board. They are as
follows:-
 Set Datum
 Create a board outline
 Set units of measurements
 Set system grid
 Add mount holes
1.3.5.6 CREATING OF BOARD OUTLINE:
Board outline is the graphical representation of the size of the actual PCB board. So it is the main step
in layout, to draw the board outline of the actual size of PCB board.
1.3.5.7 PLACEMENT OF COMPONENTS:
Placement of components means that to place the components in designed box. A designer should
follow the following steps before going for it:-
 Optimize the board for component placement.
 Load the placement strategy file.
 Place components on the board.
 Optimize placement using various placements
Components can be placed by using two techniques:-
1) Manual placement of components
2) Auto placement of components
Choose the components tool bar button. From the pop up men, choose the queue for placement. The
components selection criteria dialog box appears. Enter the reference designator of the components
that you want to place in the appropriate text box, and click ok. Drag the components to desired
location, place it there.
A.Manikanta & B.Prabhukiran AEC,Bhongir
13
1.3.5.8 CONDUCTOR ROUTING IN LAYOUT:-
After placing all the components the other main step is to route the board from the electrical
connections between the components. One may route board manually or automatically by auto router.
100% auto routing can be achieved only when components are placed in the order of functional flow
of electronic circuit. The main routing tool available in OrCad is as flow:-
 Add/edit route mode
 Edit segment mode
 Shove track mode
 Auto path route mode
1.3.5.9 DESIGN RULE CHECK:-
In manual designs every thing was checked as a possible source of error. Components sizes, hole
sizes, conductor widths and clearance, land-to-hole-ratio, board areas to be free of components,
clearance to the edges, positional accuracy and of course electrical interconnections had tad to be
personally reviewed with a great deal of care. After completing the design of printed circuit board with
the help of an EDA-Tool, a designer has again to verify the PCB in order to find out errors.
A.Manikanta & B.Prabhukiran AEC,Bhongir
14
1.4.THE 8051 MICROCONTROLLER
1.4.1 INTRODUCTION
The microcontroller incorporates all the features that are found in microprocessor. The microcontroller
has built in ROM, RAM, Input Output ports, Serial Port, timers, interrupts and clock circuit. A
microcontroller is an entire computer manufactured on a single chip. Microcontrollers are usually
dedicated devices embedded within an application. For example, microcontrollers are used as engine
controllers in automobiles and as exposure and focus controllers in cameras. In order to serve these
applications, they have a high concentration of on-chip facilities such as serial ports, parallel input
output ports, timers, counters, interrupt control, analog-to-digital converters, random access memory,
read only memory, etc. The I/O, memory, and on-chip peripherals of a microcontroller are selected
depending on the specifics of the target application. Since microcontrollers are powerful digital
processors, the degree of control and programmability they provide significantly enhances the
effectiveness of the application. The 8051 is the first microcontroller of the MCS-51 family
introduced by Intel Corporation at the end of the 1970s. The 8051 family with its many enhanced
members enjoys the largest market share, estimated to be about 40%, among the various
microcontroller architectures. The microcontroller has on chip peripheral devices. In this unit
firstly we differentiate microcontroller from microprocessor then we will discuss about Hardware
details of 8051 and then introduce the Assembly level language in brief.
MICROCONTROLLERS
 Microcontroller (MC) may be called computer on chip since it has basic features of
microprocessor with internal ROM, RAM, Parallel and serial ports within single chip. Or we
can say microprocessor with memory andports is called as microcontroller. This is widely used
in washing machines, vcd player, microwave oven, robotics or in industries.
 Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.
 8 bit microcontroller, means it can read, write and process 8 bit data. Ex. 8051
microcontroller. Basically 8 bit specifies the size of data bus. 8 bit microcontroller means 8
bit data can travel on the data bus or we can read, write process 8 bit data.
1.4.2 MICROCONTROLLER FAMILIES
8051- These microcontrollers are old but still trendy and most of the companies fabricate these
microcontrollers. The older types of 8051 have 12 clocks per instruction that make it sluggish whereas
the recent 8051 have 6 clocks per instruction. The 8051 microcontroller does not have an in built
memory bus and A/D converters. In 1980, Intel fabricated the single chip microcontroller 8051 with
Harvard architecture.
A.Manikanta & B.Prabhukiran AEC,Bhongir
15
PIC- Programmable Interface Controller is usually referred as PIC. They are slightly older than 8051
microcontrollers but excel cause of their small low pin count devices. They perform well and are
affordable. The Microchip technology fabricated the single chip microcontroller PIC with Harvard
architecture. The programming part is very tedious and hence it is not recommended for beginners.
AVR(Advanced Version RISC) - In 1996, Atmel fabricated this single chip microcontroller with a
modified Harvard Architecture. This chip is loaded with C- compiler, Free IDE and many more
features. This microcontroller is a bit difficult for the starters to handle.
1.4.3 DIFFERENCE BETWEEN MICROCONTROLLER AND MICROPROCESSOR:-
It is very clear from figure that in microprocessor we have to interface additional circuitry for
providing the function of memory and ports, for example we have to interface external RAM for data
storage, ROM for program storage, programmable peripheral interface (PPI) 8255 for the Input Output
ports, 8253 for timers, Sartor serial port. While in the microcontroller RAM, ROM, I/O ports, timers
and serial communication ports are in built. Because of this it is called as “system on chip”. So in
micro-controller there is no necessity of additional circuitry which is interfaced in the microprocessor
because memory and input output ports are inbuilt in the microcontroller. Microcontroller gives the
satisfactory performance for small applications. But for large applications the memory requirement
is limited because only 64 KB memory is available for program storage. So for large
applications we prefer microprocessor than microcontroller due to its high processing speed.
A.Manikanta & B.Prabhukiran AEC,Bhongir
16
1.4.4 PIN DIAGRAM OF 8051:-
Pins 1-8 (Port 1) - Each of these pins can be configured as an input or an output.
Pin 9 (Reset) - A logic one on this pin disables the microcontroller and clears the contents of most
registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic
zero to this pin, the program starts execution from the beginning.
Pins 10- 17 (Port 3) -Similar to port 1, each of these pins can serve as general input or output.
Besides, all of them have alternative functions:
Pin 10 (RXD) - Serial asynchronous communication input or Serial synchronous communication
output.
Pin 11(TXD) - Serial asynchronous communication output or Serial synchronous communication
clock output.
Pin 12 (INT 0) - Interrupt 0 input.
A.Manikanta & B.Prabhukiran AEC,Bhongir
17
Pin 13(INT 1) - Interrupt 1 input.
Pin 14(T0) - Counter 0 clock input.
Pin 15(T1) - Counter 1 clock input.
Pin 16(WR) -Write to external (additional) RAM.
Pin 17 (RD) -Read from external RAM.
Pin 18 and 19(X1, X2) - Internal oscillator input and output. A quartz crystal which specifies
operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can
also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz
up to over 50 Hz.
Pin 20 (GND) - Ground.
Pin 21-28 (Port 2) - If there is no intention to use external memory then these port pins are configured
as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-
A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means
that not all eight port bits are used for its addressing, the rest of them are not available as
inputs/outputs.
Pin 29 (PSEN) - If external ROM is used for storing program then a logic zero (0) appears on it every
time the microcontroller reads a byte from memory.
Pin 30 (ALE) - Prior to reading from external memory, the microcontroller puts the lower address
byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the
external register memorizes the state of P0 and uses it as a memory chip address. Immediately after
that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port
data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other
words, this port is used for both data and address transmission.
Pin 31 (EA) - By applying logic zero to this pin, P2 and P3 are used for data and address transmission
with no regard to whether there is internal memory or not. It means that even there is a program
written to the microcontroller, it will not be executed. Instead, the program written to external ROM
will be executed. By applying logic one to the EA pin, the microcontroller will use both memories,
first internal then external (if exists).
Pin 32-39 (Port 0) - Similar to P2, if external memory is not used, these pins can be used as general
inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven
high (1) or as data output (Data Bus) when the ALE pin is driven low (0).
Pin 40 (Vcc) - +5V power supply.
A.Manikanta & B.Prabhukiran AEC,Bhongir
18
1.4.5 MICROCONTROLLER 8051 ARCHITECTURE
It is 8-bit microcontroller, means MC 8051 can Read, Write and Process 8 bit data. This is mostly
used microcontroller in the robotics, home appliances likemp3 player, washing machines, electronic
iron and industries. Mostly used blocks in the architecture of 8051 are as follows:
Address bus-For a device (memory or I/O) to be recognized by the CPU, it must be assigned an
address. The address assigned to a given device must be unique. The CPU puts the address on the
address bus, and the decoding circuitry finds the device.
Data bus-The CPU either gets data from the device or sends data to it.
Control bus-Provides read or write signals to the device to indicate if the CPU is asking for
information or sending it information .
1.4.6 Memoryand Registers
The 8051 microcontroller has a total of 256 bytes of RAM in which 128 is visible or useraccessible
and extra 128 is for special function registers. The user accessible RAM is used for temporary data
storage. The user accessible RAM is from the address range 00 to 7Fh.From the user accessible RAM,
32 bytes of RAM is used for registers and rest for Stack operations. The 32 Bytes of RAM is divided
into four register Banks i.e. Bank0, Bank 1, Bank 2, Bank3. Each of these banks have 8 Registers i.e.
R0 to R7 each.
A.Manikanta & B.Prabhukiran AEC,Bhongir
19
RAM locations from 0 to 7 are set aside for bank 0 of R0 – R7 where R0 is RAM location 0, Rl is
RAM location 1, and R2 is location 2, and so on, until memory location 7, which belongs to R7 of
bank 0. The second bank of registers R0 – R7 starts at RAM location 08 and goes to location 0FH. The
third bank of R0 – R7 starts at memory location 10H and goes to location 17H. Finally, RAM
locations 18H to 1FH are set aside for the fourth bank of R0 – R7.
Generally for normal operations, Register bank Bank0 is set by default. But we can switch to other
banks by using PSW Commands.
SFRs (Special Function Register) - These Registers are in extra 128 bytes of the memory. This part
of memory is not user accessible and these registers are used for special purposes. These
registers range from 80h to FFh. There are a total of only 21 SFRs in this range and all other addresses
from 80h to FFh are invalid and there use can cause errors and not valuable results.
Some of the SFRs are TCON, SBUF, ACC, B, SCON, TMOD SP, P0, PSW, TL0, and TL1. These all
the registers have some specific function that has to be performed after they are programmed.
Byte Addressable SFR with byte address
SP – Stack printer – 81H
DPTR – Data pointer 2 bytes
DPL – Low byte – 82H
DPH – High byte – 83H
A.Manikanta & B.Prabhukiran AEC,Bhongir
20
TMOD – Timer mode control – 89H
TH0 – Timer 0 Higher order bytes – 8CH
TL0 – Timer 0 Low order bytes – 8AH
TH1 – Timer 1 High bytes = 80H
TL1 – Timer 1 Low order byte = 86H
SBUF – Serial data buffer = 99H
PCON – Power control – 87H.
DPTR - Data Pointer in 8051
 16 bit register; it is divided into two parts DPH and DPL.
 DPH for Higher order 8 bits, DPL for lower order 8 bits.
 DPTR, DPH, DPL these all are SFRs in 8051.
1. 4.7 Timers and Counters:
The 8051 has two timers T0 and T1, which may be configured and used individually. The 8052 has an
additional Timer T2.All these counters count up on negative going edges at their inputs. These can be
used as event counters (where they count the number of negative transitions on a pin connected to
some external source), or as Timers, where they count up once every twelfth clock cycle. A special use
of timers is for generating baud rates for the serial port. The usage of these timers is somewhat
different from common general purpose timer/counters such as the 8253 and 8254. This difference
stems partly from the fact that we cannot afford to have a large numbers of pins dedicated to the
functioning of these timer counters. Thus, just two multifunction pins are used as external inputs in
8051. Gating is accomplished by control bits in the special function registers, and using the external
interrupt pins as gate inputs. There are no output pins associated with the timers. The processor can
be interrupted by the timers and as a part of the interrupt service routine, the processor can performing
IO function through its ports. When used as baud rate generators, the output
goes directly to the serial port hardware within the microcomputer.
8051 timers always count up. Each counter has a 16 bit count register in the SFR area. The low and
high bytes can be accessed as separate bytes. When their
count rolls over from the maximum count to 0000, they set the corresponding
timer flag (TF1 or TF0) in TCON. The 8051 can be set up so that an interrupt occurs whenever TF1
or TF0 is set. when 8051 branches to the interrupt vector, it automatically clears the TF
flag.
Timer means which can give the delay of particular time between some events. For example on or
off the lights after every 2 sec. This delay can be provided through some assembly program but in
microcontroller two hardware pins are available for delay generation. These hardware pins can be
A.Manikanta & B.Prabhukiran AEC,Bhongir
21
also used for counting some external events. How much times a number is repeated in the given table
is calculated by the counter.
• In MC8051, two timer pins are available T0 and T1, by these timers we can give the delay of
particular time if we use these in timer mode.
• We can count external pulses at these pins if we use these pins in counter mode.
• 16 bits timers are available. Means we can generate delay between 0000H to FFFFH.
• Two special function registers are available.
• In the same way for T1.
• TMOD, TCON registers are used for controlling timer operation.
Basic registers of the timer
Timer 0 and Timer 1 are 16 bits wide each 16-bit timer is accessed as two separate registers of low
byte and high byte.
Timer 0 registers
low byte register is called TL0 (Timer 0 low byte) and the high byte register is referred to as TH0
(Timer 0 high byte) can be accessed like any other register, such as A, B, R0, R1, R2, etc. "MOV
TL0, #4 FH" moves the value 4FH into TL0 "MOV R5, TH0" saves TH0 (high byte of Timer 0) in R5
Timer 1 registers
also 16 bits split into two bytes TL1 (Timer 1 low byte) and TH1 (Timer 1 high byte) accessible in the
same way as the registers of Timer 0.
A.Manikanta & B.Prabhukiran AEC,Bhongir
22
TMOD (timer mode) register
timers 0 and 1 use TMOD register to set operation modes (only learn Mode 1 and 2) 8-bit register
lower 4 bits are for Timer 0 upper 4 bits are for Timer 1 lower 2 bits are used to set the timer mode
(only learn Mode 1 and 2) upper 2 bits to specify the operation (only learn timer operation)
Clock source for timer
timer needs a clock pulse to tick if C/T = 0, the crystal frequency attached to the 8051 is the source of
the clock for the timer frequency for the timer is always 1/12th the frequency of the crystal attached to
the 8051 XTAL = 11.0592 MHz allows the 8051 system to communicate with the PC with no errors In
our case, the timer frequency is 1MHz since our crystal frequency is 12MHz
Using Windows calculator to find TH, TL
Windows scientific calculator can be use to find the TH, TL values Lets say we would like to find the
TH, TL values for a time delay that uses 35,000 clocks of 1.085ms open scientific calculator and
select decimal enter 35,000 select hex - converts 35,000 to hex 88B8H select +/- to give -35000
decimal (7748H) the lowest two digits (48) of this hex value are for TL and the next two (77) are for
TH
A.Manikanta & B.Prabhukiran AEC,Bhongir
23
C/T bit in TMOD register
used as a timer, the 8051's crystal is used as the source of the frequency used as a counter, pulse
outside the 8051 increments the TH, TL registers counter mode, TMOD and TH, TL registers are the
same as for the timer timer modes are the same as well
C/T bit in TMOD register
C/T bit in the TMOD register decides the source of the clock for the timer C/T = 0, timer gets pulses
from crystal C/T = 1, the timer used as counter and gets pulses from outside the 8051 C/T = 1, the
counter counts up as pulses are fed from pins 14 and 15 pins are called T0 (Timer 0 input) and T1
(Timer 1 input) these two pins belong to port 3 Timer 0, when C/T = 1, pin P3.4 provides the clock
pulse and the counter counts up for each clock pulse coming from that pin Timer 1, when C/T = 1 each
clock pulse coming in from pin P3.5 makes the counter count up
TCON register
TR0 and TR1 flags turn on or off the timers bits are part of a register called TCON (timer control)
upper four bits are used to store the TF and TR bits of both Timer 0 and Timer 1 lower four bits are set
aside for controlling the interrupt bits SETB TRl" and "CLR TRl“ "SETB TCON. 6" and "CLR
TCON. 6“
Timer Functions
When used as timers, the 8051 timers count up every 12th clock cycle. This is
selected by clearing the corresponding C/T flags in the TMOD special function
register, placed at the address 89H.
A.Manikanta & B.Prabhukiran AEC,Bhongir
24
Timer modes
The timers may operate in one of four modes:
Mode 0 In this mode, the timers act as 13 bit counters. This mode is largely meant for providing
compatibility with an older microcontroller from Intel(8048). This mode is practically never used in
fresh designs. Except for the counter size, this mode is identical to mode 1.
Mode 1 In this mode, the timers are 16 bits in size. This is a commonly used mode. It is common
to configured the timer to cause an interrupt when it overflows. The interrupt routine then reloads the
timer.
Mode 2 This mode provides an 8 bit counter with auto-reload. It uses the high byte of the count
register to store the count value and the low byte as the actual counter. The counter is automatically
re-loaded from TH when it overflows. Thus, there is no software overhead for re-loading the
registers. This is convenient for generating baud rates etc. The timing resolution is much lower in
this mode (only 8 bits). Therefore crystal frequencies have to be carefully chosen to generate
accurate baud rates. Crystals of 11.059MHz are often used rather than 12 MHz for this reason.
Mode 3 In this mode Timers T0 and T1 behave quite divergently. T0 acts as two independent 8 bit
counters. Count register TL0 uses the resources (such as the RUN flag, overflows flag) in TCON,
TMOD etc. meant for T0. Similarly,TH0 uses the resources meant for T1. Thus, TR1 will enable
running the 8 bit counter made up of TH0. TF1 will be set whenever TH0 overflows.T1 now
hascontrol bits at all! It can only be used for services which require no control, no gating and no
interrupts. Thus, T1 can be used for Baud rate generation, while we still have two timers available
(both with 8 bit resolution).
Serial Port
• There are two pins available for serial communication TXD and RXD.
• Normally TXD is used for transmitting serial data which is in SBUF register,
RXD is used for receiving the serial data.
• SCON register is used for controlling the operation.
• There are four modes of serial communication which has been discussed in
further.
A.Manikanta & B.Prabhukiran AEC,Bhongir
25
ARCHUTECTURE OF 8051:-
ALU Arithmetic Logical Unit: This unit is used for the arithmetic calculations.
Accumulator: This register is used for arithmetic operations. This is also bit addressable and 8 bit
register.
B-Register: This register is used in only two instructions MUL AB and DIV AB. This is also
bit addressable and 8 bit register.
PC-Program Counter
• Points to the address of next instruction to be executed from ROM
• It is 16 bit register means the 8051 can access program address from
0000H to FFFFH. A total of 64KB of code.
A.Manikanta & B.Prabhukiran AEC,Bhongir
26
1.5.PROGRAMMING AND INTERFACING:-
1.5.1 INPUT DEVICES INTERFACING
1.5.1.1 SWITCH
Fig-1.5.1-Various Types Of Switches
Fig. 1 Switches are used to open/close a circuit
Fig. 2  S1 is a "single pole on/off" switch in the off position
Fig. 3 This is a "2 pole on/off" switch which completely isolates the lamp from the supply in the off
position. This may be important if it is a high voltage supply. The dotted line indicates that S1a and
S1b are part of the same switch "ganged" together and operate simultaneously.
Fig. 4 This is a "single pole changeover" switch. Either lamp 1 or lamp 2 is on.
Fig. 5this is a "2 pole changeover" switch. The unlit lamp is completely isolated from the supply.
Again S1a and S1b are part of the same switch
Fig. 6this is a "single pole 5 way" switch. It can select 1 of 5 circuits. You can have 2p 5w, 3p 4w
etc
Fig. 8 This is a "changeover" slide switch. When operated a-b opens and b-c closes
A.Manikanta & B.Prabhukiran AEC,Bhongir
27
1 INTERFACING WITH AT89S52-
In 8051 PORT 1, PORT 2 & PORT 3 have internal 10k Pull-up resistors whereas this Pull-up resistor
is absent in PORT 0. Hence PORT 1, 2 & 3 can be directly used to interface a switch whereas we have
to use an external 10k pull-up resistor for PORT 0 to be used for switch interfacing or for any other
input. Figure 2.2 shows switch interfacing for PORT 1, 2 & 3. Figure 2.3 shows switch interfacing to
PORT 0.
Fig 1.5.2 - Switch Interfacing For Port 1, 2 & 3
For any pin to be used as an INPUT PIN a HIGH (1) should be written to the pin if you don’t do this
the pin will always be read as LOW.In the above figure when the switch is not pressed the 10k resistor
provides the current needed for LOGIC 1 closure of switch provides LOGIC 0 to the controller
PIN.Let's write a small program where whenever a switch is pressed a LED is turned ON. Consider
that switch is connected to P2.0 & an LED connected to P2.1.
Program of switch interfacing-
Main()
{
P2_0==1;
SETB P2_1==0;
While(1)
{
If(P2_0==0)
{
P2_1==1;
}
Else
{
P2_1==0;
}
}
A.Manikanta & B.Prabhukiran AEC,Bhongir
28
OUTPUT DEVICES INTERFACING
1.5.2.1 LED INTERFACING
C CODE FOR BLINKING LEDS CONNECTED ON PORT2:
#include<at89s8252.h>
void delay(unsigned int i);
void main(void)
{
While(1)
{
P2=0x00;
Delay(0xffff);
P2=0x00;
Delay(0xff);
}
}
void delay(unsigned int i)
{
while(i!=0)
{
i--;
}
}
Fig:-1.5.3-Hardware Interfacing Of Led With At89s52
A.Manikanta & B.Prabhukiran AEC,Bhongir
29
1.5.2.2 LCD(JHD162A) INTERFACING:
On most displays, the pins are numbered on the LCD’s printed circuit board, but if not, it is quit easy
to locate pin1. Since the pin is connected to ground, it often has a thicker PCB track connected to it,
and it is generally connected to the metal work at some point.
Fig:-1.5.4-Jhd162a LCD(16x2)
Three command control inputs. When this line is low, data bytes transferred to the display are treated
as commands, and data bytes read from the display indicate its status. By setting the RS line high,
character data can be transferred to and from the module.
Pin 5 is (R/W) line. This line is pulled low in order to write commands or character data to the module,
or pulled high to read character data or status information from its registers.
Pin 6 is Enable (E) line. This input is used to initiate the actual transfer of commands or character data
between the module and the data lines. When writing to the display, data is transferred only on the
high to low transition of this signal. However, when reading from the display, data will become
available shortly after the low to high transition and remain available until the signal falls low again
C CODE FOR LCD DISPLAY
//Program to study basics of LCD
#include"AT89S8252.h"
//macro directives of LCD
#define LCD P1
#define RS P3_3
#define EN P3_4
//prototyping various functions of LCD
void delay(unsigned int d);
void lcd_cmd(unsigned char c);
void lcd_init(void);
void cursor_position(unsigned char p);
void display(unsigned char h);
//program to display character 'A'
void main()
A.Manikanta & B.Prabhukiran AEC,Bhongir
30
{
lcd_init();
cursor_position(0);
display('A');
}
//defining delay function
void delay(unsigned int d)
{
while(d!=0)
d--;
}
//subprogram to send various commands to LCD
void lcd_cmd(unsigned char c)
{
delay(300);
LCD=c;
RS=0;
EN=1;
EN=0;
}
//subprogram too initialize LCD
void lcd_init(void)
{
lcd_cmd(0x01);
lcd_cmd(0x38);
lcd_cmd(0x0C);
}
//subprogram to set cursor position
void cursor_position(unsigned char p)
{
lcd_cmd(0x80+p);
}
//subprogram to display data on LCD
void display(unsigned char h)
{
delay(300);
LCD=h;
RS=1;
EN=1;
EN=0;
}
A.Manikanta & B.Prabhukiran AEC,Bhongir
31
1.5.2.3 SEVEN SEGMENT DISPLAY
The 7 segment display is used as a numerical indicator on many types of test equipment.
Fig:-1.5.5-Basic Diagram Of A Seven Segment Display
It is an assembly of light emitting diodes which can be powered individually. They most commonly
emit red light. They are arranged and labeled as shown in the figure 3.4.
Powering all the segments will display the number 8. Powering a,b,c d and g will display the number
3. Numbers 0 to 9 can be displayed. The d.p represents a decimal point. The one shown is a common
anode display since all anodes are joined together and go to the positive supply. The cathodes are
connected individually to zero volts. Resistors must be placed in series with each diode to limit the
current through each diode to a safe value.
Early wrist watches used this type of display but they used so much current that the display was
normally switched off. To see the time you had to push a button. Common cathode displays where all
the cathodes are joined are also available. Liquid crystal displays do a similar job and consume much
less power. Alphanumeric displays are available which can show letters as well as numbers
A.Manikanta & B.Prabhukiran AEC,Bhongir
32
1.6. COMMUNICATION
1.6.1 Serial communication between At89s52 and PC
One of the 8051s many powerful features is its integrated UART, otherwise known as a serial port. The
fact that the 8051 has an integrated serial port means that you may very easily read and write values to
the serial port. If it were not for the integrated serial port, writing a byte to a serial line would be a
rather tedious process requring turning on and off one of the I/O lines in rapid succession to properly
"clock out" each individual bit, including start bits, stop bits, and parity bits.
1.6.1.1 SETTING THE SERIAL PORT MODE -
The first thing we must do when using the 8051s integrated serial port is, obviously, configure it. This
lets us tell the 8051 how many data bits we want, the baud rate we will be using, and how the baud
rate will be determined.
First, lets present the "Serial Control" (SCON) SFR and define what each bit of the SFR represents:
Bit Name
Bit
Address
Explanation of Function
7 SM0 9Fh Serial port mode bit 0
6 SM1 9Eh Serial port mode bit 1.
5 SM2 9Dh Mutliprocessor Communications Enable (explained later)
4 REN 9Ch
Receiver Enable. This bit must be set in order to receive
characters.
3 TB8 9Bh Transmit bit 8. The 9th bit to transmit in mode 2 and 3.
2 RB8 9Ah Receive bit 8. The 9th bit received in mode 2 and 3.
1 TI 99h Transmit Flag. Set when a byte has been completely transmitted.
0 RI 98h Receive Flag. Set when a byte has been completely received.
A.Manikanta & B.Prabhukiran AEC,Bhongir
33
1.7.BACKGROUND OF EVM
Democracy and Voting
Democracy has come to be accepted as the most preferred form of political system all over the
world. However, the success of a democratic structure is to be judged by the successes that can be
solely attributed to this system. There are various challenges before democracy. These are
foundational challenges, challenge of expansion and deepening of democracy. All of these are
dependent on how the democracy is perceived by people who form the government, participate in
formation of government and are benefited by it. As we all know that India is world’s largest
democracy. It is perceived to be charismatic one as it accommodates cultural, regional, economical,
social disparities and still is able to stand on its own. India follows a federal form of government. It
means that governance power is not residing with one authority, but is distributed at various
levels. In India power is distributed between states and central authority.
What forms the basis of such vast and complex system of governance?
One needs not to be an Einstein to guess the answer. It is fundamental right to vote or
simply voting in elections.
Indian constitution provide every adult above the age of 18 years irrespective of his/her
religion, region, caste, creed, color, economic status, education and sex the essential right
to vote and elect her/his candidate to represent her/him.
Hence voting can be termed as backbone of not just democracy in India but all around the
world. Voting can be done in various ways. In early Roman Empire voting used to be
done by raising hands in favor or against. In board rooms voting is done in similar way,
some write their vote down, some choose to speak, some choose to cast vote using latest
technology.
Voting Techniques
In India all earlier elections be it state elections or centre elections a voter used to cast
his/her vote to his/her favorite candidate by putting the stamp against his/her name and
then folding the ballot paper as per a prescribed method before putting it in the Ballot
box. This is a long, time-consuming process and very much prone to errors.
This method wanted voters to be skilled voters to know how to put a stamp, and
methodical folding of ballot paper. Millions of paper would be printed and heavy ballot
boxes would be loaded and unloaded to and from ballot office to polling station. All this
continued till election scene was completely changed by electronic voting machine. No
more ballot paper, ballot boxes, stamping, etc. all this condensed into a simple box called
ballot unit of the electronic voting machine.
The marking system of voting was introduced in 1962 to make it possible for a
substantial number of illiterate voters to indicate easily their preferences in choosing their
A.Manikanta & B.Prabhukiran AEC,Bhongir
34
representatives. Over the years, there was a pronounced increase in the volume of work:
crores of ballot papers had to be printed and lakhs of ballot boxes had to be prepared,
transported, and kept in storage; and a great amount of time was taken up by the conduct
of elections. To overcome these difficulties, the Election Commission of India (ECI)
thought of electronic gadgets. The Electronics Corporation of India Ltd. (ECIL),
Hyderabad, and Bharat Electronics Ltd. (BEL), Bangalore, developed the electronic
voting machine in 1981.
The Electronic Voting Machine
The complete EVM consists mainly of two units - (a) Control Unit and (b) Balloting Unit
with cable for connecting it with Control unit. A Balloting Unit caters upto 16 candidates.
Four Balloting Units linked together catering in all to 64 candidates can be used with one
control unit. The control unit is kept with the Presiding Officer and the Balloting Unit is
used by the voter for polling.
The Balloting Unit of EVM is a small Box-like device, on top of which each candidate
and his/her election symbol is listed like a big ballot paper. Against each candidate's
name, a red LED and a blue button is provided. The voter polls his vote by pressing the
blue button against the name of his desired candidate.
How the Vote is cast with this EVM?
The entire process is very easy to understand:
• Like in earlier system, your name is called and you are asked to sign or put your
thumb impression in a register.
• After your identification is done by Election Officer, an ink mark is put on your
finger, same as earlier.
• Then the Election Officer gives you a slip that bears the Voter register number
where you signed or put your thumb impression.
• You hand over this slip to the presiding officer who confirms the serial number
and permits you to vote by pressing the button of the Control Unit of EVM.
• You are not given any ballot thereafter, and are sent to the EV Machine placed
behind a card board in a corner. The machine is placed in such a way that your
polled vote will be a secret. On the Balloting Unit of EVM, you press the button
placed in front of your favorite candidate and release.
A.Manikanta & B.Prabhukiran AEC,Bhongir
35
Compare and Contrast: Paper Voting and EVM
We have so far discussed three different voting systems. These systems are being used or
considered obsolete because of certain positive and negative points. These are
summarized as follows:
Device type
Ballot paper : Papers and boxes
EVM : Embedded system with Assembly code
Visual Output
Ballot paper : Stamp on paper
EVM : Single LED against each candidate's name
Operating System/ Software
Ballot paper : No operating system
EVM : None, the Assembly code to register number of votes is all it has
Hence it is simple automation of voting, no complexities.
Records/ Audits
Ballot paper : Manual counting to be done by officials, lengthy, time consuming
Process. Inaccurate due to human errors.
EVM : The Voting unit doesn't store anything, the control unit records the number of votes cast for
each candidate against his serial number.
No record to link person-to-vote.
Control and Operation
Ballot paper: Manual operation
EVM : Automatic operation. The control Unit accumulates the votes, it is a device with flash
storage and seven segment LED displays. The ballot unit has a button to issue a ballot for a voter.
Security Issues
Ballot paper : No security provided by the system, neither during polling nor during voting.
EVM : During polling, a facility is provided to seal the machine in case of booth
capturing. No further voting can be done afterwards.
Ballot Issue
Ballot paper : Ballot paper is issued by Electoral officer on which voter could cast his vote.
EVM : Ballot is issued by Electoral officer by pressing a button on the control Unit.
It allows the voter to press any button on the ballot unit to cast his vote.
A.Manikanta & B.Prabhukiran AEC,Bhongir
36
Storage of Votes
Ballot paper : In ballot boxes assigned for the purpose of storing votes, highly insecure method
of storage.
EVM : In Internal Non removable memory of the Control Units. No transfer over
network. Security increases with this feature. Moreover these results cant be accessed by authorized
personnel
only at commissioned offices..
Cost of the System
Ballot paper : High cost of paper printing in millions and low speed of the whole process.
EVM : About 12000 INR (300$) for one EVM.
Power Supply
Ballot paper : No power supply required.
EVM : 6V alkaline batteries or electricity.
Capacity
Ballot paper : As much a ballot box can hold.
EVM : 3840 Votes .
Existing System
But this electronic voting machine has its disadvantages too. These areas of deficiency
are not much of a concern to a layman, but for an intelligent voter this must be eliminated
for a secure election. The few technical disadvantages are given as:
• Microprocessor based design, which requires a no. of supporting components like
memory, peripheral interface, etc.
• No security against illegal viewing of results, as presiding officer can view the
results without any difficulty.
• Less user friendly due to two seven segment displays
• Existing system costs high.
Proposed System
All these faults motivated us to make this new enhanced EVM. The faults which are
eliminated are summarized as follows:
• Microcontroller replaced microprocessor, which made the EVM closer to real
time operation making it faster, more reliable and unique.
• More user friendly and interactive LCD display
• Proposed system costs less.
A.Manikanta & B.Prabhukiran AEC,Bhongir
37
• As soon as the button is pressed, the LED indicator lights off and a whistle sound
comes from the machine. This signifies that your vote has been casted rightly.
Now you can come out.
• In case of LED not not being turned off, press the button firmly again. If finding it
difficult, consult the Presiding Officer.
• Your vote is complete safe and secret and there is no room for error as well. You
can rest assured that your vote is not going to be invalid in any case.
• The Voting Machine is attached to the 'Control Unit'. When the user presses the
button, his vote is registered in the control unit and the number of votes for the
respective candidates is calculated automatically.
Booth Capture
A remarkable advantage is that rigging is not possible with the EVMs. In the ballot paper
system, the intruders can mark hundreds of ballots and put them into the ballot box in a
matter of a few minutes. This is not possible in voting machines as the machine is
designed to cast only one vote and for the next vote to be casted the presiding officer
should make it ready by pressing the related button. Thus the presiding officer can have a
complete control of voting and avoid any kind of malpractices
The EVMs have following advantages:
• the saving of considerable printing stationery and transport of large volumes of
electoral material,
• easy transportation, storage, and maintenance,
• no invalid votes,
• reduction in polling time, resulting in fewer problems in electoral preparations,
law and order, candidates' expenditure, etc. and
• easy and accurate counting without any mischief at the counting centre
• eco friendly.
A.Manikanta & B.Prabhukiran AEC,Bhongir
38
2. MICROCONTROLLERS
2.1 Introduction
Circumstances that we find ourselves in today in the field of microcontrollers had their
beginnings in the development of technology of integrated circuits. This development has
made it possible to store hundreds of thousands of transistors into one chip. That was a
prerequisite for production of microprocessors, and the first computers were made by
adding external peripherals such as memory, input-output lines, timers and other. Further
increasing of the volume of the package resulted in creation of integrated circuits. These
integrated circuits contained both processor and peripherals. That is how the first chip
containing a microcomputer, or what would later be known as a microcontroller came
about.
2.2 History
It was year 1969, and a team of Japanese engineers from the BUSICOM Company
arrived to United States with a request that a few integrated circuits for calculators be
made using their projects. The proposition was set to INTEL, and Marcian Hoff was
responsible for the project. Since he was the one who has had experience in working with
a computer (PC) PDP8, it occurred to him to suggest a fundamentally different solution
instead of the suggested construction. This solution presumed that the function of the
integrated circuit is determined by a program stored in it. That meant that configuration
would be simpler, but that it would require far more memory than the project that was
proposed by Japanese engineers would require. After a while, though Japanese engineers
tried finding an easier solution, Marcian's idea won, and the first microprocessor was
born. In transforming an idea into a ready made product, Frederico Faggin was a major
help to INTEL. He transferred to INTEL, and in only 9 months had succeeded in making
a product from its first conception. INTEL obtained the rights to sell this integral block in
1971. First, they bought the license from the BUSICOM Company who had no idea what
treasure they had. During that year, there appeared on the market a microprocessor called
4004. That was the first 4-bit microprocessor with the speed of 6 000 operations per second.
Not long after that, American company CTC requested from INTEL and Texas
Instruments to make an 8-bit microprocessor for use in terminals. Even though CTC gave
up this idea in the end, Intel and Texas Instruments kept working on the microprocessor
and in April of 1972, first 8-bit microprocessor appeared on the market under a name
8008.
A.Manikanta & B.Prabhukiran AEC,Bhongir
39
2.3 Definition of a Microcontroller
Microcontroller, as the name suggests, are small controllers. They are like single chip
computers that are often embedded into other systems to function as
processing/controlling unit. For example, the remote control you are using probably has
microcontrollers inside that do decoding and other controlling functions. They are also
used in automobiles, washing machines, microwave ovens, toys ... etc, where automation
is needed.
The key features of microcontrollers include:
• High Integration of Functionality
• Microcontrollers sometimes are called single-chip computers because they have
on-chip memory and I/O circuitry and other circuitries that enable them to
function as small standalone computers without other supporting circuitry.
• Field Programmability, Flexibility
• Microcontrollers often use EEPROM or EPROM as their storage device to allow
field programmability so they are flexible to use. Once the program is tested to be
correct then large quantities of microcontrollers can be programmed to be used in
embedded systems.
• Easy to Use
A.Manikanta & B.Prabhukiran AEC,Bhongir
40
2.4 Microcontrollers versus Microprocessors
Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other components
such as memory, or components for receiving and sending data must be added to it. In
short that means that microprocessor is the very heart of the computer. On the other hand,
microcontroller is designed to be all of that in one. No other external components are
needed for its application because all necessary peripherals are already built into it. Thus,
we save the time and space needed to construct devices.
2.5 Memory unit
Memory is part of the microcontroller whose function is to store data.
The easiest way to explain it is to describe it as one big closet with lots of drawers. If we
suppose that we marked the drawers in such a way that they cannot be confused, any of
their contents will then be easily accessible. It is enough to know the designation of the
drawer and so its contents will be known to us for sure.
A.Manikanta & B.Prabhukiran AEC,Bhongir
41
Typically, the amount of ROM type memory will vary between around 512 bytes and
4096 bytes, although some 16 bit microcontrollers such as the Hitachi H8/3048 can have
as much as 128 Kbytes of ROM type memory. ROM type memory, as has already been mentioned,
is used to store the program code. ROM memory can be ROM (as in One Time Programmable
memory), EPROM, or EEPROM. The amount of RAM memory is usually somewhat smaller,
typically ranging between 25 bytes to 4 Kbytes. RAM is used for data storage and stack
management tasks. It is also used for register stacks (as in the microchip PIC range of
microcontrollers).
2.6 Central Processing Unit
Let add 3 more memory locations to a specific block that will have a built in capability to
multiply, divide, subtract, and move its contents from one memory location onto another.
The part we just added in is called "central processing unit" (CPU). Its memory locations
are called registers.
A.Manikanta & B.Prabhukiran AEC,Bhongir
42
2.7 Bus
That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires.
There are two types of buses: address and data bus. The first one consists of as many
lines as the amount of memory we wish to address and the other one is as wide as data, in
our case 8 bits or the connection line. First one serves to transmit address from CPU
memory, and the second to connect all blocks inside the microcontroller.
Figure2.4: Showing connection between memory and central unit using buses
2.8 Input-output unit
Those locations we've just added are called "ports". There are several types of ports:
input, output or bidirectional ports. When working with ports, first of all it is necessary to
choose which port we need to work with, and then to send data to, or take it from the
port.
2.9 Serial communication
Beside stated above we've added to the already existing unit the possibility of
communication with an outside world. However, this way of communicating has its
drawbacks. One of the basic drawbacks is the number of lines which need to be used in
order to transfer data. What if it is being transferred to a distance of several kilometers?
The number of lines times’ number of kilometers doesn't promise the economy of the
A.Manikanta & B.Prabhukiran AEC,Bhongir
43
project. It leaves us having to reduce the number of lines in such a way that we don't
lessen its functionality. Suppose we are working with three lines only, and that one line is
used for sending data, other for receiving, and the third one is used as a reference line for
both the input and the output side. In order for this to work, we need to set the rules of
exchange of data. These rules are called protocol. Protocol is therefore defined in
advance so there wouldn't be any misunderstanding between the sides that are
communicating with each other. For example, if one man is speaking in French, and the
other in English, it is highly unlikely that they will quickly and effectively understand
each other. Let's suppose we have the following protocol. The logical unit "1" is set up on
the transmitting line until transfer begins.
Figure2.6: Serial unit sending data through three lines only
2.10 Timer unit
Since we have the serial communication explained, we can receive, send and process
data. However, in order to utilize it in industry we need a few additionally blocks. One of those
is the timer block which is significant to us because it can give us information about time,
duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a
register whose numeric value increments by one in even intervals, so that by taking its
value during periods T1 and T2 and on the basis of their difference we can determine
how much time has elapsed. This is a very important part of the microcontroller whose
understanding requires most of ourtime.
2.12 Analog to Digital Converter
As the peripheral signals usually are substantially different from the ones that
microcontroller can understand (zero and one), they have to be converted into a pattern
which can be comprehended by a microcontroller. This task is performed by a block for
analog to digital conversion or by an ADC. This block is responsible for converting an
A.Manikanta & B.Prabhukiran AEC,Bhongir
44
information about some analog value to a binary number and for follow it through to a
CPU block so that CPU block can further process it.
Finally, the microcontroller is now completed, and all we need to do now is to assemble it
into an electronic component where it will access inner blocks through the outside pins.
The picture below shows what a microcontroller looks like inside.
Thin lines which lead from the center towards the sides of the microcontroller represent
wires connecting inner blocks with the pins on the housing of the microcontroller so
called bonding lines. Chart on the following page represents the center section of a
microcontroller.
Figure2.11: Microcontroller outline with basic elements and internal connections
2.13 AT89S52 microcontroller:
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K
bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the indus-
A.Manikanta & B.Prabhukiran AEC,Bhongir
45
try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional nonvolatile memory pro-
grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications.
A.Manikanta & B.Prabhukiran AEC,Bhongir
46
3. INTRODUCTION TO 16X2 LCD DISPLAY
LCD stands for Liquid Crystal Display. The most commonly used LCDs found in the
market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support
at most of 80 characters.
3.1 Pin Description
Most LCDs with two controllers has 16 Pins. Pin description is shown in the table
below.
Pin No. Name Description
Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller)
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller)
Pin no. 16 NC Not Connected
Table No.3.1: Pin description of the LCD
A.Manikanta & B.Prabhukiran AEC,Bhongir
47
3.2 DDRAM - Display Data RAM
Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its
extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM
(DDRAM) that is not used for display can be used as general data RAM. So whatever
you send on the DDRAM is actually displayed on the LCD.
3.3 BF - Busy Flag
Busy Flag is a status indicator flag for LCD. When we send a command or data to the
LCD for processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed
successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount
of delay. For the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1
must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1
means LCD is busy and will not accept next command or data and BF = 0 means LCD is
ready for the next command or data to process.
3.4 Instruction Register (IR) and Data Register (DR)
There are two 8-bit registers controller Instruction and Data register. Instruction register
corresponds to the register where you send commands to LCD e.g. LCD shift command,
LCD clear, LCD address etc. and Data register is used for storing data which is to be
displayed on LCD. When send the enable signal of the LCD is asserted, the data on the
pins is latched in to the data register and data is then moved automatically to the
DDRAM and hence is displayed on the LCD.
3.5 Commands and Instruction set
Only the instruction register (IR) and the data register (DR) of the LCD can be controlled
by the MCU. Before starting the internal operation of the LCD, control information is
temporarily stored into these registers to allow interfacing with various MCUs, which
operate at different speeds, or various peripheral control devices. The internal operation
of the LCD is determined by signals sent from the MCU.
3.6 Sending Commands to LCD
To send commands we simply need to select the command register. Everything is same
as we have done in the initialization routine. But we will summarize the common steps
and put them in a single subroutine.
Following are the steps:
 Move data to LCD port
 Select command register
A.Manikanta & B.Prabhukiran AEC,Bhongir
48
4.PROJECT DESCRIPTION:-
4.1 BLOCK DIAGRAM
A.Manikanta & B.Prabhukiran AEC,Bhongir
49
4.2 .GENERAL WORKING:-
1. Initially when the switch is closed, allows the evm to take the vote. the vote is taken only
when push button is pressed and led D1 is switched ON.
2. A push button is assigned to each party. When the push button of the desired party is
pressed, the led is switched off which indicates that the vote is cast and the buzzer gives a
beep.
Again the push button is pressed so that the evm is ready to take the next vote which
isindicated through the led D1.The same process is repeated until all the voters cast their votes.


A.Manikanta & B.Prabhukiran AEC,Bhongir
50
3. To view the results of each respective party, the switch must be opened
4. To know the result of the party, the push button of the respective party must be pressed so that the
number of votes cast for the party is displayed on the lcd screen.
This process is repeated to know the results of each party.
P
in no. 10
R
/
W
P
in no. 11
R
S
1
= Data input
A.Manikanta & B.Prabhukiran AEC,Bhongir
51
4.3 C LANGUAGE CODING:
#include<reg51.h>
sfr input=0x90;
sfr ldata=0xa0;
sbit rs=P0^7;
sbit rw=P0^6;
sbit en=P0^5;
sbit m=P3^0;
sbit n=P3^1;
sbit buzz=P3^2;
sbit on=P3^3;
void delay(int );
void lcdcmd(char );
void lcddata1(char *);
void lcddata(char);
void lcd();
int i1,i11,i12,i2,i21,i22,i3,i31,i32,i4,i41,i42,i5,i51,i52=0;
void main()
{ on=0;
P1=0;P3=0;
while(1)
{
lcdcmd(0x38);
delay(10);
lcdcmd(0x0e) ;
delay(10);
lcdcmd(0x01);
lcdcmd(0x06) ;
delay(20) ;
lcddata1("Vote");
if(n==1)
on=1;
if(m==1&on==1)
{
if (input==0x01)
{
buzz=1;
while (input == 0x01);
i1=i1 + 1;
if(i1>=10)
i11=i1/10;
i12=i1%10;
on=0;
buzz=0;
A.Manikanta & B.Prabhukiran AEC,Bhongir
52
//ready=0;
}
if (input==0x02)
{buzz=1;
while (input == 0x02);
{
i2=i2 + 1;
if(i2>=10)
i21=i2/10;
i22=i2%10;
on=0;
buzz=0;
}
}
if (input==0x04)
{
buzz=1;
while (input ==0x04);
{
i3=i3 + 1;
if(i3>=10)
i31=i3/10;
i32=i3%10;
on=0;
buzz=0;
}
}
if (input==0x08)
{
buzz=1;
while (input == 0x08);
{
i4=i4 + 1;
if(i4>=10)
i41=i4/10;
i42=i4%10;
on=0;
buzz=0;
}
}
if (input==0x10)
{
buzz=1;
A.Manikanta & B.Prabhukiran AEC,Bhongir
53
while (input == 0x10);
{
i5=i5 + 1;
if(i5>=10)
i51=i5/10;
i52=i5%10;
on=0;
buzz=0;
}
}}
if(m==0)//else
{
if (input==0x01)
{
lcddata1(" CONGRESS=");
lcddata(i11+0x30);
lcddata(i12+0x30);
delay(100);
}
if (input==0x02)
{
lcdcmd(0x01);
lcddata1(" BJP=");
lcddata(i21+0x30);
lcddata(i22+0x30);
delay(100);
}
if (input==0x04)
{
lcdcmd(0x01);
lcddata1(" CPM&CPI=");
lcddata(i31+0x30);
lcddata(i32+0x30);
delay(100);
}
if (input==0x08)
{
lcdcmd(0x01);
lcddata1(" TDP=");
lcddata(i41+0x30);
lcddata(i42+0x30);
delay(100);
}
if(input==0x10)
A.Manikanta & B.Prabhukiran AEC,Bhongir
54
{
lcdcmd(0x01);
lcddata1(" PRP=");
lcddata(i51+0x30);
lcddata(i52+0x30);
delay(100);
}
else{
//lcdcmd(0x01);
lcddata1("result");
delay(100) ;
}}
}}
void delay(int time)
{
int i,j;
for(i=0;i<time;i++)
for(j=0;j<900;j++);
}
void lcdcmd(char value)
{
ldata=value;
rs=0;
rw=0;
en=1;
delay(2);
en=0;
}
void lcddata1(char *value)
{ int i;
for(i=0;value[i]!='0';i++)
{
ldata=value[i];
rs=1;
rw=0;
en=1;
delay(1);
en=0;
}
}
void lcddata(char value)
{
ldata=value;
rs=1;
A.Manikanta & B.Prabhukiran AEC,Bhongir
55
rw=0;
en=1;
delay(1);
en=0;
A.Manikanta & B.Prabhukiran AEC,Bhongir
56
5. PROJECT METHODOLOGY
5.1 Components:
Component Name Quantity
Microcontroller IC (AT89S52) 1
Transistor (L78O5CV) 1
Resistor 7
Diodes 4
Port Connectors 4
LED 3
Resistors 7
LCD (16X2 characters) 1
Buzzer 1
contrast controller 1
push switches 10
crystal oscillator 1
5.2 Software's used:
1. Keil uVision3.
2. Eclipse
5.3 Equipments used:
1. Soldering iron, solder, flux.
2. Personal computer.
3. DB25 connector.
A.Manikanta & B.Prabhukiran AEC,Bhongir
57
6. RESULT AND CONCLUSION
The EVM consists of a microcontroller AT89S52 16×2 LCD display, LED ,push buttons, relay
and a buzzer.
• In voting mode, the voting mode switch is in on condition.
• The EVM is ready for voting only after ready to vote button is pressed and the led is
on. The led turns off after a vote is casted along with a buzzer.
Counting the votes for individual candidate (5 in number) is done simultaneously
along with the voting and total number of votes cast to that individual can be checked
at anytime.
• In result mode, the voting mode switch is in off position.
• In result mode, the UNIT displays the votes of individual candidate, whenever the
“Result Button” of the corresponding individual is pressed.
In total, the complete system (including all the hardware components and software
routines) is working as per the initial specifications and requirements of our project.
Because of the creative nature of the design, and due to lack of time, some features could
not be fine-tuned and are not working properly. So certain aspects of the system can be
modified as operational experience is gained with it. As the users work with the system,
they develop various new ideas for the development and enhancement of the project.
A.Manikanta & B.Prabhukiran AEC,Bhongir
58
7. APPLICATIONS AND FUTURE SCOPE
APPLICATIONS
Fast track voting which could be used in small scale elections, like resident
welfare association, “panchayat” level election and other society level elections. It could also be
used to conduct opinion polls during annual share holders
meeting. It could also be used to conduct general assembly elections where number of
candidates are less than or equal to eight in the current situation
FUTURE SCOPE
Number of candidates could be increased by using other microcontroller or an 8255
IC. It could be interfaced with printer to get the hard copy of the result almost instantly
from the machine itself. It could also be interfaced with the personal computer and result could be
stored in the central server and its backup could be taken on the other backend servers. Again, once
the result is on the server it could be relayed on the network to various
offices of the election conducting authority. Thus our project could make the result
available any corner of the world in a matter of seconds
A.Manikanta & B.Prabhukiran AEC,Bhongir
59
8. REFRENCES
Muhammad Ali Mazidi , Janice Gillispie Mazidi, Rolin D. Mckinlay.
Second edition, “THE 8051 MICROCONTROLLER AND EMBEDDED
SYSTEM”
K. J. Ayala. Third edition, “The 8051 MICROCONTROLLER”
General information about electronic voting machine
www.eci.gov.in
www.eci.gov.in/faq/evm.asp
ww.eci.gov.in/Audio_VideoClips/presentation/EVM.ppt
www.rajasthan.net/election/guide/evm.htm
www.indian-elections.com/electoralsystem/electricvotingmachine.html
Tutorial on microcontroller:
www.8051projects.net/microcontroller_tutorials/
Tutorial on LCD:
www.8051projects.net/lcd-interfacing/
A.Manikanta & B.Prabhukiran AEC,Bhongir
60

More Related Content

What's hot

Full Computer Hardware Course | All concepts with Brief
Full Computer Hardware Course | All concepts with Brief Full Computer Hardware Course | All concepts with Brief
Full Computer Hardware Course | All concepts with Brief Shiv Nandan Singh
 
Introduction of computer networks
Introduction of computer networksIntroduction of computer networks
Introduction of computer networksAlidHasan4
 
Introduction to Computing - Essentials of Technology - Day 1
Introduction to Computing -  Essentials of Technology - Day 1Introduction to Computing -  Essentials of Technology - Day 1
Introduction to Computing - Essentials of Technology - Day 1Mark John Lado, MIT
 
Computer systems and software - Written by Mark John Lado
Computer systems and software - Written by Mark John LadoComputer systems and software - Written by Mark John Lado
Computer systems and software - Written by Mark John LadoMark John Lado, MIT
 
Introduction of computer Book
Introduction of computer BookIntroduction of computer Book
Introduction of computer Bookimtiazalijoono
 
Embedded system development-Arduino UNO
Embedded system development-Arduino UNOEmbedded system development-Arduino UNO
Embedded system development-Arduino UNOayush sultania
 
Chapter 2 input and output devices
Chapter 2   input and output devicesChapter 2   input and output devices
Chapter 2 input and output devicesRoelrocks
 
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...Michael Lew
 
Module5 input output storage devices
Module5 input output storage devicesModule5 input output storage devices
Module5 input output storage devicesShaharizan Hassan
 
Components of Computer
Components of ComputerComponents of Computer
Components of ComputerZunair Bhatti
 
Introduction to computer_system (for MBM first semester, BBA first semester, ...
Introduction to computer_system (for MBM first semester, BBA first semester, ...Introduction to computer_system (for MBM first semester, BBA first semester, ...
Introduction to computer_system (for MBM first semester, BBA first semester, ...RajThakuri
 
Computer peripheral or Peripheral Devices
Computer peripheral or Peripheral Devices Computer peripheral or Peripheral Devices
Computer peripheral or Peripheral Devices Adarsh Kumar Yadav
 
Types and components of computer system
Types and components of computer systemTypes and components of computer system
Types and components of computer systemmkhisalg
 
Project work of computer sc
Project work of computer scProject work of computer sc
Project work of computer scprakash9526
 
Computer Operations & Packages
Computer Operations & PackagesComputer Operations & Packages
Computer Operations & PackagesMakaha Rutendo
 
Computer Systems - Input, Process, Output
Computer Systems - Input, Process, OutputComputer Systems - Input, Process, Output
Computer Systems - Input, Process, Outputcorb201
 

What's hot (20)

Full Computer Hardware Course | All concepts with Brief
Full Computer Hardware Course | All concepts with Brief Full Computer Hardware Course | All concepts with Brief
Full Computer Hardware Course | All concepts with Brief
 
Introduction of computer networks
Introduction of computer networksIntroduction of computer networks
Introduction of computer networks
 
Introduction to Computing - Essentials of Technology - Day 1
Introduction to Computing -  Essentials of Technology - Day 1Introduction to Computing -  Essentials of Technology - Day 1
Introduction to Computing - Essentials of Technology - Day 1
 
Computer systems and software - Written by Mark John Lado
Computer systems and software - Written by Mark John LadoComputer systems and software - Written by Mark John Lado
Computer systems and software - Written by Mark John Lado
 
Introduction of computer Book
Introduction of computer BookIntroduction of computer Book
Introduction of computer Book
 
Embedded system development-Arduino UNO
Embedded system development-Arduino UNOEmbedded system development-Arduino UNO
Embedded system development-Arduino UNO
 
Chapter 2 input and output devices
Chapter 2   input and output devicesChapter 2   input and output devices
Chapter 2 input and output devices
 
Ict basics
Ict basicsIct basics
Ict basics
 
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...
ICDL Module 1 - Concepts of ICT (Information and Communication Technology) - ...
 
Module5 input output storage devices
Module5 input output storage devicesModule5 input output storage devices
Module5 input output storage devices
 
Components of Computer
Components of ComputerComponents of Computer
Components of Computer
 
Introduction to computer_system (for MBM first semester, BBA first semester, ...
Introduction to computer_system (for MBM first semester, BBA first semester, ...Introduction to computer_system (for MBM first semester, BBA first semester, ...
Introduction to computer_system (for MBM first semester, BBA first semester, ...
 
Computer basics
Computer basicsComputer basics
Computer basics
 
Computer peripheral or Peripheral Devices
Computer peripheral or Peripheral Devices Computer peripheral or Peripheral Devices
Computer peripheral or Peripheral Devices
 
Types and components of computer system
Types and components of computer systemTypes and components of computer system
Types and components of computer system
 
Project work of computer sc
Project work of computer scProject work of computer sc
Project work of computer sc
 
Computer Operations & Packages
Computer Operations & PackagesComputer Operations & Packages
Computer Operations & Packages
 
IMD 203 - Ch09
IMD 203 - Ch09IMD 203 - Ch09
IMD 203 - Ch09
 
Computer Systems - Input, Process, Output
Computer Systems - Input, Process, OutputComputer Systems - Input, Process, Output
Computer Systems - Input, Process, Output
 
It2 شرحa
It2 شرحaIt2 شرحa
It2 شرحa
 

Viewers also liked

Screenless displays seminar report
Screenless displays seminar reportScreenless displays seminar report
Screenless displays seminar reportJeevan Kumar D
 
Screenless display report
Screenless display reportScreenless display report
Screenless display reportVikas Kumar
 
Web Vulnerability Scanner project Report
Web Vulnerability Scanner project ReportWeb Vulnerability Scanner project Report
Web Vulnerability Scanner project ReportVikas Kumar
 
E-BALL TECHNOLOGY SEMINAR REPORT
E-BALL TECHNOLOGY SEMINAR REPORTE-BALL TECHNOLOGY SEMINAR REPORT
E-BALL TECHNOLOGY SEMINAR REPORTVikas Kumar
 
screen less display documentation
screen less display documentationscreen less display documentation
screen less display documentationmani akuthota
 
Screenless displays ppt
Screenless displays ppt Screenless displays ppt
Screenless displays ppt Jeevan Kumar D
 

Viewers also liked (7)

Screenless displays seminar report
Screenless displays seminar reportScreenless displays seminar report
Screenless displays seminar report
 
Screenless display report
Screenless display reportScreenless display report
Screenless display report
 
Web Vulnerability Scanner project Report
Web Vulnerability Scanner project ReportWeb Vulnerability Scanner project Report
Web Vulnerability Scanner project Report
 
E-BALL TECHNOLOGY SEMINAR REPORT
E-BALL TECHNOLOGY SEMINAR REPORTE-BALL TECHNOLOGY SEMINAR REPORT
E-BALL TECHNOLOGY SEMINAR REPORT
 
screen less display documentation
screen less display documentationscreen less display documentation
screen less display documentation
 
Screenless display
Screenless display Screenless display
Screenless display
 
Screenless displays ppt
Screenless displays ppt Screenless displays ppt
Screenless displays ppt
 

Similar to electronic voting machine document

137.gsm, fprs ,keypad_based_atm_security_(doc)
137.gsm, fprs ,keypad_based_atm_security_(doc)137.gsm, fprs ,keypad_based_atm_security_(doc)
137.gsm, fprs ,keypad_based_atm_security_(doc)Karteek Irukulla
 
Digital Design With Systemc (with notes)
Digital Design With Systemc (with notes)Digital Design With Systemc (with notes)
Digital Design With Systemc (with notes)Marc Engels
 
Introduction to embeded system
Introduction to embeded systemIntroduction to embeded system
Introduction to embeded systemharman1991
 
Integrating sensors to sensor processing boards.docx
Integrating sensors to sensor processing boards.docxIntegrating sensors to sensor processing boards.docx
Integrating sensors to sensor processing boards.docxSVITSEEERK
 
Gesture control robot using accelerometer documentation
Gesture control robot using accelerometer documentationGesture control robot using accelerometer documentation
Gesture control robot using accelerometer documentationRajendra Prasad
 
Computer Fundamentals
Computer FundamentalsComputer Fundamentals
Computer Fundamentalsmaclather
 
Data Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time ApplicationsData Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time Applicationsijsrd.com
 
NEW Advanced low cost voice recognition based smart homeoffice
NEW Advanced low cost voice recognition based smart homeofficeNEW Advanced low cost voice recognition based smart homeoffice
NEW Advanced low cost voice recognition based smart homeofficemohammed shoaib uddin
 
Advanced Security System using PIC through Bluetooth
Advanced Security System using PIC through BluetoothAdvanced Security System using PIC through Bluetooth
Advanced Security System using PIC through Bluetoothijtsrd
 
5 pen pc technology
5 pen pc technology5 pen pc technology
5 pen pc technologyNikhil Nama
 
intership ppt see.pptx
intership ppt see.pptxintership ppt see.pptx
intership ppt see.pptxManojG81
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanabhimaha09
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanAbhishek Mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajanAbhishek Mahajan
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system DesignAJAL A J
 

Similar to electronic voting machine document (20)

137.gsm, fprs ,keypad_based_atm_security_(doc)
137.gsm, fprs ,keypad_based_atm_security_(doc)137.gsm, fprs ,keypad_based_atm_security_(doc)
137.gsm, fprs ,keypad_based_atm_security_(doc)
 
Digital Design With Systemc (with notes)
Digital Design With Systemc (with notes)Digital Design With Systemc (with notes)
Digital Design With Systemc (with notes)
 
Introduction to embeded system
Introduction to embeded systemIntroduction to embeded system
Introduction to embeded system
 
Integrating sensors to sensor processing boards.docx
Integrating sensors to sensor processing boards.docxIntegrating sensors to sensor processing boards.docx
Integrating sensors to sensor processing boards.docx
 
Lenovo S10-3
Lenovo S10-3Lenovo S10-3
Lenovo S10-3
 
Chapter 2(answer)2
Chapter 2(answer)2Chapter 2(answer)2
Chapter 2(answer)2
 
Hardware
HardwareHardware
Hardware
 
Gesture control robot using accelerometer documentation
Gesture control robot using accelerometer documentationGesture control robot using accelerometer documentation
Gesture control robot using accelerometer documentation
 
Computer Fundamentals
Computer FundamentalsComputer Fundamentals
Computer Fundamentals
 
Data Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time ApplicationsData Acquisition and Control System for Real Time Applications
Data Acquisition and Control System for Real Time Applications
 
NEW Advanced low cost voice recognition based smart homeoffice
NEW Advanced low cost voice recognition based smart homeofficeNEW Advanced low cost voice recognition based smart homeoffice
NEW Advanced low cost voice recognition based smart homeoffice
 
Advanced Security System using PIC through Bluetooth
Advanced Security System using PIC through BluetoothAdvanced Security System using PIC through Bluetooth
Advanced Security System using PIC through Bluetooth
 
embedded systems
embedded systemsembedded systems
embedded systems
 
5 pen pc technology
5 pen pc technology5 pen pc technology
5 pen pc technology
 
intership ppt see.pptx
intership ppt see.pptxintership ppt see.pptx
intership ppt see.pptx
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded system by abhishek mahajan
Embedded system by abhishek mahajanEmbedded system by abhishek mahajan
Embedded system by abhishek mahajan
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system Design
 
Embedded Systems
Embedded SystemsEmbedded Systems
Embedded Systems
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

electronic voting machine document

  • 1. A.Manikanta & B.Prabhukiran AEC,Bhongir 1 1. INTRODUCTION TO EMBEDDED SYSTEMS An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs pre-defined tasks, usually with very specific requirements. Since the system is dedicated to a specific task, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, so the cost savings may be multiplied by millions of items. Physically, embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure. Embedded systems contain processing cores that are either microcontrollers or digital signal processors (DSP). The key characteristic, however, is being dedicated to handle a particular task. Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale. Robotics and automation are a part of embedded systems itself. Robot development and automation needs study of embedded systems. Examples of Embedded System:- I. automatic teller machines (ATMs) II. avionics, such as inertial guidance systems, flight control hardware/software and other integrated systems in aircraft and missiles III. cellular telephones and telephone switches IV. computer equipment such as routers and printers V. engine controllers and antilock brake controllers for automobiles VI. home automation products, like thermostats, air conditioners, sprinklers, and security monitoring systems VII. handheld calculators VIII. household appliances, including microwave ovens, washing machines, television sets IX. medical equipment X. handheld computers XI. videogame consoles
  • 2. A.Manikanta & B.Prabhukiran AEC,Bhongir 2 1.2.SOFTWARE DEVELOPEMENT 1.2.1 ECLIPSE 1.2.1.1 INTRODUCTION Developing programs using a text editor such as TextPad is simple and straightforward.While such editors allow students to begin programming with a minimum of distractions, asprograms become larger and more complicated, a more sophisticated tool for developingprograms is quite valuable. In this chapter, we examine one particular tool for developinglarge programs, the Eclipse system. Eclipse can be used to develop programs in Java and inC/C++ (plus various other languages as well). In this chapter, we examine how to install Eclipse. 1.2.2 INTERACTIVE DEVELOPMENT ENVIRONMENTS Interactive development environments (IDE) provide a wealth of features to support the programmer that are not available in a simple editor. There are many IDE’s currently available, some are shareware and some must be purchased and are often expensive. Most IDE’s provide similar facilities, such as the ability to view different classes at the same time, debuggers that step through a program line-by- line in order to assist in locating errors, etc. One of the newest and most popular IDE’s is the Eclipse IDE which is available at no cost from the Eclipse website (http://www.eclipse.org/). 1.2.3 THE ECLIPSE IDE Eclipse is an IDE (actually it is more than an IDE but we will concentrate on Eclipse as an IDE) that was initially controlled by IBM but then IBM released the source code for Eclipse, making the project open source. Eclipse development is taking place in several cities, including Winnipeg, Ottawa, and Zurich, although there is also a large community of programmers who provide extensions to Eclipse in order to improve the Eclipse environment. The facilities in Eclipse can be extended by defining “plug- ins” which provide additional features or support additional languages.. Eclipse runs on most operating systems, including Unix, Linux, Windows, and Mac OS X. 1.2. 4 TINA PRO :- THE COMPLETE ELECTRONICS LAB FOR WINDOWS INTRODUCTION:-TINA is a powerful yet affordable software package for designing, simulating and analyzing electronic circuits. It works equally well with linear and nonlinear analog circuits, digital and mixed circuits. Analysis results can be displayed as sophisticated diagrams or on a range of virtual instruments. Comprehensive DTP tools and powerful text and equation editors can be used to produce professional reports and presentations. The standard library contains over 20000 components and can be extended by the user. Electronics engineers will find TINA an invaluable, easy to use and high performance tool. TINA can also be used in the training environment. It includes unique tools for testing students’ knowledge, monitoring progress and introducing troubleshooting techniques. With
  • 3. A.Manikanta & B.Prabhukiran AEC,Bhongir 3 optional hardware it can be used to test real circuits for comparison with the results obtained from simulation. Of great importance to educators, the package includes all the tools needed to prepareeducational materials. The circuit diagrams and the calculated or measured results can be printed or saved to files in standard Windows WMF format. These output files can be processed by a number of well known software packages (Microsoft Word, Corel Draw etc.). Net lists can be exported and imported in Pspice format and also to drive popular PCB packages such as ORCAD, TANGO, PCAD, PROTEL, REDAC and EDS. TINA has special operating modes for training and for examination. In these modes, under TINA’S control, the students solve problems assigned by the teacher. The solution format depends on the types of problems: they can be selected from a list, calculated numerically, or given in symbolic form. The interpreter - providing a number of solution tools - can also be used for problem solving. If the student cannot solve the problem, he/she can turn to the multi-level Advisor. The package includes all the tools needed to produce educational materials. A collection of examples and problems worked out by teachers is also part of the package. Another special educational function of TINA is the software or hardware simulation of circuit faults to practice troubleshooting. Using TINA, you can transform existing PC classrooms into contemporary electronics training labs at low cost. THE BASIC SCREEN FORMAT:- 1. The menu bar 2. The cursor or pointer
  • 4. A.Manikanta & B.Prabhukiran AEC,Bhongir 4 3. The Schematic window 4. The Tool bar 5. The Component bar 6. Find component tool 7. Open files tab 8. The TINA Task bar 9. The Help line
  • 5. A.Manikanta & B.Prabhukiran AEC,Bhongir 5 1.3.PCB DESIGNING 1.3.1 INTRODUCTION:- PCB Stands for "Printed Circuit Board." A PCB is a thin board made of fiberglass, composite epoxy, or other laminate material. Conductive pathways are etched or "printed" onto board, connecting different components on the PCB, such as transistors, resistors, and integrated circuits. PCBs are used in both desktop and laptop computers. They serve as the foundation for many internal computer components, such as video cards, controller cards, network interface cards, and expansion cards. These components all connect to the motherboard, which is also a printed circuit board. While PCBs are often associated with computers, they are used in many other electronic devices besides PCs. Most TVs, radios, digital cameras, cell phones, and tablets include one or more printed circuit boards. While the PCBs found in mobile devices look similar to those found in desktop computers and large electronics, they are typically thinner and contain finer circuitry. HISTORY : The inventor of the printed circuit was the Austrian engineer Paul Eisler (1907–1995) who, while working in England, made one circa 1936 as part of a radio set. MATERIAL: Conducting layers are typically made of thin copper foil. Insulating layers dielectric are typically laminated together with epoxy resin prepreg. The board is typically coated with a solder mask that is green in color. Other colors that are normally available are blue and red. There are quite a few different dielectrics that can be chosen to provide different insulating values depending on the requirements of the circuit. Some of these dielectrics are polytetrafluoroethylene (Teflon), FR-4, FR-1, CEM-1 or CEM-3. Well known prepreg materials used in the PCB industry are FR-2 (Phenolic cotton paper), FR-3 (Cotton paper and epoxy), FR-4 (Woven glass and epoxy), FR-5 (Woven glass and epoxy), FR-6(Matte glass and polyester), G-10(Woven glass and epoxy), CEM- 1 (Cotton paper and epoxy), CEM-2 (Cotton paper and epoxy), CEM-3 (Woven glass and epoxy),CEM-4 (Woven glass and epoxy), CEM-5 (Woven glass and polyester). Thermal expansion is an important consideration especially with BGA and naked die technologies, and glass fiber offers the best dimensional stability. 1.3.2 TYPES OF PRINTED CIRCUIT BOARDS Single Sided Board:-This is the least complex of the Printed Circuit Boards, since there is only a single layer of substrate. All electrical parts and components are fixed on one side and copper traces are on the other side. Double Sided Board:-This is the most common type of board, where parts and components are attached to both sides of the substrate. In such cases, double-sided PCBs that have connecting traces
  • 6. A.Manikanta & B.Prabhukiran AEC,Bhongir 6 on both the sides are used. Double-sided Printed Circuit Boards usually use through-hole construction for assembly of components. Multi Layered Board:-Multi layered PCB consists of several layers of substrate separated by insulation. Most common multilayer boards are: 4 layers, 6 layers, 8 layers, and 10 layers. However, the total number of layers that can be manufactured can exceed over 42 layers. These types of boards are used in extremely complex electronic circuits. 1.3.3 PCB DESIGN STEPS IN OrCad 10.5 1.3.3.1 ENTRY OF SCHEMATIC DIAGRAM Schematic diagram provides the functional flow and the graphical representation of an electronic circuit. The entry of schematic diagram is the first step in PCB design using OrCad. A schematic diagram consists of:-  Electrical connections(nets)  Junctions  Integrated circuits symbols  Discrete components symbols like resistors, capacitors etc.  Input / output connectors  Power and ground symbols  Buses  No connection symbols  Components reference names  Text 1.3.3.2 THE SCHEMATIC PAGE EDITOR: The schematic page editor is used to display and edit schematic pages. So that one can parts; wires; buses and draw graphics. The schematic page editor has a tool palette that you can use to draw and place everything you need to create a schematic page. One can print from within the schematic page editor, or from the project window.
  • 7. A.Manikanta & B.Prabhukiran AEC,Bhongir 7 Fig 1.3.1 Schematic Page Editor 1.3.3.3 THE PART EDITOR: The part editor is used to create and edit parts. From the view menu of the part editor you can choose either part or package. In part view one can:-  Create and edit parts and symbols, then store in new or existing libraries.  Create and edit power and ground symbols, off-page connector symbols, and title block  Use the tool palette’s electrical tools to place pins on parts, and its drawing tools to draw parts and symbols. 1.3.3.4 THE SESSION LOG: The session log lists the events that have occurred during the current Capture session, includes message resulting from using capture’s tools. To display context-sensitive help for an error message, put the cursor in the error message line in the session log press F1.The ruler along the top appears in either inches or mill meters, depending on which measurement system is selected in the window panel. Your tab setting are saved and used each time you start capture.
  • 8. A.Manikanta & B.Prabhukiran AEC,Bhongir 8 Fig 1.3.2 Session Log window One can search for information in the session log using the find command on the Edit menu. You can also save the contents of the of the session log to a file, which is useful when working with Orcad’s technical support to solve technical problems. The default filename is SESSION.TXT. 1.3.3.5 THE TOOLBAR:Capture’s toolbar is dock able (that means you can select and drag the toolbar to new location) as well as resizable, and displays tool tips for each tool; by choosing a tool button you can quickly perform a task. If tool button is dimmed, you can’t perform that task in the current situation. Fig 1.3.3 Toolbar Some of the tools operate only on what you have selected, while others give you a choice of either operating on what is selected or expanding the scope to entire project. You can hide the toolbar, then display it again when u need it. For hiding select from the schematic page editor’s view menu, choose TOOLBAR. 1.3.3.6 THE TOOL PALETTE:Capture has two tool palettes: one for the schematic page editor and one for the part editor. Both tool palettes are dock able and resizable. They can also display tool tips that identify each tool. The drawing tools on the two tool palettes are identical, however, each tool palette has different electrical tools after you choose a tool, and you press the right mouse button to display a context- sensitive pop-up menu.
  • 9. A.Manikanta & B.Prabhukiran AEC,Bhongir 9 1.3.3.7 THE SCHEMATIC PAGE EDITOR TOOL PALETTE: The first group of tools on the tool palette is electrical tools, used to place electrical connectivity objects. The second group of tools is Drawing tools, used to create graphical objects without electrical connectivity. Fig1.3.4 schematic page editor tool palette 1.3.3.8 THE PART EDITOR TOOL PALETTE: The first group of tools on the part palette is electrical tools, used to place pins and symbols. They have been already explained above within the schematic page editor tools. The second group of tools is drawing tools, used to create graphical objects without objects any electrical connectivity and is described: Pin Tools: Place pins on part Pin Array: Place multiple pins on part 1.3.4 CREATING NET LIST FILE Net-list file is a document file which contains information about the logical interconnections between signals and pins. Before one create a net list file, be sure one’s project is completed, annotated and it is free from electrical rule violations. A net list file consists of nets, components, connectors, junctions, no connection symbol, power and ground symbols. 1.3.4.1 CREATION OF NET LIST IN CAPTURE:  Select your design in the project manager.  From the tools, choose create net list. The net list dialog box displays.  Choose a net list format tab.  If necessary, set the part value and PCB foot print combined property strings to reflect the information you want in the net list.  Click ok to create the net list.  In the net list file text box, enter a name for the output file. If the selected format creates an additional file, enter its file name in the second text box.
  • 10. A.Manikanta & B.Prabhukiran AEC,Bhongir 10 1.3.5 LAYOUT PLUS Layout plus is one part for the PCB design in which we place as well as route the components an set unit of measurement, grids, and spacing in OrCad. Within other soft wares you also have to place and route the components in similar way. For the placement and routing of the components we normally use auto-placement and auto-routing. Unfortunately, in a lot of soft wares some critical signals have to be routed manually before auto-routing. In layout plus we also define the layer stacks, pad stacks and via's. 1.3.5.1 STEPS FOR BOARD DESIGN:  At first, we have created a net list from our schematic diagram by using capture.  Layout plus includes design rules in order to guide logical placement and routing. That means, load the net list into layout to create the board. At the same time you have to specify the board parameters.  Specify board parameters: Specifying global setting for the board, including nits of measurements, grid, and spacing  Place components: Use the components tool in order to place manually the components which are fixed by the system designer on the board or otherwise use auto-placement.  Route the board: Use different routing technologies to route the board and take advantage of push and shove (a routing technology), which moves track you are currently routing as well as you can also auto route the board.  Provide finishing of the board: Layout supplies an ordered progression of commands on the auto menu for finishing your design. These commands include design rule check, cleanup design, rename components, back annotate, run post processor, and create reports. 1.3.5.2 THE DESIGN WINDOW: The design window provides a graphical display of printed circuit board, it is primary window you use when designing your board. It also provides tools to facilitate the design process such as to update components and design rule violation.
  • 11. A.Manikanta & B.Prabhukiran AEC,Bhongir 11 Fig 1.3.5 design window 1.3.5.3 MAIN WINDOW: Method to create a board with Layout Plus:  Ensure that net list with all footprints and necessary information has been created.  Create a directory in which the schematic design, net list, and boar will co-exit and put the schematic design and net list. OrCad provides a directory for this purpose.  From the layout session frame’s file menu, choose New. The load template file in the dialog box displayed. Fig 1.3.6 main window
  • 12. A.Manikanta & B.Prabhukiran AEC,Bhongir 12 1.3.5.4 DESIGN STEPS:  Select the technology template (.TCH), then choose the open button and load the net list in other box.  Then apply the auto ECO.  If necessary, respond to link footprints to component dialog.  Draw the board outline by using the obstacle tool in the tool bar. 1.3.5.5 SETTING BOARD PARAMETERS: There is some parameter which should be set before placing the components on board. They are as follows:-  Set Datum  Create a board outline  Set units of measurements  Set system grid  Add mount holes 1.3.5.6 CREATING OF BOARD OUTLINE: Board outline is the graphical representation of the size of the actual PCB board. So it is the main step in layout, to draw the board outline of the actual size of PCB board. 1.3.5.7 PLACEMENT OF COMPONENTS: Placement of components means that to place the components in designed box. A designer should follow the following steps before going for it:-  Optimize the board for component placement.  Load the placement strategy file.  Place components on the board.  Optimize placement using various placements Components can be placed by using two techniques:- 1) Manual placement of components 2) Auto placement of components Choose the components tool bar button. From the pop up men, choose the queue for placement. The components selection criteria dialog box appears. Enter the reference designator of the components that you want to place in the appropriate text box, and click ok. Drag the components to desired location, place it there.
  • 13. A.Manikanta & B.Prabhukiran AEC,Bhongir 13 1.3.5.8 CONDUCTOR ROUTING IN LAYOUT:- After placing all the components the other main step is to route the board from the electrical connections between the components. One may route board manually or automatically by auto router. 100% auto routing can be achieved only when components are placed in the order of functional flow of electronic circuit. The main routing tool available in OrCad is as flow:-  Add/edit route mode  Edit segment mode  Shove track mode  Auto path route mode 1.3.5.9 DESIGN RULE CHECK:- In manual designs every thing was checked as a possible source of error. Components sizes, hole sizes, conductor widths and clearance, land-to-hole-ratio, board areas to be free of components, clearance to the edges, positional accuracy and of course electrical interconnections had tad to be personally reviewed with a great deal of care. After completing the design of printed circuit board with the help of an EDA-Tool, a designer has again to verify the PCB in order to find out errors.
  • 14. A.Manikanta & B.Prabhukiran AEC,Bhongir 14 1.4.THE 8051 MICROCONTROLLER 1.4.1 INTRODUCTION The microcontroller incorporates all the features that are found in microprocessor. The microcontroller has built in ROM, RAM, Input Output ports, Serial Port, timers, interrupts and clock circuit. A microcontroller is an entire computer manufactured on a single chip. Microcontrollers are usually dedicated devices embedded within an application. For example, microcontrollers are used as engine controllers in automobiles and as exposure and focus controllers in cameras. In order to serve these applications, they have a high concentration of on-chip facilities such as serial ports, parallel input output ports, timers, counters, interrupt control, analog-to-digital converters, random access memory, read only memory, etc. The I/O, memory, and on-chip peripherals of a microcontroller are selected depending on the specifics of the target application. Since microcontrollers are powerful digital processors, the degree of control and programmability they provide significantly enhances the effectiveness of the application. The 8051 is the first microcontroller of the MCS-51 family introduced by Intel Corporation at the end of the 1970s. The 8051 family with its many enhanced members enjoys the largest market share, estimated to be about 40%, among the various microcontroller architectures. The microcontroller has on chip peripheral devices. In this unit firstly we differentiate microcontroller from microprocessor then we will discuss about Hardware details of 8051 and then introduce the Assembly level language in brief. MICROCONTROLLERS  Microcontroller (MC) may be called computer on chip since it has basic features of microprocessor with internal ROM, RAM, Parallel and serial ports within single chip. Or we can say microprocessor with memory andports is called as microcontroller. This is widely used in washing machines, vcd player, microwave oven, robotics or in industries.  Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.  8 bit microcontroller, means it can read, write and process 8 bit data. Ex. 8051 microcontroller. Basically 8 bit specifies the size of data bus. 8 bit microcontroller means 8 bit data can travel on the data bus or we can read, write process 8 bit data. 1.4.2 MICROCONTROLLER FAMILIES 8051- These microcontrollers are old but still trendy and most of the companies fabricate these microcontrollers. The older types of 8051 have 12 clocks per instruction that make it sluggish whereas the recent 8051 have 6 clocks per instruction. The 8051 microcontroller does not have an in built memory bus and A/D converters. In 1980, Intel fabricated the single chip microcontroller 8051 with Harvard architecture.
  • 15. A.Manikanta & B.Prabhukiran AEC,Bhongir 15 PIC- Programmable Interface Controller is usually referred as PIC. They are slightly older than 8051 microcontrollers but excel cause of their small low pin count devices. They perform well and are affordable. The Microchip technology fabricated the single chip microcontroller PIC with Harvard architecture. The programming part is very tedious and hence it is not recommended for beginners. AVR(Advanced Version RISC) - In 1996, Atmel fabricated this single chip microcontroller with a modified Harvard Architecture. This chip is loaded with C- compiler, Free IDE and many more features. This microcontroller is a bit difficult for the starters to handle. 1.4.3 DIFFERENCE BETWEEN MICROCONTROLLER AND MICROPROCESSOR:- It is very clear from figure that in microprocessor we have to interface additional circuitry for providing the function of memory and ports, for example we have to interface external RAM for data storage, ROM for program storage, programmable peripheral interface (PPI) 8255 for the Input Output ports, 8253 for timers, Sartor serial port. While in the microcontroller RAM, ROM, I/O ports, timers and serial communication ports are in built. Because of this it is called as “system on chip”. So in micro-controller there is no necessity of additional circuitry which is interfaced in the microprocessor because memory and input output ports are inbuilt in the microcontroller. Microcontroller gives the satisfactory performance for small applications. But for large applications the memory requirement is limited because only 64 KB memory is available for program storage. So for large applications we prefer microprocessor than microcontroller due to its high processing speed.
  • 16. A.Manikanta & B.Prabhukiran AEC,Bhongir 16 1.4.4 PIN DIAGRAM OF 8051:- Pins 1-8 (Port 1) - Each of these pins can be configured as an input or an output. Pin 9 (Reset) - A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning. Pins 10- 17 (Port 3) -Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions: Pin 10 (RXD) - Serial asynchronous communication input or Serial synchronous communication output. Pin 11(TXD) - Serial asynchronous communication output or Serial synchronous communication clock output. Pin 12 (INT 0) - Interrupt 0 input.
  • 17. A.Manikanta & B.Prabhukiran AEC,Bhongir 17 Pin 13(INT 1) - Interrupt 1 input. Pin 14(T0) - Counter 0 clock input. Pin 15(T1) - Counter 1 clock input. Pin 16(WR) -Write to external (additional) RAM. Pin 17 (RD) -Read from external RAM. Pin 18 and 19(X1, X2) - Internal oscillator input and output. A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz. Pin 20 (GND) - Ground. Pin 21-28 (Port 2) - If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8- A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs. Pin 29 (PSEN) - If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory. Pin 30 (ALE) - Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission. Pin 31 (EA) - By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists). Pin 32-39 (Port 0) - Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0). Pin 40 (Vcc) - +5V power supply.
  • 18. A.Manikanta & B.Prabhukiran AEC,Bhongir 18 1.4.5 MICROCONTROLLER 8051 ARCHITECTURE It is 8-bit microcontroller, means MC 8051 can Read, Write and Process 8 bit data. This is mostly used microcontroller in the robotics, home appliances likemp3 player, washing machines, electronic iron and industries. Mostly used blocks in the architecture of 8051 are as follows: Address bus-For a device (memory or I/O) to be recognized by the CPU, it must be assigned an address. The address assigned to a given device must be unique. The CPU puts the address on the address bus, and the decoding circuitry finds the device. Data bus-The CPU either gets data from the device or sends data to it. Control bus-Provides read or write signals to the device to indicate if the CPU is asking for information or sending it information . 1.4.6 Memoryand Registers The 8051 microcontroller has a total of 256 bytes of RAM in which 128 is visible or useraccessible and extra 128 is for special function registers. The user accessible RAM is used for temporary data storage. The user accessible RAM is from the address range 00 to 7Fh.From the user accessible RAM, 32 bytes of RAM is used for registers and rest for Stack operations. The 32 Bytes of RAM is divided into four register Banks i.e. Bank0, Bank 1, Bank 2, Bank3. Each of these banks have 8 Registers i.e. R0 to R7 each.
  • 19. A.Manikanta & B.Prabhukiran AEC,Bhongir 19 RAM locations from 0 to 7 are set aside for bank 0 of R0 – R7 where R0 is RAM location 0, Rl is RAM location 1, and R2 is location 2, and so on, until memory location 7, which belongs to R7 of bank 0. The second bank of registers R0 – R7 starts at RAM location 08 and goes to location 0FH. The third bank of R0 – R7 starts at memory location 10H and goes to location 17H. Finally, RAM locations 18H to 1FH are set aside for the fourth bank of R0 – R7. Generally for normal operations, Register bank Bank0 is set by default. But we can switch to other banks by using PSW Commands. SFRs (Special Function Register) - These Registers are in extra 128 bytes of the memory. This part of memory is not user accessible and these registers are used for special purposes. These registers range from 80h to FFh. There are a total of only 21 SFRs in this range and all other addresses from 80h to FFh are invalid and there use can cause errors and not valuable results. Some of the SFRs are TCON, SBUF, ACC, B, SCON, TMOD SP, P0, PSW, TL0, and TL1. These all the registers have some specific function that has to be performed after they are programmed. Byte Addressable SFR with byte address SP – Stack printer – 81H DPTR – Data pointer 2 bytes DPL – Low byte – 82H DPH – High byte – 83H
  • 20. A.Manikanta & B.Prabhukiran AEC,Bhongir 20 TMOD – Timer mode control – 89H TH0 – Timer 0 Higher order bytes – 8CH TL0 – Timer 0 Low order bytes – 8AH TH1 – Timer 1 High bytes = 80H TL1 – Timer 1 Low order byte = 86H SBUF – Serial data buffer = 99H PCON – Power control – 87H. DPTR - Data Pointer in 8051  16 bit register; it is divided into two parts DPH and DPL.  DPH for Higher order 8 bits, DPL for lower order 8 bits.  DPTR, DPH, DPL these all are SFRs in 8051. 1. 4.7 Timers and Counters: The 8051 has two timers T0 and T1, which may be configured and used individually. The 8052 has an additional Timer T2.All these counters count up on negative going edges at their inputs. These can be used as event counters (where they count the number of negative transitions on a pin connected to some external source), or as Timers, where they count up once every twelfth clock cycle. A special use of timers is for generating baud rates for the serial port. The usage of these timers is somewhat different from common general purpose timer/counters such as the 8253 and 8254. This difference stems partly from the fact that we cannot afford to have a large numbers of pins dedicated to the functioning of these timer counters. Thus, just two multifunction pins are used as external inputs in 8051. Gating is accomplished by control bits in the special function registers, and using the external interrupt pins as gate inputs. There are no output pins associated with the timers. The processor can be interrupted by the timers and as a part of the interrupt service routine, the processor can performing IO function through its ports. When used as baud rate generators, the output goes directly to the serial port hardware within the microcomputer. 8051 timers always count up. Each counter has a 16 bit count register in the SFR area. The low and high bytes can be accessed as separate bytes. When their count rolls over from the maximum count to 0000, they set the corresponding timer flag (TF1 or TF0) in TCON. The 8051 can be set up so that an interrupt occurs whenever TF1 or TF0 is set. when 8051 branches to the interrupt vector, it automatically clears the TF flag. Timer means which can give the delay of particular time between some events. For example on or off the lights after every 2 sec. This delay can be provided through some assembly program but in microcontroller two hardware pins are available for delay generation. These hardware pins can be
  • 21. A.Manikanta & B.Prabhukiran AEC,Bhongir 21 also used for counting some external events. How much times a number is repeated in the given table is calculated by the counter. • In MC8051, two timer pins are available T0 and T1, by these timers we can give the delay of particular time if we use these in timer mode. • We can count external pulses at these pins if we use these pins in counter mode. • 16 bits timers are available. Means we can generate delay between 0000H to FFFFH. • Two special function registers are available. • In the same way for T1. • TMOD, TCON registers are used for controlling timer operation. Basic registers of the timer Timer 0 and Timer 1 are 16 bits wide each 16-bit timer is accessed as two separate registers of low byte and high byte. Timer 0 registers low byte register is called TL0 (Timer 0 low byte) and the high byte register is referred to as TH0 (Timer 0 high byte) can be accessed like any other register, such as A, B, R0, R1, R2, etc. "MOV TL0, #4 FH" moves the value 4FH into TL0 "MOV R5, TH0" saves TH0 (high byte of Timer 0) in R5 Timer 1 registers also 16 bits split into two bytes TL1 (Timer 1 low byte) and TH1 (Timer 1 high byte) accessible in the same way as the registers of Timer 0.
  • 22. A.Manikanta & B.Prabhukiran AEC,Bhongir 22 TMOD (timer mode) register timers 0 and 1 use TMOD register to set operation modes (only learn Mode 1 and 2) 8-bit register lower 4 bits are for Timer 0 upper 4 bits are for Timer 1 lower 2 bits are used to set the timer mode (only learn Mode 1 and 2) upper 2 bits to specify the operation (only learn timer operation) Clock source for timer timer needs a clock pulse to tick if C/T = 0, the crystal frequency attached to the 8051 is the source of the clock for the timer frequency for the timer is always 1/12th the frequency of the crystal attached to the 8051 XTAL = 11.0592 MHz allows the 8051 system to communicate with the PC with no errors In our case, the timer frequency is 1MHz since our crystal frequency is 12MHz Using Windows calculator to find TH, TL Windows scientific calculator can be use to find the TH, TL values Lets say we would like to find the TH, TL values for a time delay that uses 35,000 clocks of 1.085ms open scientific calculator and select decimal enter 35,000 select hex - converts 35,000 to hex 88B8H select +/- to give -35000 decimal (7748H) the lowest two digits (48) of this hex value are for TL and the next two (77) are for TH
  • 23. A.Manikanta & B.Prabhukiran AEC,Bhongir 23 C/T bit in TMOD register used as a timer, the 8051's crystal is used as the source of the frequency used as a counter, pulse outside the 8051 increments the TH, TL registers counter mode, TMOD and TH, TL registers are the same as for the timer timer modes are the same as well C/T bit in TMOD register C/T bit in the TMOD register decides the source of the clock for the timer C/T = 0, timer gets pulses from crystal C/T = 1, the timer used as counter and gets pulses from outside the 8051 C/T = 1, the counter counts up as pulses are fed from pins 14 and 15 pins are called T0 (Timer 0 input) and T1 (Timer 1 input) these two pins belong to port 3 Timer 0, when C/T = 1, pin P3.4 provides the clock pulse and the counter counts up for each clock pulse coming from that pin Timer 1, when C/T = 1 each clock pulse coming in from pin P3.5 makes the counter count up TCON register TR0 and TR1 flags turn on or off the timers bits are part of a register called TCON (timer control) upper four bits are used to store the TF and TR bits of both Timer 0 and Timer 1 lower four bits are set aside for controlling the interrupt bits SETB TRl" and "CLR TRl“ "SETB TCON. 6" and "CLR TCON. 6“ Timer Functions When used as timers, the 8051 timers count up every 12th clock cycle. This is selected by clearing the corresponding C/T flags in the TMOD special function register, placed at the address 89H.
  • 24. A.Manikanta & B.Prabhukiran AEC,Bhongir 24 Timer modes The timers may operate in one of four modes: Mode 0 In this mode, the timers act as 13 bit counters. This mode is largely meant for providing compatibility with an older microcontroller from Intel(8048). This mode is practically never used in fresh designs. Except for the counter size, this mode is identical to mode 1. Mode 1 In this mode, the timers are 16 bits in size. This is a commonly used mode. It is common to configured the timer to cause an interrupt when it overflows. The interrupt routine then reloads the timer. Mode 2 This mode provides an 8 bit counter with auto-reload. It uses the high byte of the count register to store the count value and the low byte as the actual counter. The counter is automatically re-loaded from TH when it overflows. Thus, there is no software overhead for re-loading the registers. This is convenient for generating baud rates etc. The timing resolution is much lower in this mode (only 8 bits). Therefore crystal frequencies have to be carefully chosen to generate accurate baud rates. Crystals of 11.059MHz are often used rather than 12 MHz for this reason. Mode 3 In this mode Timers T0 and T1 behave quite divergently. T0 acts as two independent 8 bit counters. Count register TL0 uses the resources (such as the RUN flag, overflows flag) in TCON, TMOD etc. meant for T0. Similarly,TH0 uses the resources meant for T1. Thus, TR1 will enable running the 8 bit counter made up of TH0. TF1 will be set whenever TH0 overflows.T1 now hascontrol bits at all! It can only be used for services which require no control, no gating and no interrupts. Thus, T1 can be used for Baud rate generation, while we still have two timers available (both with 8 bit resolution). Serial Port • There are two pins available for serial communication TXD and RXD. • Normally TXD is used for transmitting serial data which is in SBUF register, RXD is used for receiving the serial data. • SCON register is used for controlling the operation. • There are four modes of serial communication which has been discussed in further.
  • 25. A.Manikanta & B.Prabhukiran AEC,Bhongir 25 ARCHUTECTURE OF 8051:- ALU Arithmetic Logical Unit: This unit is used for the arithmetic calculations. Accumulator: This register is used for arithmetic operations. This is also bit addressable and 8 bit register. B-Register: This register is used in only two instructions MUL AB and DIV AB. This is also bit addressable and 8 bit register. PC-Program Counter • Points to the address of next instruction to be executed from ROM • It is 16 bit register means the 8051 can access program address from 0000H to FFFFH. A total of 64KB of code.
  • 26. A.Manikanta & B.Prabhukiran AEC,Bhongir 26 1.5.PROGRAMMING AND INTERFACING:- 1.5.1 INPUT DEVICES INTERFACING 1.5.1.1 SWITCH Fig-1.5.1-Various Types Of Switches Fig. 1 Switches are used to open/close a circuit Fig. 2  S1 is a "single pole on/off" switch in the off position Fig. 3 This is a "2 pole on/off" switch which completely isolates the lamp from the supply in the off position. This may be important if it is a high voltage supply. The dotted line indicates that S1a and S1b are part of the same switch "ganged" together and operate simultaneously. Fig. 4 This is a "single pole changeover" switch. Either lamp 1 or lamp 2 is on. Fig. 5this is a "2 pole changeover" switch. The unlit lamp is completely isolated from the supply. Again S1a and S1b are part of the same switch Fig. 6this is a "single pole 5 way" switch. It can select 1 of 5 circuits. You can have 2p 5w, 3p 4w etc Fig. 8 This is a "changeover" slide switch. When operated a-b opens and b-c closes
  • 27. A.Manikanta & B.Prabhukiran AEC,Bhongir 27 1 INTERFACING WITH AT89S52- In 8051 PORT 1, PORT 2 & PORT 3 have internal 10k Pull-up resistors whereas this Pull-up resistor is absent in PORT 0. Hence PORT 1, 2 & 3 can be directly used to interface a switch whereas we have to use an external 10k pull-up resistor for PORT 0 to be used for switch interfacing or for any other input. Figure 2.2 shows switch interfacing for PORT 1, 2 & 3. Figure 2.3 shows switch interfacing to PORT 0. Fig 1.5.2 - Switch Interfacing For Port 1, 2 & 3 For any pin to be used as an INPUT PIN a HIGH (1) should be written to the pin if you don’t do this the pin will always be read as LOW.In the above figure when the switch is not pressed the 10k resistor provides the current needed for LOGIC 1 closure of switch provides LOGIC 0 to the controller PIN.Let's write a small program where whenever a switch is pressed a LED is turned ON. Consider that switch is connected to P2.0 & an LED connected to P2.1. Program of switch interfacing- Main() { P2_0==1; SETB P2_1==0; While(1) { If(P2_0==0) { P2_1==1; } Else { P2_1==0; } }
  • 28. A.Manikanta & B.Prabhukiran AEC,Bhongir 28 OUTPUT DEVICES INTERFACING 1.5.2.1 LED INTERFACING C CODE FOR BLINKING LEDS CONNECTED ON PORT2: #include<at89s8252.h> void delay(unsigned int i); void main(void) { While(1) { P2=0x00; Delay(0xffff); P2=0x00; Delay(0xff); } } void delay(unsigned int i) { while(i!=0) { i--; } } Fig:-1.5.3-Hardware Interfacing Of Led With At89s52
  • 29. A.Manikanta & B.Prabhukiran AEC,Bhongir 29 1.5.2.2 LCD(JHD162A) INTERFACING: On most displays, the pins are numbered on the LCD’s printed circuit board, but if not, it is quit easy to locate pin1. Since the pin is connected to ground, it often has a thicker PCB track connected to it, and it is generally connected to the metal work at some point. Fig:-1.5.4-Jhd162a LCD(16x2) Three command control inputs. When this line is low, data bytes transferred to the display are treated as commands, and data bytes read from the display indicate its status. By setting the RS line high, character data can be transferred to and from the module. Pin 5 is (R/W) line. This line is pulled low in order to write commands or character data to the module, or pulled high to read character data or status information from its registers. Pin 6 is Enable (E) line. This input is used to initiate the actual transfer of commands or character data between the module and the data lines. When writing to the display, data is transferred only on the high to low transition of this signal. However, when reading from the display, data will become available shortly after the low to high transition and remain available until the signal falls low again C CODE FOR LCD DISPLAY //Program to study basics of LCD #include"AT89S8252.h" //macro directives of LCD #define LCD P1 #define RS P3_3 #define EN P3_4 //prototyping various functions of LCD void delay(unsigned int d); void lcd_cmd(unsigned char c); void lcd_init(void); void cursor_position(unsigned char p); void display(unsigned char h); //program to display character 'A' void main()
  • 30. A.Manikanta & B.Prabhukiran AEC,Bhongir 30 { lcd_init(); cursor_position(0); display('A'); } //defining delay function void delay(unsigned int d) { while(d!=0) d--; } //subprogram to send various commands to LCD void lcd_cmd(unsigned char c) { delay(300); LCD=c; RS=0; EN=1; EN=0; } //subprogram too initialize LCD void lcd_init(void) { lcd_cmd(0x01); lcd_cmd(0x38); lcd_cmd(0x0C); } //subprogram to set cursor position void cursor_position(unsigned char p) { lcd_cmd(0x80+p); } //subprogram to display data on LCD void display(unsigned char h) { delay(300); LCD=h; RS=1; EN=1; EN=0; }
  • 31. A.Manikanta & B.Prabhukiran AEC,Bhongir 31 1.5.2.3 SEVEN SEGMENT DISPLAY The 7 segment display is used as a numerical indicator on many types of test equipment. Fig:-1.5.5-Basic Diagram Of A Seven Segment Display It is an assembly of light emitting diodes which can be powered individually. They most commonly emit red light. They are arranged and labeled as shown in the figure 3.4. Powering all the segments will display the number 8. Powering a,b,c d and g will display the number 3. Numbers 0 to 9 can be displayed. The d.p represents a decimal point. The one shown is a common anode display since all anodes are joined together and go to the positive supply. The cathodes are connected individually to zero volts. Resistors must be placed in series with each diode to limit the current through each diode to a safe value. Early wrist watches used this type of display but they used so much current that the display was normally switched off. To see the time you had to push a button. Common cathode displays where all the cathodes are joined are also available. Liquid crystal displays do a similar job and consume much less power. Alphanumeric displays are available which can show letters as well as numbers
  • 32. A.Manikanta & B.Prabhukiran AEC,Bhongir 32 1.6. COMMUNICATION 1.6.1 Serial communication between At89s52 and PC One of the 8051s many powerful features is its integrated UART, otherwise known as a serial port. The fact that the 8051 has an integrated serial port means that you may very easily read and write values to the serial port. If it were not for the integrated serial port, writing a byte to a serial line would be a rather tedious process requring turning on and off one of the I/O lines in rapid succession to properly "clock out" each individual bit, including start bits, stop bits, and parity bits. 1.6.1.1 SETTING THE SERIAL PORT MODE - The first thing we must do when using the 8051s integrated serial port is, obviously, configure it. This lets us tell the 8051 how many data bits we want, the baud rate we will be using, and how the baud rate will be determined. First, lets present the "Serial Control" (SCON) SFR and define what each bit of the SFR represents: Bit Name Bit Address Explanation of Function 7 SM0 9Fh Serial port mode bit 0 6 SM1 9Eh Serial port mode bit 1. 5 SM2 9Dh Mutliprocessor Communications Enable (explained later) 4 REN 9Ch Receiver Enable. This bit must be set in order to receive characters. 3 TB8 9Bh Transmit bit 8. The 9th bit to transmit in mode 2 and 3. 2 RB8 9Ah Receive bit 8. The 9th bit received in mode 2 and 3. 1 TI 99h Transmit Flag. Set when a byte has been completely transmitted. 0 RI 98h Receive Flag. Set when a byte has been completely received.
  • 33. A.Manikanta & B.Prabhukiran AEC,Bhongir 33 1.7.BACKGROUND OF EVM Democracy and Voting Democracy has come to be accepted as the most preferred form of political system all over the world. However, the success of a democratic structure is to be judged by the successes that can be solely attributed to this system. There are various challenges before democracy. These are foundational challenges, challenge of expansion and deepening of democracy. All of these are dependent on how the democracy is perceived by people who form the government, participate in formation of government and are benefited by it. As we all know that India is world’s largest democracy. It is perceived to be charismatic one as it accommodates cultural, regional, economical, social disparities and still is able to stand on its own. India follows a federal form of government. It means that governance power is not residing with one authority, but is distributed at various levels. In India power is distributed between states and central authority. What forms the basis of such vast and complex system of governance? One needs not to be an Einstein to guess the answer. It is fundamental right to vote or simply voting in elections. Indian constitution provide every adult above the age of 18 years irrespective of his/her religion, region, caste, creed, color, economic status, education and sex the essential right to vote and elect her/his candidate to represent her/him. Hence voting can be termed as backbone of not just democracy in India but all around the world. Voting can be done in various ways. In early Roman Empire voting used to be done by raising hands in favor or against. In board rooms voting is done in similar way, some write their vote down, some choose to speak, some choose to cast vote using latest technology. Voting Techniques In India all earlier elections be it state elections or centre elections a voter used to cast his/her vote to his/her favorite candidate by putting the stamp against his/her name and then folding the ballot paper as per a prescribed method before putting it in the Ballot box. This is a long, time-consuming process and very much prone to errors. This method wanted voters to be skilled voters to know how to put a stamp, and methodical folding of ballot paper. Millions of paper would be printed and heavy ballot boxes would be loaded and unloaded to and from ballot office to polling station. All this continued till election scene was completely changed by electronic voting machine. No more ballot paper, ballot boxes, stamping, etc. all this condensed into a simple box called ballot unit of the electronic voting machine. The marking system of voting was introduced in 1962 to make it possible for a substantial number of illiterate voters to indicate easily their preferences in choosing their
  • 34. A.Manikanta & B.Prabhukiran AEC,Bhongir 34 representatives. Over the years, there was a pronounced increase in the volume of work: crores of ballot papers had to be printed and lakhs of ballot boxes had to be prepared, transported, and kept in storage; and a great amount of time was taken up by the conduct of elections. To overcome these difficulties, the Election Commission of India (ECI) thought of electronic gadgets. The Electronics Corporation of India Ltd. (ECIL), Hyderabad, and Bharat Electronics Ltd. (BEL), Bangalore, developed the electronic voting machine in 1981. The Electronic Voting Machine The complete EVM consists mainly of two units - (a) Control Unit and (b) Balloting Unit with cable for connecting it with Control unit. A Balloting Unit caters upto 16 candidates. Four Balloting Units linked together catering in all to 64 candidates can be used with one control unit. The control unit is kept with the Presiding Officer and the Balloting Unit is used by the voter for polling. The Balloting Unit of EVM is a small Box-like device, on top of which each candidate and his/her election symbol is listed like a big ballot paper. Against each candidate's name, a red LED and a blue button is provided. The voter polls his vote by pressing the blue button against the name of his desired candidate. How the Vote is cast with this EVM? The entire process is very easy to understand: • Like in earlier system, your name is called and you are asked to sign or put your thumb impression in a register. • After your identification is done by Election Officer, an ink mark is put on your finger, same as earlier. • Then the Election Officer gives you a slip that bears the Voter register number where you signed or put your thumb impression. • You hand over this slip to the presiding officer who confirms the serial number and permits you to vote by pressing the button of the Control Unit of EVM. • You are not given any ballot thereafter, and are sent to the EV Machine placed behind a card board in a corner. The machine is placed in such a way that your polled vote will be a secret. On the Balloting Unit of EVM, you press the button placed in front of your favorite candidate and release.
  • 35. A.Manikanta & B.Prabhukiran AEC,Bhongir 35 Compare and Contrast: Paper Voting and EVM We have so far discussed three different voting systems. These systems are being used or considered obsolete because of certain positive and negative points. These are summarized as follows: Device type Ballot paper : Papers and boxes EVM : Embedded system with Assembly code Visual Output Ballot paper : Stamp on paper EVM : Single LED against each candidate's name Operating System/ Software Ballot paper : No operating system EVM : None, the Assembly code to register number of votes is all it has Hence it is simple automation of voting, no complexities. Records/ Audits Ballot paper : Manual counting to be done by officials, lengthy, time consuming Process. Inaccurate due to human errors. EVM : The Voting unit doesn't store anything, the control unit records the number of votes cast for each candidate against his serial number. No record to link person-to-vote. Control and Operation Ballot paper: Manual operation EVM : Automatic operation. The control Unit accumulates the votes, it is a device with flash storage and seven segment LED displays. The ballot unit has a button to issue a ballot for a voter. Security Issues Ballot paper : No security provided by the system, neither during polling nor during voting. EVM : During polling, a facility is provided to seal the machine in case of booth capturing. No further voting can be done afterwards. Ballot Issue Ballot paper : Ballot paper is issued by Electoral officer on which voter could cast his vote. EVM : Ballot is issued by Electoral officer by pressing a button on the control Unit. It allows the voter to press any button on the ballot unit to cast his vote.
  • 36. A.Manikanta & B.Prabhukiran AEC,Bhongir 36 Storage of Votes Ballot paper : In ballot boxes assigned for the purpose of storing votes, highly insecure method of storage. EVM : In Internal Non removable memory of the Control Units. No transfer over network. Security increases with this feature. Moreover these results cant be accessed by authorized personnel only at commissioned offices.. Cost of the System Ballot paper : High cost of paper printing in millions and low speed of the whole process. EVM : About 12000 INR (300$) for one EVM. Power Supply Ballot paper : No power supply required. EVM : 6V alkaline batteries or electricity. Capacity Ballot paper : As much a ballot box can hold. EVM : 3840 Votes . Existing System But this electronic voting machine has its disadvantages too. These areas of deficiency are not much of a concern to a layman, but for an intelligent voter this must be eliminated for a secure election. The few technical disadvantages are given as: • Microprocessor based design, which requires a no. of supporting components like memory, peripheral interface, etc. • No security against illegal viewing of results, as presiding officer can view the results without any difficulty. • Less user friendly due to two seven segment displays • Existing system costs high. Proposed System All these faults motivated us to make this new enhanced EVM. The faults which are eliminated are summarized as follows: • Microcontroller replaced microprocessor, which made the EVM closer to real time operation making it faster, more reliable and unique. • More user friendly and interactive LCD display • Proposed system costs less.
  • 37. A.Manikanta & B.Prabhukiran AEC,Bhongir 37 • As soon as the button is pressed, the LED indicator lights off and a whistle sound comes from the machine. This signifies that your vote has been casted rightly. Now you can come out. • In case of LED not not being turned off, press the button firmly again. If finding it difficult, consult the Presiding Officer. • Your vote is complete safe and secret and there is no room for error as well. You can rest assured that your vote is not going to be invalid in any case. • The Voting Machine is attached to the 'Control Unit'. When the user presses the button, his vote is registered in the control unit and the number of votes for the respective candidates is calculated automatically. Booth Capture A remarkable advantage is that rigging is not possible with the EVMs. In the ballot paper system, the intruders can mark hundreds of ballots and put them into the ballot box in a matter of a few minutes. This is not possible in voting machines as the machine is designed to cast only one vote and for the next vote to be casted the presiding officer should make it ready by pressing the related button. Thus the presiding officer can have a complete control of voting and avoid any kind of malpractices The EVMs have following advantages: • the saving of considerable printing stationery and transport of large volumes of electoral material, • easy transportation, storage, and maintenance, • no invalid votes, • reduction in polling time, resulting in fewer problems in electoral preparations, law and order, candidates' expenditure, etc. and • easy and accurate counting without any mischief at the counting centre • eco friendly.
  • 38. A.Manikanta & B.Prabhukiran AEC,Bhongir 38 2. MICROCONTROLLERS 2.1 Introduction Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about. 2.2 History It was year 1969, and a team of Japanese engineers from the BUSICOM Company arrived to United States with a request that a few integrated circuits for calculators be made using their projects. The proposition was set to INTEL, and Marcian Hoff was responsible for the project. Since he was the one who has had experience in working with a computer (PC) PDP8, it occurred to him to suggest a fundamentally different solution instead of the suggested construction. This solution presumed that the function of the integrated circuit is determined by a program stored in it. That meant that configuration would be simpler, but that it would require far more memory than the project that was proposed by Japanese engineers would require. After a while, though Japanese engineers tried finding an easier solution, Marcian's idea won, and the first microprocessor was born. In transforming an idea into a ready made product, Frederico Faggin was a major help to INTEL. He transferred to INTEL, and in only 9 months had succeeded in making a product from its first conception. INTEL obtained the rights to sell this integral block in 1971. First, they bought the license from the BUSICOM Company who had no idea what treasure they had. During that year, there appeared on the market a microprocessor called 4004. That was the first 4-bit microprocessor with the speed of 6 000 operations per second. Not long after that, American company CTC requested from INTEL and Texas Instruments to make an 8-bit microprocessor for use in terminals. Even though CTC gave up this idea in the end, Intel and Texas Instruments kept working on the microprocessor and in April of 1972, first 8-bit microprocessor appeared on the market under a name 8008.
  • 39. A.Manikanta & B.Prabhukiran AEC,Bhongir 39 2.3 Definition of a Microcontroller Microcontroller, as the name suggests, are small controllers. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit. For example, the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys ... etc, where automation is needed. The key features of microcontrollers include: • High Integration of Functionality • Microcontrollers sometimes are called single-chip computers because they have on-chip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry. • Field Programmability, Flexibility • Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems. • Easy to Use
  • 40. A.Manikanta & B.Prabhukiran AEC,Bhongir 40 2.4 Microcontrollers versus Microprocessors Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the time and space needed to construct devices. 2.5 Memory unit Memory is part of the microcontroller whose function is to store data. The easiest way to explain it is to describe it as one big closet with lots of drawers. If we suppose that we marked the drawers in such a way that they cannot be confused, any of their contents will then be easily accessible. It is enough to know the designation of the drawer and so its contents will be known to us for sure.
  • 41. A.Manikanta & B.Prabhukiran AEC,Bhongir 41 Typically, the amount of ROM type memory will vary between around 512 bytes and 4096 bytes, although some 16 bit microcontrollers such as the Hitachi H8/3048 can have as much as 128 Kbytes of ROM type memory. ROM type memory, as has already been mentioned, is used to store the program code. ROM memory can be ROM (as in One Time Programmable memory), EPROM, or EEPROM. The amount of RAM memory is usually somewhat smaller, typically ranging between 25 bytes to 4 Kbytes. RAM is used for data storage and stack management tasks. It is also used for register stacks (as in the microchip PIC range of microcontrollers). 2.6 Central Processing Unit Let add 3 more memory locations to a specific block that will have a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another. The part we just added in is called "central processing unit" (CPU). Its memory locations are called registers.
  • 42. A.Manikanta & B.Prabhukiran AEC,Bhongir 42 2.7 Bus That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller. Figure2.4: Showing connection between memory and central unit using buses 2.8 Input-output unit Those locations we've just added are called "ports". There are several types of ports: input, output or bidirectional ports. When working with ports, first of all it is necessary to choose which port we need to work with, and then to send data to, or take it from the port. 2.9 Serial communication Beside stated above we've added to the already existing unit the possibility of communication with an outside world. However, this way of communicating has its drawbacks. One of the basic drawbacks is the number of lines which need to be used in order to transfer data. What if it is being transferred to a distance of several kilometers? The number of lines times’ number of kilometers doesn't promise the economy of the
  • 43. A.Manikanta & B.Prabhukiran AEC,Bhongir 43 project. It leaves us having to reduce the number of lines in such a way that we don't lessen its functionality. Suppose we are working with three lines only, and that one line is used for sending data, other for receiving, and the third one is used as a reference line for both the input and the output side. In order for this to work, we need to set the rules of exchange of data. These rules are called protocol. Protocol is therefore defined in advance so there wouldn't be any misunderstanding between the sides that are communicating with each other. For example, if one man is speaking in French, and the other in English, it is highly unlikely that they will quickly and effectively understand each other. Let's suppose we have the following protocol. The logical unit "1" is set up on the transmitting line until transfer begins. Figure2.6: Serial unit sending data through three lines only 2.10 Timer unit Since we have the serial communication explained, we can receive, send and process data. However, in order to utilize it in industry we need a few additionally blocks. One of those is the timer block which is significant to us because it can give us information about time, duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the basis of their difference we can determine how much time has elapsed. This is a very important part of the microcontroller whose understanding requires most of ourtime. 2.12 Analog to Digital Converter As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a microcontroller. This task is performed by a block for analog to digital conversion or by an ADC. This block is responsible for converting an
  • 44. A.Manikanta & B.Prabhukiran AEC,Bhongir 44 information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it. Finally, the microcontroller is now completed, and all we need to do now is to assemble it into an electronic component where it will access inner blocks through the outside pins. The picture below shows what a microcontroller looks like inside. Thin lines which lead from the center towards the sides of the microcontroller represent wires connecting inner blocks with the pins on the housing of the microcontroller so called bonding lines. Chart on the following page represents the center section of a microcontroller. Figure2.11: Microcontroller outline with basic elements and internal connections 2.13 AT89S52 microcontroller: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the indus-
  • 45. A.Manikanta & B.Prabhukiran AEC,Bhongir 45 try-standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory pro- grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications.
  • 46. A.Manikanta & B.Prabhukiran AEC,Bhongir 46 3. INTRODUCTION TO 16X2 LCD DISPLAY LCD stands for Liquid Crystal Display. The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters. 3.1 Pin Description Most LCDs with two controllers has 16 Pins. Pin description is shown in the table below. Pin No. Name Description Pin no. 1 D7 Data bus line 7 (MSB) Pin no. 2 D6 Data bus line 6 Pin no. 3 D5 Data bus line 5 Pin no. 4 D4 Data bus line 4 Pin no. 5 D3 Data bus line 3 Pin no. 6 D2 Data bus line 2 Pin no. 7 D1 Data bus line 1 Pin no. 8 D0 Data bus line 0 (LSB) Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller) Pin no. 12 VEE Contrast adjust Pin no. 13 VSS Power supply (GND) Pin no. 14 VCC Power supply (+5V) Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller) Pin no. 16 NC Not Connected Table No.3.1: Pin description of the LCD
  • 47. A.Manikanta & B.Prabhukiran AEC,Bhongir 47 3.2 DDRAM - Display Data RAM Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever you send on the DDRAM is actually displayed on the LCD. 3.3 BF - Busy Flag Busy Flag is a status indicator flag for LCD. When we send a command or data to the LCD for processing, this flag is set (i.e. BF =1) and as soon as the instruction is executed successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount of delay. For the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will not accept next command or data and BF = 0 means LCD is ready for the next command or data to process. 3.4 Instruction Register (IR) and Data Register (DR) There are two 8-bit registers controller Instruction and Data register. Instruction register corresponds to the register where you send commands to LCD e.g. LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data which is to be displayed on LCD. When send the enable signal of the LCD is asserted, the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM and hence is displayed on the LCD. 3.5 Commands and Instruction set Only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the MCU. Before starting the internal operation of the LCD, control information is temporarily stored into these registers to allow interfacing with various MCUs, which operate at different speeds, or various peripheral control devices. The internal operation of the LCD is determined by signals sent from the MCU. 3.6 Sending Commands to LCD To send commands we simply need to select the command register. Everything is same as we have done in the initialization routine. But we will summarize the common steps and put them in a single subroutine. Following are the steps:  Move data to LCD port  Select command register
  • 48. A.Manikanta & B.Prabhukiran AEC,Bhongir 48 4.PROJECT DESCRIPTION:- 4.1 BLOCK DIAGRAM
  • 49. A.Manikanta & B.Prabhukiran AEC,Bhongir 49 4.2 .GENERAL WORKING:- 1. Initially when the switch is closed, allows the evm to take the vote. the vote is taken only when push button is pressed and led D1 is switched ON. 2. A push button is assigned to each party. When the push button of the desired party is pressed, the led is switched off which indicates that the vote is cast and the buzzer gives a beep. Again the push button is pressed so that the evm is ready to take the next vote which isindicated through the led D1.The same process is repeated until all the voters cast their votes.  
  • 50. A.Manikanta & B.Prabhukiran AEC,Bhongir 50 3. To view the results of each respective party, the switch must be opened 4. To know the result of the party, the push button of the respective party must be pressed so that the number of votes cast for the party is displayed on the lcd screen. This process is repeated to know the results of each party. P in no. 10 R / W P in no. 11 R S 1 = Data input
  • 51. A.Manikanta & B.Prabhukiran AEC,Bhongir 51 4.3 C LANGUAGE CODING: #include<reg51.h> sfr input=0x90; sfr ldata=0xa0; sbit rs=P0^7; sbit rw=P0^6; sbit en=P0^5; sbit m=P3^0; sbit n=P3^1; sbit buzz=P3^2; sbit on=P3^3; void delay(int ); void lcdcmd(char ); void lcddata1(char *); void lcddata(char); void lcd(); int i1,i11,i12,i2,i21,i22,i3,i31,i32,i4,i41,i42,i5,i51,i52=0; void main() { on=0; P1=0;P3=0; while(1) { lcdcmd(0x38); delay(10); lcdcmd(0x0e) ; delay(10); lcdcmd(0x01); lcdcmd(0x06) ; delay(20) ; lcddata1("Vote"); if(n==1) on=1; if(m==1&on==1) { if (input==0x01) { buzz=1; while (input == 0x01); i1=i1 + 1; if(i1>=10) i11=i1/10; i12=i1%10; on=0; buzz=0;
  • 52. A.Manikanta & B.Prabhukiran AEC,Bhongir 52 //ready=0; } if (input==0x02) {buzz=1; while (input == 0x02); { i2=i2 + 1; if(i2>=10) i21=i2/10; i22=i2%10; on=0; buzz=0; } } if (input==0x04) { buzz=1; while (input ==0x04); { i3=i3 + 1; if(i3>=10) i31=i3/10; i32=i3%10; on=0; buzz=0; } } if (input==0x08) { buzz=1; while (input == 0x08); { i4=i4 + 1; if(i4>=10) i41=i4/10; i42=i4%10; on=0; buzz=0; } } if (input==0x10) { buzz=1;
  • 53. A.Manikanta & B.Prabhukiran AEC,Bhongir 53 while (input == 0x10); { i5=i5 + 1; if(i5>=10) i51=i5/10; i52=i5%10; on=0; buzz=0; } }} if(m==0)//else { if (input==0x01) { lcddata1(" CONGRESS="); lcddata(i11+0x30); lcddata(i12+0x30); delay(100); } if (input==0x02) { lcdcmd(0x01); lcddata1(" BJP="); lcddata(i21+0x30); lcddata(i22+0x30); delay(100); } if (input==0x04) { lcdcmd(0x01); lcddata1(" CPM&CPI="); lcddata(i31+0x30); lcddata(i32+0x30); delay(100); } if (input==0x08) { lcdcmd(0x01); lcddata1(" TDP="); lcddata(i41+0x30); lcddata(i42+0x30); delay(100); } if(input==0x10)
  • 54. A.Manikanta & B.Prabhukiran AEC,Bhongir 54 { lcdcmd(0x01); lcddata1(" PRP="); lcddata(i51+0x30); lcddata(i52+0x30); delay(100); } else{ //lcdcmd(0x01); lcddata1("result"); delay(100) ; }} }} void delay(int time) { int i,j; for(i=0;i<time;i++) for(j=0;j<900;j++); } void lcdcmd(char value) { ldata=value; rs=0; rw=0; en=1; delay(2); en=0; } void lcddata1(char *value) { int i; for(i=0;value[i]!='0';i++) { ldata=value[i]; rs=1; rw=0; en=1; delay(1); en=0; } } void lcddata(char value) { ldata=value; rs=1;
  • 55. A.Manikanta & B.Prabhukiran AEC,Bhongir 55 rw=0; en=1; delay(1); en=0;
  • 56. A.Manikanta & B.Prabhukiran AEC,Bhongir 56 5. PROJECT METHODOLOGY 5.1 Components: Component Name Quantity Microcontroller IC (AT89S52) 1 Transistor (L78O5CV) 1 Resistor 7 Diodes 4 Port Connectors 4 LED 3 Resistors 7 LCD (16X2 characters) 1 Buzzer 1 contrast controller 1 push switches 10 crystal oscillator 1 5.2 Software's used: 1. Keil uVision3. 2. Eclipse 5.3 Equipments used: 1. Soldering iron, solder, flux. 2. Personal computer. 3. DB25 connector.
  • 57. A.Manikanta & B.Prabhukiran AEC,Bhongir 57 6. RESULT AND CONCLUSION The EVM consists of a microcontroller AT89S52 16×2 LCD display, LED ,push buttons, relay and a buzzer. • In voting mode, the voting mode switch is in on condition. • The EVM is ready for voting only after ready to vote button is pressed and the led is on. The led turns off after a vote is casted along with a buzzer. Counting the votes for individual candidate (5 in number) is done simultaneously along with the voting and total number of votes cast to that individual can be checked at anytime. • In result mode, the voting mode switch is in off position. • In result mode, the UNIT displays the votes of individual candidate, whenever the “Result Button” of the corresponding individual is pressed. In total, the complete system (including all the hardware components and software routines) is working as per the initial specifications and requirements of our project. Because of the creative nature of the design, and due to lack of time, some features could not be fine-tuned and are not working properly. So certain aspects of the system can be modified as operational experience is gained with it. As the users work with the system, they develop various new ideas for the development and enhancement of the project.
  • 58. A.Manikanta & B.Prabhukiran AEC,Bhongir 58 7. APPLICATIONS AND FUTURE SCOPE APPLICATIONS Fast track voting which could be used in small scale elections, like resident welfare association, “panchayat” level election and other society level elections. It could also be used to conduct opinion polls during annual share holders meeting. It could also be used to conduct general assembly elections where number of candidates are less than or equal to eight in the current situation FUTURE SCOPE Number of candidates could be increased by using other microcontroller or an 8255 IC. It could be interfaced with printer to get the hard copy of the result almost instantly from the machine itself. It could also be interfaced with the personal computer and result could be stored in the central server and its backup could be taken on the other backend servers. Again, once the result is on the server it could be relayed on the network to various offices of the election conducting authority. Thus our project could make the result available any corner of the world in a matter of seconds
  • 59. A.Manikanta & B.Prabhukiran AEC,Bhongir 59 8. REFRENCES Muhammad Ali Mazidi , Janice Gillispie Mazidi, Rolin D. Mckinlay. Second edition, “THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEM” K. J. Ayala. Third edition, “The 8051 MICROCONTROLLER” General information about electronic voting machine www.eci.gov.in www.eci.gov.in/faq/evm.asp ww.eci.gov.in/Audio_VideoClips/presentation/EVM.ppt www.rajasthan.net/election/guide/evm.htm www.indian-elections.com/electoralsystem/electricvotingmachine.html Tutorial on microcontroller: www.8051projects.net/microcontroller_tutorials/ Tutorial on LCD: www.8051projects.net/lcd-interfacing/
  • 60. A.Manikanta & B.Prabhukiran AEC,Bhongir 60