Documente Academic
Documente Profesional
Documente Cultură
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRONIC ENGINEERING
BY
AUGUST, 2012.
2
APPROVAL PAGE
This project has been supervised and certified as satisfying part, the requirements for the
award of Bachelor of Engineering degree (B.Eng.) in Electronic Engineering, Department of
Electronic Engineering, University of Nigeria, Nsukka.
(2007/148286)
______________________________________________
(2007/148078)
_____________________________________________
(2007/148271)
______________________________________________
(2007/147685)
(SUPERVISOR)
(HEAD OF DEPARTMENT)
i
DEDICATION
ACKNOWLEDGEMENT
Our sincere gratitude goes to our parents and guardians for their formidable love and
support throughout the course of our academic stay, most especially in the aspect of
Special thanks to our project supervisor, Engr. M.A. Ahaneku, for his guidance and
invaluable assistance towards the successful realization of this project. In addition, we duly
appreciate the fatherly role of our able and dynamic Head of Department, Prof. O.U.
All thanks to God Almighty, for His endless love and mercies that has helped thus far.
iii
ABSTRACT
Elections have come to be one of the controversial exercises in our nationhood. This is
evidenced from the plethora of litigations that subsequently arise after each general election.
This could be traced to the doubt about the figures that emanate from the electoral umpire
(INEC). The need therefore arises to have a system of voting devoid of the danger of
doctoring election figures. The approach is to minimize human interference in the whole
process of voting. An electronic voting machine is therefore proposed as the only feasible
option available. The system proposed would consist of a unique voter’s card made from
electrically erasable programmable memory (EEPROM). The EEPROM card would host a
unique voter identification number (VIN). During the voting process the voting machine part
of which is a microcontroller will read the VIN and forward it to computer software through
the RS232 serial interface of a computer. The software accesses this unique identification in
the EEPROM for verification of validity of the card. To prevent cases of multiple voting or
fraud, the voting machine after accessing the VIN subsequently deletes the number. The
microcontroller interface circuit verifies whether the voter has voted before. This is done by
deleting the unique pin resident in the voter card and replacing it with a particular identifying
number. The detection of a fraudulent voter is done by the microcontroller which checks the
unique pin in a voter card against the identifying number which is also stored in its register. A
match will result in the microcontroller sending trigger signal to the alarm detection system.
Otherwise the microcontroller allows the voter to depress a button representing the particular
political party he is voting for PC software then increments count of the particular political
party. The PC software also has the capability to display total results on request.
iv
LIST OF FIGURES
LIST OF TABLES
ASSEMBLY LANGUAGE
UNIT
TABLE OF CONTENTS
Title
Approval Page
Dedication … … … … … … … … … i
Acknowledgement … … … … … … … … ii
Abstract … … … … … … … … iii
List Of Figures … … … … … … … … iv
List Of Tables … … … … … … … … v
1.1: Background … … … … … … … … … 1
2.9: Keypad … … … … … … … … … 17
2.10: In-System Programmer (ISP) … … … … … … 17 - 18
2.11: AT89S52 – 12MHZ Microcontroller … … … … … 18 – 19
4.1.1: Simulation … … … … 44
4.1.2: Implementation … … … … 44 - 50
5.2: Conclusion … … … … 58
5.3: Recommendation … … … … 58 - 59
REFERENCES
CHAPTER ONE
INTRODUCTION
1.1: BACKGROUND
Few years ago, a substantial part of the Nigerian population yearned for the democratic-style
of rule in the United States, as an obvious replacement to the highly controversial, military
system of rule in Nigeria. Not until May 29th, 1999, was this collective desire of the Nigerian
people duly met, and today, almost every facet of Nigerian politics have endorsed
“democracy” as the preferred system of governance. Democracy is a system of government
based on the principle of majority decision making [1]. Since the people’s choice in the
selection of leaders remains the major fulcrum of modern day democracy, technological
solutions are constantly been devised to provide an electoral process that is credible,
transparent, fair to all and ultimately, efficient.
Elections allow the populace to choose their representatives and express their preference for
how they will be governed. Naturally, the integrity of the election process is fundamental to
the integrity of democracy itself. The election system must be sufficiently robust to withstand
a variety of fraudulent behaviours and should be sufficiently transparent and comprehensible
that voters and candidates can accept the results of an election[2][3]. The electioneering
process in Nigeria since 1999, leaves much to be desired. It is marked with such issues as:
gross inefficiency, violation of proper voting standard and procedures, low credibility,
falsification of voting records and in the end, the people’s right to choose their leaders is
hereby hijacked. The EVM solution would no doubt help to correct these inadequacies,
reduce the high incidence of sharp practices in our electoral process and assure the electorate
that their votes do really count.
As earlier mentioned, elections in Nigeria have been branded with negative insignias of sharp
electoral practices, pre- and post-election violence leading to the destruction of lives and
properties, distrust within the electorate over falsified election results which culminates into
their rejection of poll results. The inability of the Independent National Electoral Commission
(INEC) to conduct credible, free and fair elections has become the achilles heel of our
nascent democracy. In other words, INEC has lost its credibility.
2
It is a known fact everywhere, that elections to a particular political position should produce
only one winner. Thus, the aim of an election is defeated when more than one candidate lay
claim to victory in the polls. This unfortunate situation where candidates cannot trust election
results, has become a widespread problem. Most contestants view results released by INEC
as doctored with obvious manipulations. As a result of this common view, most candidates
engage in various forms of electoral and societal vices so as to tilt the pendulum of victory in
their favour. A summary of these vices are listed as:
- Snatching of ballot box from polling units as well as illegal stuffing of ballot boxes.
- The use of thugs and armed men to intimidate, and sometimes maim INEC officials in a bid
to falsify election records.
These plethora of problems that besiege our electoral process are traceable to the following
causes:
Every process characterized by steady human involvement is fraught with the danger of
mistakes. Here, mistakes could be in the form of wrong collation of election figures during
vote counting, vote miscount (common in the conventional paper ballot system),
manipulation of election figures to favour the candidate who pays the highest bribe etc.
Since the traditional system of voting in Nigeria entails the use of ballot papers, there is high
likelihood that these voting materials can easily be reproduced by anyone in possession of the
right printing equipment. Many fraudulent politicians employ this possibility to forge ballot
papers in anticipation of the election day. The result is that, on election day, ballot box
snatching becomes rampant; and these ballot boxes are removed from polling units and
illegally moved to remote locations where they are stuffed with forged ballot papers.
Somehow, these stolen ballot boxes are smuggled back to INEC offices and in the end,
election results are gravely influenced.
Apart from forging ballot papers, politicians epecially those still in government and
contesting for political offices, could influence the contractors in charge of printing the ballot
3
papers. Either overproducing or underproducing the ballot papers would lead to the
disenfranchisement of the people’s right to vote.
In the ballot paper system of voting, documents are mostly maintained in their hard copy
formats and so, are prone to being destroyed by fire, pests and human agents. Also, with the
conventional system, the ease of document accessibility, analysis, processing and storage are
not highly provided for.
Ballot papers are not reusable and so, for every subsequent elections, the government always
spends a large chunk of the national budget on ballot paper production. This makes elections
too expensive to manage and conduct.
It is almost impossible for voters to follow up the process of results collation during elections.
This is due to bureaucratic bottlenecks in the electoral process, whereby the whole of result
collation is ambiguous with little or no contribution from voters ( in terms of complaints or
feedback).
The traditional voting process usually involves the process of voter verification and
validation, issuance of voter card and production of other voting materials. These processes
are usually time consuming, coupled with the problem of late arrival of voting materials on
election day.
In the real voting process, a strenous burden is imposed on voters as they stand in long
queues for long hours. This could result in voter apathy.
The aim of the project is to minimize undue human interference in the entire voting process
as well as the collation of the election results. This is achieved by ensuring that the process of
voting is computerized in order to give credibility to the electoral system and process.
4
1) TRANSPARENCY
There is general apathy among the electorate during elections. This stems from their doubts
over the authenticity of election results. The use of the EVM together with its very
transparent methods would no doubt restore and boost the credibility of the electoral process.
By this, voter apathy will be greatly reduced.
With the introduction of EVM, politicking candidates become fully aware that have little or
no influence over the electioneering process. This is because the EVM solution leaves little or
no room for manipulation. It also ensures that a peaceful, conducive atmosphere for the
conduct of elections is in place. The electoral process is therefore devoid of violence, stealing
of ballot boxes, thuggery and other vices.
The EVM solution provide results in electronic format with the possibility of making print
outs. This makes it easy to transfer results over the internet network to a central collation
database. Also, it is possible to measure the instantaneous voting pattern in a particular
locality.
Furthermore, given the ease of data documentation, various statistical analysis could be
carried out on obtained results. Data could also be easily retrieved in case of damage to the
original document copy. In the area of database security, effective measures are put in place
to protect the database from unauthorized access and manipulations by both the public and
fraudulent electoral officers.
Unlike the traditional voting system where ballot papers become useless after elections, the
electronic voter machine will make use of an EEPROM voter card. Thus, for subsequent
elections, the EEPROM cards are simply re-written to reflect the election at hand. This
greatly cuts down the cost of conducting elections.
5
Electronic voting systems can offer solutions that allow voters to verify that their votes are
recorded and tabulated[3]. These systems can alleviate problems of incorrectly recorded
voters.
The EVM offers an electronic voter card as replacement to the conventional ballot paper,
thereby providing a voter card which is almost impossible to reproduce. The EEPROM cards
will bear unique identification numbers and this will help to cut down the forgery of voter
cards. The ID numbers will serve the purpose of distinguishing the original voter cards from
the fake ones.
The throughput of the EVM is far higher than the conventional system of voting, since it
automates such activities as voter registration, voting and vote tabulation. Because of this,
there would be reduced strain imposed on the voters.
One of the pre-requisites for the implementation of the EVM is prior voter education.
Therefore, the deployment of these machines will ensure that a new generation of
informed/enlightened voters emerge. Such voters will now be able to participate actively and
even, constructively critcize the electoral process when the need arises.
The EVM is less prone to computation errors than the conventional voting systems. This is
because the machines are programmed specifically to follow a clearly stated sequence of
instructions or algorithm. Thus, provided there are no initial errors in the programming, the
results from tne EVM are guaranteed to be accurate.
Within the limit of the specification realized in the project, the EVM could be deployed for
the following purposes:
1) Party Primaries:
6
The EVM can be used in party primaries as an efficient, selection tool in voting for the
party’s flagbearer as well as other party delegates who will represent the party in different
capacities.
CHAPTER TWO
LITERATURE REVIEW
2.3: MICROCONTROLLERS
A microcontroller is a single computer chip that executes a user program normally for the
purpose of controlling some device. Its distinguishing feature is the inclusion on a single
chip, of all the resources which permit the IC to serve as a controller in a system or an
instrument. It is a complete computer on a chip containing all of the elements of the basic
8
microprocessor along with other specialized functions. Its built-in facilities have obvious
advantages when building stand-alone front-ends and controllers.
A microcontroller is made up of CPU, RAM, ROM, I/O ports, timers, and serial
communication ports. It has wide applications in embedded systems that require some
amount of computing power but don’t require as much as that provided by a complex
processor. In an embedded system there is only one application software that is typically
burned into ROM. Microcontroller-based systems are generally smaller, more reliable and
cheaper. They are ideal for applications where cost and unit size are important considerations.
A typical example is the 8051\8052 family, which includes 8031, 8051,
8052,8751,8752,8951, 8952, etc. the major producers of microcontrollers are Atmel and Intel.
Certain factors are to be considered when choosing a microcontroller for an application.
They include:
-Speed, size of ROM/RAM, number of I/O ports, timers, power consumption and cost per
unit.
-Availability of software development tools like assemblers, debuggers, compilers, simulators
and technical support.
-Availability and reliable sources of microcontrollers. The 8051/8052 families are readily
available.
Registers (SFRs). Each SFR has an address between 128 and 255. Additional functions can
be added to new derivative microcontrollers by adding additional SFRs while remaining
compatible with the original 8051. This allows the developer to use the same software
development tools with any microcontroller that is 8052-compatible.
EXTERNAL
INTERRUPTS
INTERRUPT
COUNTER
CONTROL INPUTS
ADDRESS
DATA
.
FIG.2.1: BLOCK DIAGRAM OF 8051 MICROCONTROLLER
The 8051 provides five (5) interrupt sources; two external interrupt, two timer interrupts and
a serial port interrupt. The external interrupts are denoted by INT0 and IUT1 and could each
be either level-activated or transition-activated, depending on the bits IT0 and IT1 in
register TCON. When the service routine is vectored to, hardware clears the flag that
generated an external interrupt only if the interrupt was transition-activated. If the interrupt
was level activated, then the external requesting source (rather than the on chip hardware)
controls the request flag.
The 8051 has two 16-bit timer/counter registers. As a timer, the register is incremented
every machine cycle. Thus, the register counts machine cycles. Since a machine cycle
consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency. The timer
or counter function is selected by control bits C/T in the special function register TMOD.
When a timer interrupt is generated, the on-chip hardware clears the flag that generated it
when the service routine is vectored to.
The serial port interrupt is generated by the logical OR of R1 and T1. Neither of these flags
is cleared by the hardware when the service routine is vectored to.
Each of the interrupt sources can be individually enabled or disabled by setting or clearing
the interrupt enable (IE) bit in the special function register (SFR). This register also contains
a global disable bit, which can be cleared to disable all interrupts at once. Some of the
interrupt enable registers in AT 80C51 are: EA, ES, ETI, EXI, ETO, EXO. For instance if
EA=O, no interrupt will be acknowledged. Also if EA= I, each interrupt source is
individually enabled or disabled by setting or clearing its enable bit.
11
Each interrupt sources can also be individually programmed to one of two priority levels by
setting or clearing the interrupt priority (IP) bit in the special function register. A low-priority
interrupt could be interrupted by a high-priority interrupt but not by another low-priority
interrupt. A high priority interrupt cannot be interrupted by any other interrupt source. If two
interrupt requests of different priority levels are received simultaneously, the request of higher
priority level is serviced. If interrupt requests of the same priority level are received
simultaneously, an internal polling sequence determines which request is serviced. Thus, within
each priority level the polling sequence determines a second priority structure.
12
The 8051 provides the following standard features: 4k bytes of flash, 128 bytes of RAM, 32 I/O
lines, two 16- bit timer/ counters, a five interrupt source, a full duplex serial port, on-chip
oscillator. In addition, the 8051 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The idle mode stops the
CPU while allowing the RAM, timer/ counters, serial port and interrupt system to continue
functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling
all other chip functions.
The pin out of 8051 microcontroller is given above in figure 2.2:
Pin 40 provides VCC. The VCC provides the supply voltage to the chip. The voltage
source is +5V.
13
Pin 20 provides the ground (GND) pins 19, 18 are for crystal I (XTAL 1) and crystal
2 (XTAL 2). They provide external clock to the chip. External clock to the chip can
be provided using a quartz crystal oscillator or from a pulse generator. The two
options have different circuit configurations.
Pin 9 provides a reset (RST). It is an input pin and is active high normally low. The
high pulse must be high at least two machine cycles. Upon applying a high pulse to
reset pins the microcontroller will reset and all values in the registers will be lost.
For example during a reset operation, the RAM would loose its contents; some of
the reset value of the register is given below.
program is made available to the microcontroller without the need for a hard drive, floppy
drive, or any of the other circuitry necessary to access such devices.
In recent years, microcontrollers offer the capability of having programs loaded internally
into the microcontroller chip itself. Thus, rather than having a circuit that includes both a
microcontroller and an external EPROM chip, it is now entirely possible to have a single
microcontroller which stores the program code internally [6][7].
2.7: WEBCAM
Webcams (web cameras) are small cameras (usually, though not always, video cameras),
whose images can be accessed using the World Wide Web, instant messaging, or a PC video
conferencing application. The term webcam is also used to describe the low-resolution digital
16
video cameras designed for such purposes, but which can also be used to record in a non-real-
time fashion.
Web-accessible cameras involve a digital camera which uploads images to a web server,
either continuously or at regular intervals. This may be achieved by a camera attached to a
PC, or by dedicated hardware. Webcams are being used for security purposes. Software is
available allowing PC-connected cameras to watch for movement and sound, recording both
when they are detected; these recordings can be saved to the computer, e-mailed or uploaded
to the internet. In one well-publicized case, a computer e-mailed out images as the burglar
stole it, allowing the owner to give police a clear picture of the burglar's face even after the
computer had been stolen [7].
smoothens out most of the pulsating, rectified waveform to give a DC voltage with some
ripple. Finally, depending on the requirements of the load a linear regulator may be used to
reduce the voltage to the desired output voltage and remove the majority of the remaining
ripple. It may also provide other features such as current limiting [9].
2.9: KEYPAD
Keypads are an excellent way of entering data into the microcontroller. The keys are usually
numbered (numeric or alphanumeric) but they could be labelled as function keys for example
in a remote control handset in a TV to adjust the sound or colour etc. Keypads are usually
arranged in a switch matrix format to reduce the number of I/O connections. The switch
matrix is typically a 2-dimensional matrix of wires with switches at each vertex. The switch
is used to interconnect rows and columns in the matrix.
A 12 key keypad is arranged in a 3x4 format requiring 7 connections, while a 16 key keypad
is arranged in a 4x4 format requiring 8 connections [8].
In the earlier, chips had to be removed from the target board and placed in a programming
device, today’s microcontroller and external memory chips can be re-programmed without
being removed from the circuit. This is termed in-circuit or in-system programming (ISP).
The ISP was in the loading of instructions (programming) on the non-volatile flash ROM of
the microcontroller (AT89S52).
1) A software tool running on the desktop computer, which is able to control the
programming interface via any standard port.
2) A special programming interface like SPI (Serial Programming Interface), JTAG (Joint
Action Group) etc. A firmware may be used to drive this interface, though this is gradually
becoming obsolete.
All three requirements must be fulfilled somehow, but there is a large variety of real world
implementations. For instance, the programming adapter may be integrated on the target
board. In that case, for instance, a USB cable may be used to directly connect the PC to the
target board. Sometimes, the programming interface is accessible by special microcontroller
instructions or registers, which allows loading new firmware [8].
The AT89S52 – 12MHz microcontroller which hails from Intel MCS-51 microcontroller
family usually referred to as 8051 family was used in this project work. It was manufactured
by Atmel Corporation using 8051 architecture and runs on a maximum of 12MHz oscillator
frequency.
The choice of AT889S52 – 12MHz for this project was based on the following features and
requirement:
3) Ease of usage. It is precisely due to the numerous input/output requirements and memory
availability that enhanced the choice of AT89S52 – 12MHz.
The AT89S52 – 12MHz 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 non-volatile memory technology and is compatible with the industrial –
standard 8051 instruction set and pin out. The on-chip Flash allows the program to be
reprogrammed in-system or by a convectional non-volatile memory programmer. By
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
20
the Atmel AT89S52 is a powerful microcontroller, which provides a highly flexible and cost-
effective solution to many embedded control applications. In addition, the AT89S52 is
designed with static logic for operation down to zero frequency and supports two software
selectable power saving modes.
The idle Mode stops the CPU while allowing the RAM, timer/counters, parallel port and
interrupt system to continue functioning. The Power-down mode saves the RAM contents but
freezes the oscillator, disabling all other chip functions until the next interrupt or hardware
reset [6][7][8].
data/fax modems, plotters and lots of other peripheral devices exist. Unfortunately, their
existence is beyond the confines of the desktop or server machine. We need a way to reach
out to them. The process we undergo in order to reach out to them is called interfacing. In the
computer world, a port is a set of signal lines that the microprocessor, or CPU, uses to
exchange data with other components especially peripheral devices. Most computer ports are
digital, where each signal, or bit, is either a 0 or a 1. A parallel port transfers multiple bits at
once, while a serial port transfers a bit at a time. This is the basic difference between the
serial port and the parallel port though the serial port can transfer data in both directions
simultaneously. Interfacing external devices to the computer could be achieved either through
the serial port, the parallel port or even the USB port of the computer.
The Serial Port is relatively harder to interface than the Parallel Port. Generally, serial
transmission and reception of data involves and requires complex circuitry. Any device
connected to the serial port will have its data converted to a serial form before transmission
and then back to its parallel format after reception. This can be done using a Universal
Asynchronous Receiver/Transmitter (UART). The Parallel Port is the most commonly used
port for interfacing homemade projects. This port will allow the input of up to 9 bits or the
output of 12 bits at any one given time, thus requiring minimal external circuitry to
implement many simpler tasks. The port is composed of 4 control lines, 5 status lines and 8
data lines. It's found commonly on the back of your PC as a D-Type 25 Pin female connector
[6].
In low- power CMOS digital systems ( e.g. battery or solar-powered electronic devices), the
dissipation of an LED display can consume most of a system’s power requirements, and this
is undesirable in terms of saving power through the use of CMOS technology. Liquid crystal
displays (LCDs) are ideal for low-power applications; and unlike a LED display, they are
passive devices. Thus, instead of using electric current to generate light, it uses light that is
already externally present (e.g. sunlight, room lighting). For the LCD’s optical effect to
occur, the external light source need only supply a minute amount of power (within the
Mw/cm2 range). The typical LCD consists of two polarizing filters with a liquid crystal
solution between them. An electronic current aligns the crystals so that light can either pass
through or not pass through. The effect of light passing through in certain areas and not in
others is what creates the image. LCD comes in two forms—active matrix and passive
matrix. Active matrix is sometimes called thin film transistor (TFT). TFT allows each pixel to
be controlled, which creates very sharp colour images. Passive matrix is less expensive than
active matrix but does not provide the same level of image control. One disadvantage of the
LCD is their slow switching speeds (time it takes for a new digit/character to appear). Typical
switching speeds for LCDs range from around 40 to 100ms. At low temperature, the
switching speeds get even worse. Another problem with LCDs is the requirement that
external light be present. Though there are LCD displays that come with backlighting (e.g.
LED behind the display), the backlighting alone tends to defeat attempts at keeping power
consumption to a minimum [6].
23
The software development process focuses on activities relating to the design, coding and
testing of the software aspect of this project. There are several software development process
models namely: the waterfall model, the prototyping method, the iterative development
process and the time boxing model. Each process model is suitable for the context where it
suits perfectly. Developing the EVM software entails a good combination of low-level and
high-level programming languages. While the former takes care of interactions within and
outside the microprocessor or microcontroller (highly machine-dependent), the latter
performs dual functions: hardware interface connections and database functions.
1) Label field.
3) Operand field.
4) Comment field.
As an example, a typical program for two 16-bit numbers written in 8086 assembly language
is:
Most assemblers use two (2) passes to assemble a written program. This means that they read
the input program text twice. The first pass is used to compute the addresses of all labels in
the program. In order to obtain the address of a label, it is necessary to know the total length
of all the binary code preceding that label. So, the first pass computes the addresses of all
labels and stores them for the next pass, which generates the actual binary code. Various
types of assemblers do exist, and they include: one-pass assembler, two-pass assembler,
macro assembler, cross assembler, resident assembler and meta-assembler [11].
EDITOR PROGRAM
myfile.asm
ASSEMBLER PROGRAM
myfile.lst myfile.obj
other obj f
LINKER PROGRAM
my file.abs
OH PROGRAM
my file.hex
Using the flowchart above, we describe the sequence observed by the assembler in carrying
out its functions. The programmer puts his code down on an editor program (e.g Microsoft’s
notepad or GUI) and saves it; an action which generates the “.asm” file (assembler file).
Then, the assembler takes the “.asm” file and generates “.lst” file (list file ) and “.obj” file
(object file). The linker program combines several objects file to generate “.abs” file
(absolute object file); while the “.lst” file is used for debugging by the programmer. In the
end, the “.abs” file is converted to binary form (machine code) using hexadecimal format by
an OH program and thus generates “.hex” file. It is the “.hex” file that is burnt into the
microcontroller which implements the instructions through a firmware[11].
An instruction set of a specific microprocessor comprise instructions that it can execute. The
capabilities of a microprocessor are determined, largely, by the type of instructions it can
perform. Each microprocessor has a unique instruction set designed by its manufacturer to do
a specific task. These instructions include:
1) Data Processing Instructions: These operations perform actual data manipulations. The
instructions typically include: arithmetic/logic operations, increment/decrement and
rotate/shift operations. Typical arithmetic instructions include: ADD, SUBTRACT,
COMPARE, MULTIPLY, DIVIDE.
3) Data Movement Instructions: They move data from a register to memory and vice versa,
between registers, and between a register and an I/O device.
4) Instructions Using Memory Addresses: These contain a memory address, which is used to
read a data word from memory into a microprocessor register or for writing data from a
register into a memory location. Many instructions under data processing and movement fall
into this category.
5) Conditional and Unconditional JUMPS: These instructions typically include one of the
following:
27
i) Unconditional JUMP, which always transfers the memory address specified in the
instruction into the program counter.
ii) Conditional JUMP, which transfers the address portion of the instruction into the program
counter based on the conditions set by one of the status flags in the flag register [11].
The choice of programming language for this project is two-part: assembly and high-level
languages. On the assembly part, the AT89S52 microcontroller (8051 series) was used as a
core program for designing the electronic voting machine (EVM) hardware. The assembler
used in this design is the M-IDE assembler. On the high-level language aspect, we used C#
programming language for:
- Database design[10].
CHAPTER THREE
SYSTEM DESIGN
TIMING CIRCUIT
EEPROM
VOTER
CARD
LCD DISPLAY
µc 1 µc 2 UNIT
BUZZER
SERIAL
PORT
VIN VERIFICATION UNIT CABLE
VIN INPUT KEYPAD
PARTY/CANDIDATE
CHOICE INPUT
KEYPAD
VOTING PANEL
PC (LAPTOP)
The Electronic Voting Machine (EVM) is basically divided into two modules: VIN
verification unit and the voting panel as shown above.
30
DOUBLE POWER SUPPLY SOURCE: This has a voltage rating of 5V and 12V
each. The 5V is used to power the microcontroller while the 12V is used to power
the relay.
DISPLAY UNIT: To ensure user-machine visual interaction, the electronic voting
machine is designed with a provision for a liquid crystal display unit.
INPUT UNIT: Two keypad units are provided to allow users to either make entries of
password which allows them to vote subsequently based on a successful verification
or to enter the party of choice in order to cast their votes.
TIMING UNIT: This unit is responsible for allotting a specific time period to every
voter, to exercise his or her franchise. When the maximum time limit (5 minutes), of
a voter is exhausted the voting session is terminated and reset to start the whole
process afresh.
VOTER CARD: An EEPROM voter card is also a part of the electronic voting
machine. Each card possesses three unique numbers for appropriate identification of
card by the EVM. These unique numbers are burnt into the EEPROM card via a
registration module which comprises: a microcontroller programmed to store or
registers numbers in the EEPROM card and an LCD display unit to indicate
successful completion of the card registration process.
MICROCONTROLLER AND PC INTERFACE UNIT: The PC resident high-level
program is responsible for both registration of voters, result computation and
database linking. The interface between the PC and the hardware uses the serial mode
of transmission. Therefore, a serial port cable interfaces the voting machine with the
serial port of a computer system.
BUZZER/ALARM: The buzzer or alarm device sounds is used to alert the election
office(s) when an electorate wants to commit a fraud.
SPECIFICATION:
The power supply for the EVM is designed to supply both 12V and 5V simultaneously. Two
regulators were used to avoid the design of two separate power supply units (PSUs). When
the PSU is plug in an ac supply, the transformer will step down the main grid supply to a
level appropriate for rectification [9].
The fuse is incorporated as a safety measure in case of surging current flow into the system.
The bridge rectifier is used to rectify the ac to dc, since the EVM system needs dc to be
powered. Two regulators were used to provide 12V and 5V dc supply respectively. The
capacitors are for filtering since the output of the rectifier still contains ripples.
SPECIFICATION:
- Data Bus: 8
DESIGN:
P3.1 PORT
SPECIFICATION:
4 × 4 keypad
The system makes use of two keypad interfaces. One of the keypads is used for voters
identification number (VIN) section of the EVM and the other keypad used for the party
choice section.
34
The keypad shown in FIG.3.5 was interfaced to the microcontroller using a pull up resistor.
The pull up resistor limits the current sink by the 89S52 microcontroller. The microcontroller
usually reads the input port to which the keypads are connected. This is done to identify when
a key press occurs. If the pull resistors are not employed, excessive current would be sank by
the port of the microcontroller. The excessive current is contributed by both the external Vcc
and the internal loads of the port of 89S52 microcontroller. Thus, without the pull up
resistors, the ports will get damaged when a read is attempted by the microcontroller [8].
Vcc
RB
8051 P1.7
RE
BUZZER
The alarm or buzzer is interfaced to the 8051 as shown in the circuit above. P1.7 is a port pin
of the 8051 and is set through software to trigger the buzzer ON when necessary.
An NPN transistor functioning as a switch directly switches on the buzzer. This is because
the output current of the 8051 pin cannot effectively drive the buzzer. RB limits the base
current to the value required to switch the transistor. The output voltage is taken across the
resistor RE and so, the load (buzzer) is connected across RE [8].
SPECIFICATION:
8051µC
GROUND
2
P3.0 SERIAL CLOCK
P3.1 3
SERIAL DATA
P3.2 4
CARD DETECTION
EEPROM CARD
The EEPROM card interface is designed with 5 contact points: VCC , ground, serial clock,
serial data and card detection pins.
The VCC and ground contacts (or terminals) enable the EEPROM to connect to a power
source. The serial clock (SCL) contact connects to the microcontroller pin which clocks the
EEPROM during data write/read. Data is read from or written to the EEPROM card through
the serial data contact (SDC).
The last contact of the card is the card detection point. Once a card is slotted into the
machine, the 8051 µC reads the contact to detect a card slot event. Therefore, the
microcontroller polls the particular contact [8].
During the process of voters’ registration, the personal information or bio data of each voter
is stored in a database program resident in the PC device. The EEPROM voter card
registration module writes to the EEPROM memory, three groups of numbers:
(1) Valid Card Identification Number: The essence of this unique number is to enable the
voting machine to identify voters with valid voters’ cards. The voting machine allows for a
37
maximum of three attempts to vote, after which the card is rendered invalid. The case of
“invalid cards” occurs when voters fail to key in the correct Voter Identification Number
(VIN) after three successive trials. The EVM acts in this fashion so as to ensure that the
rightful owner of the voter card votes accordingly and does not use the card of another voter.
Thus, the valid card identification number is the first number checked by the EVM to
determine if the voter card has been used for three unsuccessful vote trials.
(2) Double Voting Identifier (DVI): This second number enables the EVM to identify
voters that have voted before in a particular election process.
On the successful completion of a voting process, the EVM via a microcontroller writes a
new number known as the “double vote identifier” into the EEPROM memory of the voter’s
card. This new number (now stored in the card) is detected when a voter attempts to vote
more than once (double/multiple voting). An immediate detection of the DVI triggers on the
buzzer or alarm device to sound whereby informing the electoral officer or officers of a
security breach or illegal entry to the system.
(3) Voter Identification Number (VIN): The VIN is generated by the PC database program
during voter’s registration. The number is programmed into the voter’s card using the
EEPROM voter card registration module. The VIN of voter A is totally different from that of
voter B, hence the VIN is used to verify the authenticity of the voters as they cast their votes
on the election day.
As shown in the block model of the EVM system in the Appendix A, there are two 8051
microcontrollers. Both co-ordinate and monitor the entire voting process performed by the
EVM. The first microcontroller (µC 1) continuously polls the EEPROM card slot to detect or
sense when an EEPROM card is plugged into the EVM. On detecting an EEPROM card, the
first microcontroller starts the timing circuit: which apportions time to each voter. Then, the
whole process of checking all three numbers in the voter card as earlier described starts off,
and in the case of any misnomer detected, the buzzer or alarm device is triggered on.
In addition to validity checks on the voter card as well as multiple votes check, the first
microcontroller makes requests for and receives the VIN inputs from voters for verification.
38
During verification, it compares the VIN input against the one read from the voter card. Any
mismatch after three trial limits indicates a stolen or misplaced card. After exhausting the
trial attempts allotted, the first microcontroller triggers on the buzzer to sound as alert. This
microcontroller also displays the values entered (via the LCD display unit) during
verification.
On successful verification of VIN input, the first microcontroller enables the voting panel to
perform its function. The voting panel is responsible for sending the choice of candidates by
voters to the PC program. The panel is synchronized with the VIN verification unit. The
voting panel receives choice of voters and waits for the verification unit to issue it with a
command to send the choice made to PC. During this brief wait period, the verification unit
on receiving the input signal indicates the voter has made a choice, checks to see that the
voter card is still plugged on to the machine. It then rewrites the double voting identifier
(DVI) into the card’s memory, to enable it detect future attempts to vote more than once. By
completing the above writing, the process, the voting panel is informed of the completion via
a command indicating that it is right time to send the voter’s choice to the PC program. In the
case where the card is removed before the verification unit completes its double voting re-
writing procedure, the voting panel issues a command signalling the voting panel to discard
the choice.
39
START
µC 1 CHECKS NO
FOR CARD
VALIDITY
YES
YES
1
40
YES
µC 2 IS ENABLED
STOP
START
ADMIN LOGIN
PAGE
ENTER
USERNAME
PASSWORD? NO
YES
VOTER
PANEL
STOP
The flow chart above describes the EVM interface containing a central database. The EVM
software was realised using the following software packages:
1) C#.
2) My SQL.
3) Visual Studio 2010.
All three packages were thoroughly combined in designing the EVM database and user
interface[10].
The database forms the pivot of the EVM software. The following are built-in tables in the
database.
CHAPTER FOUR
4.1.1: SIMULATION
The simulation tool used for analysing the EVM circuitry design before actual
implementation was a computer aided design tool known as Proteus 7 (as well as on a
breadboard). The assembly language software used in designing the EVM hardware was
MIDE, which is highly compatible with Proteus 7. The EVM source code used in the
simulation is shown in Appendix B.
4.1.2: IMPLEMENTATION
A prototype of the EVM was designed and fabricated on a Vero board. After implementing
the design, several tests were performed to ensure its efficient operation.
The EEPROM memory adopted as the voter card is the AT24C08 from ATMEL. This
memory is an 8Kbits memory. The preference for this memory is based on its relatively fast
access speed whereby the latency involved in accessing the memory is relatively small. Such
a memory was the ideal chosen for the implementation of our project work considering the
fact that we needed to reduce the amount of time spent by each voter. The AT24C08 is also a
serial access based memory. This means that it uses only two pins for storage and retrieval of
data from the EEPROM. These pins are called serial data pins-pin 7 and serial clock, pin 6.
Unlike various memory types which could be 8-bit based parallel transmission. This memory
type IC enables us to greatly reduce the number of slots when card is inserted during the
voting process.
The figure shown below illustrates how the EEPROM circuit is interfaced with the
microcontroller (89S52) via pin 3.0, 3.1 & 3.2. Pin 3.2 of the microcontroller is used to detect
the presence of the card whenever it is inserted. This is designed with five projections. These
projections enable the EEPROM memory to make contact with Vcc and ground in order to
power the EEPROM. From the remaining three projections, two are used for accessing the
45
EEPROM storage thus reading from and writing to the EEPROM voter’s card. These
projections are the serial data and serial clock: SDA and SCL respectively [8]. The fifth
projection is connected to the ground and is meant to contact pin 3.2 of the microcontroller as
shown in FIG.4.0.
The microcontroller continually toggles pin 3.2 to detect the presence of a card insertion.
Once a card is inserted into the slot and the fifth projection makes contact with pin 3.2 of the
microcontroller (as shown below), then card insertion has occurred.
The display type employed in the project is the Liquid Crystal Display (LCD) .The exact
LCD used is the RTI602C 16x2 characters. The LCD was adopted instead of seven segment
display because of the multiplicity of characters to be displayed. Port 0 of the microcontroller
was used for sending data to the data pins of the LCD i.e. DB0 – DB7.
Because port 0 of the microcontroller has no internal pull up resistor unlike port 2 and 3,
10kΩ resistors were used to pull up the port before the LCD was connected. The pins of
microcontroller has open drain transistors such that if no pull resistor were attached to port
0,the drain will float when the transistor is switched ON. The 10kΩ resistor used as pull up
resistor in the design is specified by the manufacturer’s datasheet [8].
46
The LCD can only display ASCII characters that it receives at the input data pins. So, a
minimum of 7bits is enough to represent each ASCII character. In a nutshell, we eventually
used only 7 pins of the data input of the LCD. The eighth data input pin was configured as a
busy flag. This data input pin DB7 was connected to port pin 3.7 of the microcontroller to
enable it to check when the LCD is busy. This is done before sending data to the LCD so as
to avoid losing the data sent to the LCD.
The control pin of the LCD: EH, RS and RW were connected to the port pins 2.0, 2.1 and 2.2
respectively. This was done to ensure that the microcontroller issue control command to the
LCD.
The circuit for interfacing the microcontroller to the buzzer is shown below. The essence of
the buzzer is to draw attention when fraud or double voting is attempted. The transistor used
in the above design is C828 general purpose transistor [9]. Since most general transistors
have a minimum dc gain of 20, this gain was used for determining the bias resistors as shown
in FIG.4.2.
The resistor attached to the emitter is 10Ω and it requires saturation current, which can be
expressed as IC = IE = (VCC–VBE ) / RE
But IC/IB = β
Ic/IB = 20
48
= 0.73mA/IB = 20
IB = 0.73mA/20 =36.5µA
The output of a pin the microcontroller is guaranteed to be 4.0V and a maximum of 5V.
Therefore, the transistor base resistor value can be calculated as RB =VB /IB
= 4/36.5µA = 109.5KΩ
Thus, 109kΩ will ensure that the transistor is saturated when operated as a switch as shown
in the circuit below. 1kΩ was used instead of the calculated value of 109kΩ because 1kΩ will
ensure that the transistor operates at saturated region of the minimum dc gain (which was
assumed to be 20).
Specifications:
Regulator 1 = 7812
Regulator 2 = 7805
The power supply makes use of two regulators 7812 and 7805 respectively, in which the
7812 supplies approximately 12V, while 7805 gives an output voltage of approximately 5V.
A 0.5A fuse was used to prevent the draining of excess current from the power supply, which
could damage the system. The capacitors: C1, C2, C3 serve as filters to eliminate ripples from
the rectified outputs [9].
The serial port of PC operates with the old RS232 voltage levels. This means those modern
integrated circuits that operate with TTL are not compatible with the serial port.
The 8051 microcontroller is a TTL IC. Therefore, to interface a PC serial port with a
microcontroller requires a line driver (voltage driver) to convert the RS232 signals to TTL
voltage levels that will be acceptable to the 8051 TXD and RXD pins i.e. the data transmit
and data receive pins respectively. Several converters can also be used for the purpose of
conversion. However, in our design we specifically chose the MAX 232 manufactured by
Maxim Corp. The MAX232 converts from RS232 voltage levels to TTL voltage levels and
vice versa. One advantage of MAX232 chip is that it uses a +5V power source which is
equivalent to the source voltage of the 8051. Therefore a single 5V power supply can serve
the requirements of the 8051 and MAX232. This eliminates the need for the dual power
supplies as used by older systems [8].
The project was tested for functionality after implementation. The following tests were
conducted to ensure maximum workability of the electronic voting machine (EVM):
The EVM was test run to check for its normal power rating. The mains voltage supplied to
the machine is 220V to 240V with an internal running voltage of 12V.
The following tables describe test procedures carried out on the EVM set up and their
corresponding outcomes in an effort to confirm its full operating capacity:
B) TESTS PERFORMED ON THE VOTING PANEL: The voting panel becomes enabled
when the verification exercise on the VIN verification unit is successful.
i) Candidate Database:
v) Voters Database:
The GUI worked well when tested for functionality. The following are samples of the GUIs
designed under the software aspect of this project:
The lines of codes for the assembly language build up of the EVM hardware, serial port
configuration and database design were individually analysed and thoroughly checked for
errors (via visual inspection). After each check, the right corrections were made to boost
maximum performance of the lines of code so that they carry out their functions adequately.
57
CHAPTER FIVE
The list below shows the cost analysis for the design:
1) LCD 2 2,000
3) 100µFx16V Capacitor 1 70
5) 1KΩ Resistor 3 15
6) 10KΩ Variable 1 20
Resistor
7) C828 Transistor 3 30
8) Diode IN4007 2 20
9) Transformer 1 400
TOTAL N 14,595.00
From the above analysis, the EVM design is highly cost effective and could be sponsored by
government on a large scale basis for the conduct of the general elections.
5.2: CONCLUSION
This project is aimed at boosting the efficiency, credibility and reliability of elections
conducted in our democratic setting. The benefits derived from employing this method of
voting are enormous and, would go a long way in reflecting the people’s true choice in the
selection of their leaders as well as fast track development strides especially in Nigeria’s
political terrain.
5.3: RECOMMENDATION
Based on the challenges we encountered in the course of our work, we recommend that more
research be carried out in order to improve the EVM design. There are some lapses, which we
would like similar designs to tackle, such as interfacing of the EVM with printer to get the
hard copy of the result almost instantly from the database.
Also, our design is not waterproofed. We therefore recommend that for future work on the
EVM, materials used in the packaging should be relatively unaffected by environmental
conditions such as temperature variations, the ingress of water, pests or rodents attack etc.
EVM database could be built to have the functionality of being able to match voters’ pictures
in the database.
This project is only a prototype which needs more features and enhancement to make the
system more robust, and these features could include:
1) A Printer that can give print outs of votes recorded as means of physical verification.
Finally, we recommend the use of biometric for fingerprint identification of the electorate
especially in the case of identical twins where pictures could be misleading. Finger prints are
unique for every individual and so is highly recommended for further research work in the
design of the EVM.
60
REFERENCES
[2] Arthur M. Keller, David Mertz et al. Privacy Issues In An Electronic Voting Machine.
UC Berkley (USA), 2005.
[3] Dill, D.L. Electronic Voting: An Overview of The Problem. Retrieved November
[4] Jones, D. W. A Brief Illustrated History of Voting. Retrieved September, 23, 2005
Linacre House, Jordan Hill, Oxford OX2 8DP, 200 Wheeler Road, Burlington, MA
01803, 2004.
Western Publishing Company,1991. Beginning Visual Cⱡⱡ 2010.Wiley Publishing, Inc, 2010.
[8] Muhammad, A.M and Janice, G.M, The 8051 Microcontroller and Embedded Systems:
Using Assembly and C .Prentice Hall. 2004.
[9] Paul Scherz, Practical Electronics for Inventors. McGraw-Hill, New York, 2000.
[10] Ullman, L. Php and Mysql for Dynamic Web Design (first Edition).London: Peach Pit
Press. 2003.
[11] M. Rafiquzzaman. Fundamentals of Digital Logic And Microcomputer Design. John
Wiley And Sons, Inc.: New Jersey. 2005.
61
APPENDIX A
APPENDIX B
;;;;;;;;;;;
ELECTRONIC VOTING MACHINE
MOV A,#38H
ACALL COMMAND
MOV A,#0EH
ACALL COMMAND
MOV A,#01H
ACALL COMMAND
MOV A,#06H
ACALL COMMAND
MOV A,#02H
ACALL COMMAND
SETB P3.3
SETB P3.5
SETB P3.2
ACALL KEYBOARD
ACALL HASVOTED ; clear p3.3 to inform the second microcontroller that voter has made
choice
MOV A,R3
ACALL HASSENTVOTE
HERE2:SJMP HERE2
SEND_VOTE:
ACALL DELAY
MOV TMOD,#20H
MOV TH1,#-3
MOV SCON,#50H
SETB TR1
MOV SBUF,A
CLR TI
HERE1:SJMP HERE1
RET
HASSENTVOTE:
CLR P3.2
RET
HASVOTED:CLR P3.3
RET
ACALL COMMAND
MOV A,#02H
ACALL COMMAND
RET
64
MOV P0,A
SETB P1.0
CLR P1.1
SETB P1.2
CLR P1.2
RET
CLR P1.0
SETB P1.1
SETB P1.2
JB P0.7,BACK
RET
KEYBOARD:
SETB P2.0
SETB P2.1
SETB P2.2
SETB P2.3
K1:CLR P2.4
CLR P2.5
CLR P2.6
CLR P2.7
65
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,K1
K2:ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL DELAY
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,OVER
SJMP K2
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,OVER1
SJMP K2
OVER1:CLR P2.4
66
SETB P2.5
SETB P2.6
SETB P2.7
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,ROW0
SETB P2.4
CLR P2.5
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,ROW1
SETB P2.5
CLR P2.6
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,ROW2
SETB P2.6
CLR P2.7
ACALL ACCUMULATO
ANL A,#00001111B
CJNE A,#00001111B,ROW3
LJMP K2
ROW0:MOV DPTR,#KCODE0
67
SJMP FIND
ROW1:MOV DPTR,#KCODE1
SJMP FIND
ROW2:MOV DPTR,#KCODE2
SJMP FIND
ROW3:MOV DPTR,#KCODE3
SJMP FIND
FIND: RRC A
JNC MATCH
INC DPTR
SJMP FIND
MATCH:ACALL CLEAR
CLR A
MOVC A,@A+DPTR
LJMP RETURN
ACALL CLEAR
LJMP K1
CONTINUE:CJNE A,#0,LOADANPP
MOV DPTR,#PDP
CLR A
ACALL PARTY_DISPLAY
68
LJMP K1
LOADANPP:CJNE A,#1,LOADAPGA
MOV DPTR,#ANPP
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADAPGA:CJNE A,#2,LOAD_ACN
MOV DPTR,#APGA
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOAD_ACN:CJNE A,#3,LOAD_AD
MOV DPTR,#ACN
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOAD_AD:CJNE A,#4,LOAD_UPGA
MOV DPTR,#AD
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOAD_UPGA:CJNE A,#5,LOADCPC
MOV DPTR,#UPGA
69
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADCPC:CJNE A,#6,LOADLP
MOV DPTR,#CPC
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADLP:CJNE A,#7,LOADLPP
MOV DPTR,#LP
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADLPP:CJNE A,#8,LOADDPP
MOV DPTR,#LPP
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADDPP:CJNE A,#9,LOADRSS
MOV DPTR,#DPP
CLR A
ACALL PARTY_DISPLAY
LJMP K1
70
LOADRSS:CJNE A,#10,LOADCPA
MOV DPTR,#RSS
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADCPA:CJNE A,#11,LOADCCC
MOV DPTR,#CPA
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADCCC:CJNE A,#12,LOADDNP
MOV DPTR,#CCC
CLR A
ACALL PARTY_DISPLAY
LJMP K1
LOADDNP:CJNE A,#15,GETBACK_TOK1
MOV DPTR,#DNP
CLR A
ACALL PARTY_DISPLAY
GETBACK_TOK1:LJMP K1
RETURN:RET
PARTY_DISPLAY:MOVC A,@A+DPTR
JZ EXIT
71
ACALL SAVE_PARTY
ACALL DISPLAY
INC DPTR
CLR A
SJMP PARTY_DISPLAY
CLR A
EXIT:RET
ACCUMULATO:
JNB P2.0,AC4
SETB ACC.0
SJMP E
AC4:CLR ACC.0
E:JNB P2.1,AC5
SETB ACC.1
SJMP F
AC5:CLR ACC.1
F: JNB P2.2,AC6
SETB ACC.2
SJMP G
AC6:CLR ACC.2
G:JNB P2.3,AC7
SETB ACC.3
SJMP H
72
AC7:CLR ACC.3
H: RET
MOV P0,A
CLR P1.0
CLR P1.1
SETB P1.2
CLR P1.2
RET
DELAY:NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
73
NOP
RET
SAVE_PARTY:JZ RETURN_TOCALLER
MOV R3,A
RETURN_TOCALLER:RET
ORG 300H
KCODE0: DB 3,2,1,0
KCODE1: DB 7,6,5,4
KCODE2: DB 11,10,9,8
KCODE3: DB 15,14,13,12
ORG 500H
PDP: DB "PDP",2,0
ANPP: DB "ANPP",3,0
APGA: DB "APGA",4,0
AD: DB "ACN",5,0
ACN: DB "AD",0
UPGA: DB "UPGA",0
CPC: DB "CPC",0
LP: DB "LP",0
LPP: DB "LPP",0
DPP: DB "DPP",0
RSS: DB "RSS",0
CPA: DB "CPA",0
74
CCC: DB "CCC",0
DNP: DB "DNP",0
PPA: DB "PPA",0
UNDP: DB "UNDP",0
END
75
APPENDIX C
GUI CODE
</Compile>
<Compile Include="Results.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Results.Designer.cs">
<DependentUpon>Results.cs</DependentUpon>
</Compile>
<Compile Include="SpecialButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Splash.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Splash.designer.cs">
<DependentUpon>Splash.cs</DependentUpon>
</Compile>
<Compile Include="ViewItems.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ViewItems.Designer.cs">
<DependentUpon>ViewItems.cs</DependentUpon>
</Compile>
<Compile Include="VistaApi.cs" />
<Compile Include="Vote.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Vote.Designer.cs">
<DependentUpon>Vote.cs</DependentUpon>
</Compile>
<Compile Include="VoteNew.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="VoteNew.Designer.cs">
<DependentUpon>VoteNew.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="About.resx">
<DependentUpon>About.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RegisterMgr.resx">
<DependentUpon>RegisterMgr.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Login.resx">
<DependentUpon>Login.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="AdminPanel.resx">
<DependentUpon>AdminPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MgrPanel.resx">
<DependentUpon>MgrPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="RegisterVoter.resx">
<DependentUpon>RegisterVoter.cs</DependentUpon>
78
</EmbeddedResource>
<EmbeddedResource Include="RegisterCandidate.resx">
<DependentUpon>RegisterCandidate.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="RegisterParty.resx">
<DependentUpon>RegisterParty.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Results.resx">
<DependentUpon>Results.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Splash.resx">
<DependentUpon>Splash.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ViewItems.resx">
<DependentUpon>ViewItems.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Vote.resx">
<DependentUpon>Vote.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="VoteNew.resx">
<DependentUpon>VoteNew.cs</DependentUpon>
</EmbeddedResource>
<None Include="Helpers.cd" />
<None Include="RegistrationClasses.cd" />
<None Include="MainClasses.cd" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Skeleton.cd" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Tips.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\camera.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\camera2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\send.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\upload.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Login Manager.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Monsieur_Security_v2_2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\BRIGHTS PRINTER.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\office22.png" />
79
</ItemGroup>
<ItemGroup>
<None Include="Resources\print item.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\add_user.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\agent.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\close folder.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 057.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 024.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 015.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 001.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 067.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\iCandy_Junior 023.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\viewmag.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Drop Box.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\elicn.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\BACK2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\collinspix.jpg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ccmg.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and
uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
80