Você está na página 1de 34

ABSTRACT

Embedded systems play a vital role in the present world. Embedded systems are getting more and more common in areas like communication, multimedia, process control and consumer electronics. They usually have to fulfil strict requirements in terms of performance, safety, power consumption and cost efficiency. Simultaneously, time-to-market for new products has to be reduced. New design environments have to support the design of such systems from the early design phases, starting with the system specification. Electronic voting machine has now days become an effective tool for voting. It ensures flawless voting and thus has become more widespread. It ensures people about their vote being secured. It avoids any kind of malpractice and invalid votes. Also such kind of system becomes more economical as consequent expenditure incurred on manpower is saved. It is also convenient on the part of voter, as he has to just press one key whichever belongs to his candidates. The Electronic Voting Machine basically consists of three main blocks; these are switches, micro controller and seven segment display. This voting machine is designed for four candidates. The provision of casting vote has been provided by means of four tactile switches. These switches take manual inputs from the user and transfer them to the pins of controller. Based on these inputs, the vote count for different candidates is increased by AT89C51.There will be four switches and each switch specified for one candidate. In voting procedure switch of respective candidate is pressed, the corresponding signal is sensed by the microcontroller. The Microcontroller used here is AT89C51, that senses the signal given from switches and decides the mode of operation in voting mode it increments the data for corresponding switch i.e. respective candidate as well as it sends signal to display block to indicate one switch is pressed. To display the vote count, four seven segment displays are also connected to the microcontroller (refer seven segment interfacing with AT89C51). The count value for each candidate is sent to the corresponding segment. The four counts appear continuously by multiplexing these segments through AT89C51.

Chapter 1 INTRODUCTION
1.1 EMBEDDED SYSTEMS: Embedded systems are electronic devices that incorporate microprocessors with in their implementations. The main purposes of the microprocessors are to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features are only matter of rewriting the software that controls the device. In other words embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week, millions of tiny computer chips come pouring out of factories finding their way into our everyday products. Embedded systems are self-contained programs that are embedded within a piece of hardware. Whereas a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is as a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible. Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses. Embedded system technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are also highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization.

Characteristics:
Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. Firmware is the name for software that is embedded in hardware devices, e.g. in one or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods, sometimes measured in years. Firmware is usually developed and tested too much harsher requirements than is general-purpose software, which can usually be easily restarted if problems occur.

Platform:
There are many different CPU architectures used in embedded designs. This in contrast to the desktop computer market which is limited to just a few competing architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PCs which are used in the Apple Macintosh. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.

Tools:
Like a typical computer programmer, embedded system designers use compilers, assemblers and debuggers to develop an embedded system. Those software tools can come from several sources: Software companies that specialize in the embedded market Ported from the GNU software development tools. Sometimes, 3

development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Embedded system designers also use a few software tools rarely used by typical computer programmers.

1.2 INTRODUCTION TO ELECTRONIC VOTING MACHINE:


Electronic voting machine has now replaced the traditional mechanism of voting due to several advantages like security, automatic counting etc. This project presents a way to develop an electronic voting machine which displays the count of votes on a seven segment display interface. A user can get his/her vote register through a set of switches (one for each candidate). After every cast of vote, the subsequent count can be seen on seven segment display. This based seven segment display electronic voting machine is designed for four candidates. The input part consists of a set of four tactile switches. The switches and seven segment displays are interfaced to microcontroller. The provision of casting votes for the candidates has been provided through four of these switches. For more details on working with seven segment displays, refer seven segment displays interfacing with 8051. The data pins of the seven segment display (pins 1-7) are connected to the output port P2 of the microcontroller. The control pins are connected to port P0 pins P0^0, P0^1, P0^2 & P0^3 respectively.

Working:
The voting is started by pressing the init switch after which the user is prompted to vote. The count of votes is stored in four different variables. As soon as the user votes for a candidate by pressing one of the switches, the value of the corresponding variable is increased by one .
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 blue button placed in front of your favourite candidate and release. Some designers keep a utility program to turn data files into code, so that they can include any kind of data in a program. Most designers also have utility programs to add a checksum or CRC to a program, so it can check its program data before executing it. In the recent years, voting equipments which were widely adopted may be divided into five types. (1) Paper-based voting: The voter gets a blank ballot and use a pen or a marker to indicate he want to vote for which candidate. Hand-counted ballots is a time and labor consuming process, but it is easy to manufacture paper ballots and the ballots can be retained for verifying, this type is still the most common way to vote. (2) Lever voting machine: Lever machine is peculiar equipment, and each level is assigned for a corresponding candidate. The voter pulls the level to poll for his favorite candidate. This kind of voting machine can count up the ballots automatically. Because its interface is not user-friendly enough, giving some training to voters is necessary. (3) Direct recording electronic voting machine: This type, which is abbreviated to DRE, integrates with keyboard; touch screen, or buttons for the voter press to poll. Some of them lay in voting records and counting the votes is very quickly. But the other DRE without keep voting records are doubted about its accuracy. (4) Punch card: The voter uses metallic hole-punch to punch a hole on the blank ballot. It can count votes automatically, but if the voters perforation is incomplete, the result is probably determined wrongfully. (5) Optical voting machine: After each voter fills a circle correspond to their favorite candidate on the blank ballot, this machine selects the darkest mark on each ballot for the vote then computes the total result. This kind of machine counts up ballots rapidly. However, if the voter fills over the circle, it will lead to the error result of optical-scan.

Chapter 2 LITERATURE SURVEY


As the world watched the electoral drama unfold in Florida at the end of 2000, people started wondering, Wouldnt all our problems be solved if they just used Internet Voting? People all over the world soon started taking a hard look at their voting equipment and procedures, and trying to figure out how to improve them. There is a strong inclination towards moving to Remote Internet Voting at least among the politicians in order to enhance voter convenience, increase voter confidence and voter turnout. However, as will be seen later in this paper, there are serious technological and social aspects that make Remote Internet Voting infeasible in the visible future. Therefore, many technologists have suggested that remote pollsite electronic voting, where the voter can vote at any poll-site seems to be the best step forward as it provides better voter convenience, but at the same time, does not compromise security. This paper presents a survey of the state of the art in Electronic Voting, including the various works done in Internet Voting (and the arguments against its use), as well as in electronic poll-site voting. Electronic voting refers to the use of computers or computerized voting equipment to cast ballots in an election. Sometimes, this term is used more specifically to refer to voting that takes place over the Internet. Electronic systems can be used to register voters, tally ballots, and record votes. The Caltech/MIT Voting Technology Project came into being in order to develop a new voting technology in order to prevent a recurrence of the problems that threatened the 2000 U.S. Presidential Elections. The report assesses the magnitude of the problems, their root causes and how technology can reduce them. They address a wide range of What is issues including voting procedures, voting equipment, voter registration, polling places, absentee and early voting, ballot security, cost and public finance of elections, etc. They then propose a novel What could be framework for voting technology and propose that a process for innovation be setup. The framework is A Modular Voting Architecture (Frogs) in which vote generation is performed separately from vote casting, and the Frog forms a permanent audit trail, the importance of which cannot be over-stressed. Here, the vote generation machine can be proprietary whereas the vote casting machine must be open-source and thoroughly verified and certified for correctness and security. Finally, the report provides a set of short-term and long-term recommendations on the various issues related to voting. 6

Chapter 3 DESIGN IMPLEMENTATION


The Electronic Voting Machine basically consists of three main blocks; these are switches, micro controller, and seven segment display. This voting machine is designed for four candidates. The provision of casting vote has been provided by means of four tactile switches.

Figure 3.1: Block diagram of Electronic Voting Machine

3.1 MICROCONTROLLER:
An embedded system is a combination of software and hardware to perform a dedicated task. Some of the main devices used in embedded products are Microprocessors and Microcontrollers. 7

Microprocessors are commonly referred to as general purpose processors as they simply accept the inputs, process it and give the output. In contrast, a microcontroller not only accepts the data as inputs but also manipulates it, interfaces the data with various devices, controls the data and thus finally gives the result. All these tasks are possible with the microcontroller because the microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and timer all on a single chip. This fixed amount of RAM, ROM and number of I/O ports in microcontroller makes them ideal for many applications where cost and space are critical. Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products. 8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UVEPROM, Flash and NV-RAM. The microcontroller used in this project is AT89C51. Atmel Corporation introduced this 89C51 microcontroller. This microcontroller belongs to 8051 family. This microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one serial port and four ports (each 8-bits wide) all on a single chip. AT89C51 is Flash type 8051. The present project is implemented on Kiel vision. In order to program the device, preload tool has been used to burn the program onto the microcontroller. The features, pin description of the microcontroller and the software tools used are discussed in the following sections.

3.1.1 Description:
The AT89C51 is a low-voltage, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable memory. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, AT89C51 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. In addition, the AT89C51 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 until the next hardware reset.

Figure: 3.2 Pin diagram of AT89C51

Figure 3.3: Block diagram of 89C51

3.1.2 PIN Description: VCC: Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND: Pin 20 is the ground.

10

XTAL1 and XTAL2:


XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as an on-chip oscillator, as shown in Figure 3.4. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in the below figure. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Figure 3.4: Oscillator Connections C1, C2 = 30 pF 10 pF for Crystals = 40 pF 10 pF for Ceramic Resonators

Figure 3.5: External Clock Drive Configuration

11

Reset:
Pin9 is the reset pin. It is an input and is active high. Upon applying a high pulse to this pin, the microcontroller will reset and terminate all the activities. This is often referred to as a power-on reset.

EA (External access):
Pin 31 is EA. It is an active low signal. It is an input pin and must be connected to either Vcc or GND but it cannot be left unconnected. The 8051 family members all come with on-chip ROM to store programs. In such cases, the EA pin is connected to Vcc. If the code is stored on an external ROM, the EA pin must be connected to GND to indicate that the code is stored externally.

PSEN (Program store enable): This is an output pin. ALE (Address latch enable): This is an output pin and is active high. Ports 0, 1, 2 & 3:
The four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET are configured as input, since P0-P3 have value FFH on them.

Port 0(P0):
Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data. ALE indicates if P0 has address or data. When ALE=0, it provides data D0-D7, but when ALE=1, it has address A0-A7. Therefore, ALE is used for demultiplexing address and data with the help of an internal latch. When there is no external memory connection, the pins of P0 must be connected to a 10K-ohm pull-up resistor. This is due to the fact that P0 is an open drain. With external pull-up resistors connected to P0, it can be used as a simple I/O, just like P1 and P2. But the ports P1, P2 and P3 do not need any pull-up resistors since they already have pullup resistors internally. Upon reset, ports P1, P2 and P3 are configured as input ports.

Port1&Port2:
With no external memory connection, both P1 and P2 are used as simple I/O. With external memory connections, port 2 must be used along with P0 to provide the 16-bit address for the external memory. Port 2 is designated as A8-A15 indicating its dual function. While P0 provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the address.

12

Port 3:
Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. P3 does not need any pull-up resistors, the same as port 1 and port 2. Port 3 has an additional function of providing some extremely important signals such as interrupts.

Table 3.1: Port 3 Alternate Functions

Addressing modes:
While operating, processor processes data according to the program instructions. Each instruction consists of two parts. One part describes what should be done and another part indicates what to use to do it. This later part can be data (binary number) or address where the data is stored. All 8051 microcontrollers use two ways of addressing depending on which part of memory should be accessed:

Direct addressing:
On direct addressing, a value is obtained from a memory location while the address of that location is specified in instruction. Only after that, the instruction can process data (how depends on the type of instruction: addition, subtraction, copy). Obviously, a number being changed during operating a variable can reside at that specified address. For example: Since the address is only one byte in size ( the greatest number is 255), this is how only the first 255 locations in RAM can be accessed in this case

13

the first half of the basic RAM is intended to be used freely, while another half is reserved for the SFRs.

Indirect addressing:
On indirect addressing, a register which contains address of another register is specified in the instruction. A value used in operating process resides in that another register. For example: Only RAM locations available for use are accessed by indirect addressing (never in the SFRs). For all latest versions of the microcontrollers with additional memory block (those 128 locations in Data Memory), this is the only way of accessing them. Simply, when during operating, the instruction including @ sign is encountered and if the specified address is higher than 128 (7F hex.), the processor knows that indirect addressing is used and jumps over memory space reserved for the SFRs.

3.2 MACHINE CYCLE FOR 8051:


The CPU takes a certain number of clock cycles to execute an instruction. In the 8051 family, these clock cycles are referred to as machine cycles. The length of the machine cycle depends on the frequency of the crystal oscillator. The crystal oscillator, along with on-chip circuitry, provides the clock source for the 8051 CPU. The frequency can vary from 4 MHz to 30 MHz, depending upon the chip rating and manufacturer. But the exact frequency of 11.0592 MHz crystal oscillator is used to make the 8051 based system compatible with the serial port of the IBM PC. In the original version of 8051, one machine cycle lasts 12 oscillator periods. Therefore, to calculate the machine cycle for the 8051, the calculation is made as 1/12 of the crystal frequency and its inverse is taken. The assembly language program is written and this program has to be dumped into the microcontroller for the hardware kit to function according to the software. The program dumped in the microcontroller is stored in the Flash memory in the microcontroller. Before that, this Flash memory has to be programmed and is discussed in the next section.

3.3 PROGRAMMING FLASH:


The AT89C51 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH) and ready to be programmed. The programming interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal. The low-voltage programming mode provides a convenient way to program the AT89C51 inside the users system, while the high-voltage 14

programming mode is compatible with conventional third party Flash or EPROM programmers. The AT89C51 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.

Table 3.2: Top side marking & signature codes

The AT89C51 code memory array is programmed byte-byte in either programming mode. To program any nonblank byte in the on-chip Flash Memory, the entire memory must be erased using the Chip Erase Mode.

3.4 PROGRAMMING ALGORITHM:


Before programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table. To program the AT89C51, the following steps should be considered: 1. Input the desired memory location on the address lines. 2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.

3.5 PROGRAMMING INTERFACE:


Every code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. All

15

major programming vendors offer worldwide support for the Atmel microcontroller series.

Table 3.3: Flash programming mode

Figure 3.6: Pin diagram of AT89C51 flash magic

16

FEATURES OF AT89C51:
4K Bytes of Re-programmable Flash Memory. RAM is 128 bytes. 2.7V to 6V Operating Range. Fully Static Operation: 0 Hz to 24 MHz Two-level Program Memory Lock. 128 x 8-bit Internal RAM. 32 Programmable I/O Lines. Two 16-bit Timer/Counters. Six Interrupt Sources. Programmable Serial UART Channel.

3.6 POWER SUPPLY:


All digital circuits require regulated power supply. In this article we are going to learn how to get a regulated positive supply from the mains supply.

Figure 3.7: Basic block diagram of a fixed regulated power supply.

TRANSFORMER:

Figure 3.8: Basic Diagram of Transformer A transformer consists of two coils also called as WINDINGS namely PRIMARY & SECONDARY. They are linked together through inductively coupled electrical conductors also called as CORE. A changing current in the primary causes a change in the Magnetic Field in the core & this in turn induces an alternating voltage in the secondary coil. If load is applied to the secondary then an alternating current will flow 17

through the load. If we consider an ideal condition then all the energy from the primary circuit will be transferred to the secondary circuit through the magnetic field.

So

The secondary voltage of the transformer depends on the number of turns in the primary as well as in the secondary.

Voltage regulator:
A Voltage regulator is a device which converts varying input voltage into a constant regulated output voltage. Voltage regulator can be of two types 1) Linear Voltage Regulator Also called as Resistive Voltage regulator because they dissipate the excessive voltage resistively as heat. 2) Switching Regulators They regulate the output voltage by switching the Current ON/OFF very rapidly. Since their output is either ON or OFF it dissipates very low power thus achieving higher efficiency as compared to linear voltage regulators. But they are more complex & generate high noise due to their switching action. For low level of output power switching regulators tend to be costly but for higher output wattage they are much cheaper than linear regulators. The most commonly available Linear Positive Voltage Regulators are the 78XX series where the XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.

Figure 3.9:Operation of Voltage Regulator

18

After filtering the rectifier output the signal is given to a voltage regulator. The maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If the input voltage gets below the Vmin of the regulator due to the ripple voltage or due to any other reason the voltage regulator will not be able to produce the correct regulated voltage.

Fig 3.10: Circuit Diagram of power supply

IC 7805:
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp although lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also has a built-in current limiter as a safety feature. 7805 is manufactured by many companies, including National Semiconductors and Fairchild Semiconductors. The 7805 will automatically reduce output current if it gets too hot. The last two digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators is designed to work in complement with the 79xx series of negative voltage regulators in systems that provide both positive and negative regulated voltages, since the 78xx series can't regulate negative voltages in such a system. The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as it's small component count and medium-power regulated 5V make it useful for powering TTL devices.

19

Table 3.6. Specifications of IC7805 SPECIFICATIONS Vout Vein - Vout Difference Operation Ambient Temp Output Imax IC 7805 5V 5V - 20V 0 - 125C 1A

3.7 SEVEN SEGMENT DISPLAY:


A seven segment display is the most basic electronic display device that can display digits from 0-9. They find wide application in devices that display numeric information like digital clocks, radio, microwave ovens, electronic meters etc. The most common configuration has an array of eight LEDs arranged in a special pattern to display these digits. They are laid out as a squared-off figure 8. Every LED is assigned a name from 'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are used to display the numerals while eighth LED 'h' is used to display the dot/decimal. A seven segment is generally available in ten pin package. While eight pins correspond to the eight LEDs, the remaining two pins (at middle) are common and internally shorted. These segments come in two configurations, namely, Common cathode (CC) and Common anode (CA). In CC configuration, the negative terminals of all LEDs are connected to the common pins. The common is connected to ground and a particular LED glows when its corresponding pin is given high.

Description:
The 14.2 mm (0.56 inch) LED seven segment displays are designed for viewing distances up to 7 meters (23feet). These devices use an industry standard size package and pin out. Both the numeric and 1 overflow devices feature a right hand decimal point. All devices are available as either common anode or common cathode. These displays are ideal for most applications. Pin for pin equivalent displays are also available in a low current design. The low current displays are ideal for

20

portable applications. For additional information see the Low Current Seven Segment Displays data sheet.

Figure 3.11: Seven segment display

21

Chapter 4 SOFTWARE DEVELOPMENT


4.1 INTRODUCTION:
In this chapter the software used and the language in which the program code is defined was mentioned and the program code dumping tools are explained. The chapter also documents the development of the program for the application. This program has been termed as Source code. Before we look at the source code we define the two header files that we have used in the code.

4.2 C51 COMPILER & A51 MACRO ASSEMBLER:


Source files are created by the Vision IDE and are passed to the C51 Compiler or A51 Macro Assembler. The compiler and assembler process source files and create replaceable object files. The Keil C51 Compiler is a full ANSI implementation of the C programming language that supports all standard features of the C language. In addition, numerous features for direct support of the 8051 architecture have been added.

4.3 START VISION:


Vision is a standard Windows application and started by clicking on the program icon.

4.4 CREATE A PROJECT FILE:


To create a new project file select from the Vision menu Project New Project. This opens a standard Windows dialog that asks you for the new project file name. We suggest that you use a separate folder for each project. You can simply use the icon Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project 1. Vision creates a new project file with the name PROJECT 1.UV2 which contains a default target and project group.

22

Figure: 4.1 create a new project

4.4.1 Select a Device:


When you create a new project Vision asks you to select a CPU for your project. The Select Device dialog box shows the Vision device database. Just select the microcontroller you use. We are using for our examples the Philips 80C51RD+ controller. This selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool configuration. Once you have selected a CPU from the device database you can open the user manuals for that device in the Project Workspace Books page. These user manuals are part of the Keil Development Tools CD-ROM that should be present in your CD drive.

23

Figure: 4.2 select a device

4.4.2 Create New Source Files:


You may create a new source file with the menu option File New. This opens an empty editor window where you can enter your source code. Vision enables the C color syntax highlighting when you save your file with the dialog File Save As under a filename with the extension *.C. We are saving our example file under the name MAIN.C

24

Figure 4.3: create a new source file

4.4.3 Add And Configure The Startup Code:


The STARTUP.A51 file is the startup code for the most 8051 CPU variants. The startup code clears the data memory and initializes hardware and reentrant stack pointers. In addition, some 8051 derivatives require a CPU initialization code that needs to match the configuration of your hardware design. For example, the Philips 8051RD+ offers you on-chip xdata RAM that should be enabled in the startup code. Since you need to modify that file to match your target hardware, you should copy the STARTUP.A51 file from the folder C:\KEIL\C51\LIB to your project folder.

4.5 BENEFITS OF KEILTOOLS: 4.5.1Getting Started:


When starting a new project, simply select the microcontroller you use from the Device Database and the Vision IDE sets all compiler, assembler, linker, and memory options for you. Hence new users can learn the tools very easily.

4.5.2 Complex Problems can be solved:


The Vision IDE helps you create robust, sophisticated embedded applications.

25

4.5.3 Simple Codes:


The industry-standard Real view C/C++ Compiler creates the smallest, fastest application code and includes a complete ISO run-time library with C++ STL support.

4.5.4 Excellent Project Management:


The use of KEIL centres on "projects". A project is a list of all the source files required to build a single application, all the tool options which specify exactly how to build the application, and - if required-how the application should be simulated. A project contains enough information to take a set of source files and generate exactly the binary code required for the application. Because of the high degree of flexibility required from the tools, there are many options that can be set to configure the tools to operate in a specific manner. It would be tedious to have to set these options up every time the application is being built; therefore they are stored in a project file. Loading the project file into KEIL informs KEIL which source files are required, where they are, and how to configure the tools in the correct way. KEIL can then execute each tool with the correct options. It is also possible to create new projects in KEIL. Source files are added to the project and the tool options are set required. The project can then be saved to preserve the settings. The project also stores such things as which windows were left open in the simulator/debugger, so when a project is reloaded and the simulator /debugger started, all the desired windows are opened. KEIL project files have the extension.

4.5.5 Efficient Simulator:


The simulator/debugger in KEIL can perform a very detailed simulation of a micro controller along with external signals. It is possible to view the precise execution time of a single assembly instruction, or a single line of C code, all the way up to the entire application, simply by entering the crystal frequency. A window can be opened for each peripheral on the device, showing the state of the peripheral. This enables quick troubleshooting of mis-configured peripherals. Break points may be set on either assembly instructions or lines of C code, and execution may be stepped through one instruction or C line at a time. The contents of all memory areas may be viewed along with the ability to find specific variables. In addition the registers may be viewed allowing a detailed view of what the microcontroller is doing at any point in time.

26

4.6 FLASH MAGIC: 4.6.1 Features:


Straightforward and intuitive user interface Five simple steps to erasing and programming a device and setting any options desired Programs Intel Hex Files Automatic verifying after programming Fills unused flash to increase firmware security Ability to automatically program checksums. Using the supplied checksum calculation routine your firmware can easily verify the integrity of a Flash block, ensuring no unauthorized or corrupted code can ever be executed Program security bits Check which Flash blocks are blank or in use with the ability to easily erase all blocks in use Read the device signature Read any section of Flash and save as an Intel Hex File Reprogram the Boot Vector and Status Byte with the help of confirmation features that prevent accidentally programming incorrect values Displays the contents of Flash in ASCII and Hexadecimal formats Single-click access to the manual, Flash Magic home page and NXP Microcontrollers home page Ability to use high-speed serial communications on devices that support it. Flash Magic calculates the highest baud rate that both the device and your PC can use and switches to that baud rate transparently Command Line interface allowing Flash Magic to be used in IDEs and Batch Files Manual in PDF format Supports half-duplex communications Verify Hex Files previously programmed Save and open settings Able to reset Rx2 and 66x devices (revision G or higher) Able to control the DTR and RTS RS232 signals when connected to RST and /PSEN to place the device into Boot ROM and Execute modes automatically. An example circuit diagram is included in the Manual. This is essential for ISP with target hardware that is hard to access. 27

Able to play any Wave file when finished programming. Built in automated version checker - helps ensure you always have the latest version. Powerful, flexible Just in Time Code feature. Write your own JIT Modules to generate last minute code for programming. Uses include: 1. Serial number generation 2. Copy protection and copy authorization 3. Storing program date and time - manufacture date 4. Storing program operator and location 5. Lookup table generation 6. Language tables or language selection 7. Centralized record keeping Obtaining latest firmware from the Corporate Web site or project intranet

4.6.2 Requirements:
Flash Magic works on any versions of Windows, except Windows 95. 10Mb of disk space is required. As mentioned earlier, we are automating two different routines in our project and hence we used the method of polling to continuously monitor those tasks and act accordingly.

28

Chapter 5 RESULTS
This chapter shows the different snap shots of Electronic Voting Machine. The following figure shows the various components used to design Electronic voting Machine.

Figure 5.1: Working of Electronic Voting Machine The following figure shows the seven segments used in EVM and also displays the count corresponding to each candidate.

Figure 5.2: Working of Seven segment display

29

AT89C51 microcontroller was used in this project, various components used to design microcontroller board is shown in below diagram.

Figure 5.3: Microcontroller Board.

As per the objective of project, this EVM was designed for four candidaites and the procedure for polling to each candidate is depending on switches. The following snapshot shows the above procedure.

Figure 5.4: Working of Switches.

30

The following image shows the various components connected to display.

Figure 5.5: 5 Volts Regulated power supply.

The following snap shot shows the interfacing between switches and microcontroller.

Figure 5.6: Number voters can be voted using switches.

31

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.

32

CONCLUSION
The project Electronic Voting Machine has been successfully designed and tested. Integrating features of all the hardware components used have developed it. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.

33

BIBILOGRAPHY
The 8051 Microcontroller and Embedded System, MUHAMMAD ALI MAZIDI & JANICE GILLESPIE MAZIDI. Electronic Devices and circuits, JACOB MILLIMAN & CHRISTO C HALKIAS. Embedded Systems, RAJKAMAL www.atmel.com www.microcontroller.com www.wiley.com www.wikipedia.com

34

Você também pode gostar