You are on page 1of 93

Finger print based electronic voting machine

This project examines policy regarding the electronic approaches and developments towards electronic data storage and transmission. Finger print devices for Voting machines and other existing identity documents are discussed and implemented in this project. The user has to show his voter ID card whenever he goes to the polling booth to poll his vote. This is a time consuming process as the person has to check the voter ID card with the list he has, confirm it as an authorized card and then allow the person to poll his vote. Thus, to avoid this kind of problems, we have designed a finger print based voting machine where the person no need to carry his ID which contains his entire details. The person at the polling booth has to show his Finger. This Finger print reader reads the details from the tag. This data is passed to the controlling unit for the verification. The controller reads the data from the reader and compares this data with the already existing data. If the data matches with the already stored information, the person is allowed to poll his vote. If not, a message is displayed on LCD and the person is not allowed to poll his vote. The polling mechanism carries out manually using the switches. LCD is used to display the related messages. 1.1Objective of the project The project demands the user to submit his Finger print at the polling booth. The project uses the Finger print technology and Embedded Systems to design this application. The main objective of this project is to design a system that asks the user to show his Finger print as an identity proof. The
JNTUA CE , pulivendula Page 1

Finger print based electronic voting machine

system reads the data from the Finger print and verifies this data with the already stored data in its database. If the details present in the data base it matches with the stored data, the system allows the person to enter into and poll his vote. If the details of the Finger do not match with the stored data, the system immediately activates the display and the security authorities can come and take the further action. This project is a device that collects data from the tag and codes the data into a format that can be understood by the controlling section. This system also collects information from the master device and implements commands that are directed by the master. The objective of the project is to develop a microcontroller based security and alert system. It consists of a Finger print reader, microcontroller, the interfacing unit to allow the communication between the microcontroller and Finger print module, and the LCD. 1.2Background of the Project The software application and the hardware implementation help the microcontroller read the data from the Finger print verify the data with the already stored data and take the next action. The system is totally designed using Finger print module and embedded systems technology. The Controlling unit has an application program to allow the microcontroller interface with the Finger print module, the reader reads the data from the tag, passes the data to the microcontroller and the controller verifies this data with the already existing data in the controller’s memory and then implement the commands directed by the controller section. The performance of the design is maintained by controlling unit. 1.3Organization of the Thesis

JNTUA CE , pulivendula

Page 2

Finger print based electronic voting machine

In view of the proposed thesis work explanation of theoretical aspects and algorithms used in this work are presented as per the sequence described below. Chapter 1 describes a brief review of the objectives and goals of the work. Chapter 2 discusses the existing technologies and the study of various technologies in detail. Chapter 3 describes the Block diagram, Circuit diagram of the project and its description. The construction and description of various modules used for the application are described in detail. Chapter 4 description of Lpc2148 Chapter 5 description of Finger Print module Chapter 6 description of LCD switches Chapter 7 explains the Software tools required for the project, the Code developed for the design. Chapter 8 presents the results, overall conclusions of the study Chapter 9 proposes possible improvements and directions of future research work. Chapter 10 presents references.

Chapter 2
JNTUA CE , pulivendula Page 3

are examples of embedded systems. printer. the software in the embedded systems is always fixed listed below: Embedded systems do a very specific task. Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity. mobile phone etc. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. word processing. called real-time systems. Embedded systems have to work against some deadlines. DVD player. Appliances such as the air-conditioner. Embedded systems are constrained for power. fax machine. they cannot be programmed to do different things. accounting. Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded systems have very limited resources. JNTUA CE . The desktop/laptop computer is a general purpose computer. In contrast. VCD player. software development and soon. You can use it for a variety of applications such as playing games. pulivendula Page 4 .Finger print based electronic voting machine OVERVIEW OF THE TECHNOLOGIES USED Embedded Systems: An embedded system can be defined as a computing device that does a specific focused job. particularly the memory. As many embedded systems operate through a battery. Following are the advantages of Embedded Systems: 1. Generally. they do not have secondary storage devices such as the CDROM or the floppy disk. the power consumption has to be very low. In some embedded systems. The embedded software is also called “firm ware”. They are designed to do a specific task and have real time performance constraints which must be met. A specific job has to be completed within a specific time. the deadlines are stringent.

pulivendula Page 5 . They allow the system hardware to be simplified so costs are reduced. The program instructions for embedded systems run with limited computer hardware resources. Chapter 3 JNTUA CE . 4.Finger print based electronic voting machine 2. 3. They are usually in the form of small computerized parts in larger devices which serve a general purpose. little memory and small or even nonexistent keyboard or screen.

interrupts of Lpc 2148 microcontroller. The block diagram discusses about the has been used to write this compile code into the microcontroller. carrying out the PCB layout of the schematic tested on breadboard. It explains the features. the Keil µv3 software development tool to write and compile the source code.1 Project Design The implementation of the project design can be divided in two parts. − Hardware implementation − Firmware implementation Hardware implementation deals in drawing the schematic on the plane paper according to the application. we have used the Orcad design software for PCB circuit design. which has been written in the C language. In the present work. The firmware implementation is explained in the next JNTUA CE . testing the schematic design over the breadboard using the various IC’s to find if the design meets the objective. The project design and principle are explained in this chapter using the block diagram and circuit diagram. serial communication. pulivendula Page 6 . The Flash maic programmer chapter. The firmware part deals in programming the microcontroller so that it can control the operation of the IC’s used in the implementation. 3. timer programming. It discusses the design and working of the design with the help of block diagram and circuit diagram and explanation of circuit diagram in detail. finally preparing the board and testing the designed hardware. It also explains the various modules used in this project.Finger print based electronic voting machine Hardware Implementation of the Project This chapter briefly explains about the Hardware Implementation of the project.

2 Block Diagram of the Project and its Description The block diagram of the project is as shown in the figure 3.1 : block diagram Brief explanation of functioning of each block of the system is given below the detailed is given in next chapters 3.1 Power Supply Finger Print Module 16 X 2 LCD MAX 232 EEPROM ARM 7TDMI LPC2148 Switches Crystal Oscillato r Fig 3. pulivendula Page 7 .e.2 Power Supply: The input to the circuit is applied from the regulated power supply. input i. The a.c.Finger print based electronic voting machine required components of the design and working condition is explained using circuit diagram and system wiring diagram. 3.. 230V from the mains supply is step down by the transformer JNTUA CE .

Finger print based electronic voting machine

to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage. The block diagram of regulated power supply is shown in the figure 3.2

Fig 3.2 components of power supply Transformer: Usually, DC voltages are required to operate various electronic equipment and these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input available at the mains supply i.e., 230V is to be brought down to the required voltage level. This is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a required level. Rectifier: The output from the transformer is fed to the rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full wave rectification. Filter:
JNTUA CE , pulivendula Page 8

Finger print based electronic voting machine

Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens the D.C. Output received from this filter is constant until the mains voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage received at this point changes. Therefore a regulator is applied at the output stage. Voltage regulator: As the name itself implies, it regulates the input applied to it. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. In this project, power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78 represents positive supply and the numbers 05, 12 represent the required output voltage levels

LPC2148 arm processor is used for controlling. ARM processor is used because of its extra features when compared to microcontroller. It controls LCD and finger print module. It receives input commands from switches and control finger print module when to receive the data, performs comparison , gives command to LCD to display messages to direct the users to use it properly and also displays the results.

Finger Print Module :
Finger print module is an input device used for Fingerprint processing which includes two parts: fingerprint enrollment and fingerprint matching (the matching can be 1:1 or 1:N). When enrolling, user needs to enter the finger two times. The system will process the two time finger images, generate a template of the finger based on processing results and store the template. When matching, user enters the finger through optical sensor and system will generate a template of the finger and compare it with templates
JNTUA CE , pulivendula Page 9

Finger print based electronic voting machine

of the finger library. For 1:1 matching, system will compare the live finger with specific template designated in the Module; for 1:N matching, or searching, system will search the whole finger library for the matching finger. In both circumstances, system will return the matching result, success or failure.

LCD display and Switches:
Switches here function as inputs that gives command to the controller what to do and LCD display as output that directs the users how to use the module and also to display the final results. The firmware programmed in LPC2148 is designed to communicate with Finger print and operates according the commands received from the Switches. Therefore, after Receiving the Data from Finger print and processing and validating, It takes the data from switches and comparing with the data base and updating the data base and display the command and display the result with respect to the switch operations. The switches are used to activate the controller for registration during enrollment, for comparisons to the database while identifying the user, for selecting the party while casting the vote, finally for display of results. LCD screen functions as interface between the user and microcontroller, which displays messages that facilitates the user to know when to register and when to vote, and also whether their vote is valid are not. It displays “welcome” messages initially and “enrolling” message during enrollment, “identifying” message when controller is comparing the data base whether the user is valid are not, if valid displays “please vote” message, if not displays “no access” message, and finally displays the result with party name with their respective number of votes.

JNTUA CE , pulivendula

Page 10

Finger print based electronic voting machine 3. pulivendula Page 11 .3 below JNTUA CE .System wiring diagram and working procedure: Wiring diagram of the project is as shown in the figure 3.3.

pulivendula Page 12 . JNTUA CE .3: wiring diagram Working procedure: Voting machine using Finger print is basically an embedded system that makes the things easy in the polling booths during the time of elections.Finger print based electronic voting machine Fig 3.

The user. After all enrollments the system is ready for vote cast.Identification and vote casting mode 3. When the user is asked to show his Finger print. Enrolling Mode If enrolling mode command is given. The Finger print module reads the data present.Finger print based electronic voting machine The project Finger print technology and Embedded systems to implement the application. This unique code is stored in the EEPROM memory of the controller for the future reference. The candidate’s finger print is scanned and generates a unique characters code. After getting “READY SIGNAL”.Enrolling mode 2. location of place. who wants to poll his vote. “GENRATING CHARACTER CODE…” is displayed on LCD. mobile number for contact etc. the user no need Voter card. ballot unit displays its “welcome to EVM” message on LCD indicating that the machine is ready and waits for user input. the sufficient material. The working of our EVM an be explained in three modes 1. In this project. JNTUA CE . The mode of operation depends on command to carry with him is the given by the user from the switches. pulivendula Page 13 . the necessary and. the ballot unit awaits a “READY SIGNAL” from controller. upto an extent. the controller waits for input and activates the scanner to accept the finger print. Results When the power of Ballot unit is turned on. has to submit the identity proof at the counter at the polling booth. Voter card is nothing but an Finger Print which stores the details of the person like the name of the user. displaying “Enrolling…”on the LCD display . During the character code generation.

During this mode the fingerprint of the candidate casting the vote is compared with the finger prints already enrolled in the memory. RESULTS MODE The contestant name and the secured votes will be displayed on the LCD when the controller receives results instruction through the switches. Chapter 4 Microcontroller 4.Finger print based electronic voting machine Identification and vote casting mode Before casting the vote the candidate has to check for validity . pulivendula Page 14 .. Once the voter presses the button corresponding to the candidate of her/his after user pressing the identify button the controller displays “identifying . a four-bit code is generated and sent to the control unit. The machine returns to the identifying mode and starts all over again for next voting..Definition of a Microcontroller Microcontroller.“ message. They are like single chip computers that are often embedded into other systems to JNTUA CE . are small controllers. Once the casting is over message is displayed to whom they voted for. as the name suggests.1.”No ACCESS.” message will be displayed if the same user tries to cast again. If it is matched a message “PLEASE VOTE……” will be displayed on LCD.

etc. a simulator. Flexibility  Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use..  Field Programmability.  JNTUA CE .Finger print based electronic voting machine function as processing/controlling unit. The development package of microcontrollers often includes an assembler. the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. Some packages include a high level language compiler such as a C compiler and more sophisticated libraries. pulivendula Page 15 . the instruction set is small. where automation is needed. toys . Most microcontrollers will also combine other devices such as:  A Timer module to allow the microcontroller to perform tasks for certain time periods. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems.  Easy to Use Assembly language is often used in microcontrollers and since they usually follow RISC architecture. They are also used in automobiles. microwave ovens. a programmer to "burn" the chip and a demonstration board. For example. A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller. washing machines. The key features of microcontrollers include:  High Integration of Functionality  Microcontrollers sometimes are called single-chip computers because they have on-chip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry..

other components such as memory. Thus. In order for a microprocessor to be used.1 above Shows a typical microcontroller device and its different subunits 4.1 a typical microcontroller device and its different subunits The heart of the microcontroller is the CPU core. microcontroller is designed to be all of that in one. In short that means that microprocessor is the very heart of the computer.2. Figure 4. In the past this has traditionally been based on an 8-bit microprocessor unit. On the other hand. First and the most important is its functionality. Figure 4. No other external components are needed for its application because all necessary peripherals are already built into it. we save the time and space needed to construct devices. pulivendula Page 16 .Finger print based electronic voting machine  An ADC to allow the microcontroller to accept analogue input data for processing. or components for receiving and sending data must be added to it. JNTUA CE .Microcontrollers versus Microprocessors Microcontroller differs from a microprocessor in many ways.

the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty. Serial communications interfaces ranging from a USB 2. PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt pins make these microcontrollers suitable for industrial control and medical systems 4.  8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory. Various 32-bit timers. that combine microcontroller with embedded high speed flash memory ranging from 32 kB to 512 kB.3 LPC214x The LPC2141/42/44/46/48 microcontrollers are based on a 16-bit/32-bit ARM7TDMI-S CPU with real-time emulation and embedded trace support. providing both large buffer size and high processing power. single or dual 10-bit ADC(s). multiple UARTs. JNTUA CE . pulivendula Page 17 . voice recognition and low end imaging. soft modems. SPI. Due to their tiny size and low power consumption. For critical code size applications. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. LPC2141/42/44/46/48 are ideal for applications where miniaturization is a key requirement.Finger print based electronic voting machine 4.  128-bit wide interface/accelerator enables high-speed 60 MHz operation.1Key features  16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package. such as access control and point-of-sale.3.0 Full-speed device. 10-bit DAC. make these devices very well suited for communication gateways and protocol converters. SSP to I2C-bus and on-chip SRAM of 8 kB up to 40 kB.

 Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.  On-chip integrated oscillator operates with an external crystal from 1 MHz to 25 MHz  Power saving modes include Idle and Power-down. Single flash sector or full chip erase in 400 ms and programming of 256 bytes in 1 ms.  Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses. In addition. pulivendula Page 18 . two Fast I2C-bus (400 Kbit/s).SPI and SSP with buffering and variable data length capabilities.0 Full-speed compliant device controller with 2 KB of endpoint RAM.Finger print based electronic voting machine  In-System Programming/In-Application Programming (ISP/IAP) via on- chip boot loader software. LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog inputs.44 μs per channel. PWM unit (six outputs) and watchdog.  Up to 21 external interrupt pins available. with conversion times as low as 2. the LPC2146/48 provides 8 kB of on-chip RAM accessible to USB by DMA.  One or two (LPC2141/42 vs. JNTUA CE .  Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real Monitor software and high-speed tracing of instruction execution.  USB 2.  Single 10-bit DAC provides variable analog output (LPC2142/44/46/48 only).  Two 32-bit timers/external event counters (with four capture and four compare channels each).  Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input Multiple serial interfaces including two UARTs (16C550).  60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100 μs.

JNTUA CE .Finger print based electronic voting machine  Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power optimization.  Single power supply chip with POR and BOD circuits: CPU operating voltage range of 3. pulivendula Page 19 .  Processor wake-up from Power-down mode via external interrupt or BOD.0 V to 3.3 V ± 10 %) with 5 V tolerant I/O pads.6 V (3.

2 below Fig : 4. 4) LPC21422/44/46/48 only JNTUA CE .Finger print based electronic voting machine The block diagram of LPC2148 is shown in figure 4.2Block diagram 1) Pins shared with GPIO 2) LPC2144/46/48 only 3) USB DMA controller with 8KBof Ram accessible as general purpose RAmand/or DMA available in LPC2146/48 only. pulivendula Page 20 .

3 Fig 4.Finger print based electronic voting machine The pin description of the controller is shown in the figure 4. pulivendula Page 21 .2: pin diagram JNTUA CE .

2 below JNTUA CE .Finger print based electronic voting machine pin description is given in the following table4. pulivendula Page 22 .

Finger print based electronic voting machine JNTUA CE . pulivendula Page 23 .

2.Finger print based electronic voting machine Table 4. which offers high performance and very low power consumption. This simplicity results in a high instruction throughput and impressive realJNTUA CE . The ARM architecture is based on Reduced Instruction Set Computer (RISC) principles. and the instruction set and related decode mechanism are much simpler than those of micro programmed Complex Instruction Set Computers (CISC).3.2 pin description 4. Functional description Architectural overview The ARM7TDMI-S is a general purpose 32-bit microprocessor. pulivendula Page 24 .

This memory may be used for both code and data storage.The particular flash implementation in the LPC2141/42/44/46/48 allows for full speed execution also in ARM mode. The ARM7TDMI-S processor also employs a unique architectural strategy known as Thumb.Finger print based electronic voting machine time interrupt response from a small and cost-effective processor core. Essentially. The impact on the overall code size will be minimal but the speed can be increased by 30% over Thumb mode. and a third instruction is being fetched from memory. Programming of the flash memory may be accomplished in several ways. The application program may also erase and/or program the flash while the application is running. Thumb code is able to provide up to 65 % of the code size of ARM. and 160 % of the performance of an equivalent ARM processor connected to a 16-bit memory system. On-chip flash program memory The LPC2148 incorporate a 512 kB flash memory system respectively. the ARM7TDMI-S processor has two instruction sets: • The standard 32-bit ARM set. while one instruction is being executed. • A 16-bit Thumb set. or applications where code density is an issue. It may be programmed In System via the serial port. This is possible because Thumb code operates on the same 32-bit register set as ARM code.The key idea behind Thumb is that of a superreduced instruction set. pulivendula Page 25 . allowing a JNTUA CE . its successor is being decoded. Pipeline techniques are employed so that all parts of the processing and memory systems can operate continuously. Typically. which makes it ideally suited to high-volume applications with memory restrictions. It is recommended to program performance critical and short code sections (such as interrupt service routines and DSP algorithms) in ARM mode. The Thumb set’s 16-bit instruction length allows it to approach twice the density of standard ARM code while retaining most of the ARM’s performance advantage over a traditional 16-bit processor using 16-bit registers.

128 kB. 16-bit. In case of LPC2146/48 only. and 32-bit. an 8 kB SRAM block intended to be utilized mainly by the USB can also be used as a general purpose RAM for data storage and code storage and execution.1 JNTUA CE .000 erase/write cycles and 20 years of dataretention. 64 kB. flash memory available for user’s code on LPC2141/42/44/46/48 is 32 kB. LPC2142/44 and LPC2146/48 provide 8 kB. 16 kB and 32 kB of static RAM respectively. Due to the architectural solution chosen for an on-chip boot loader. The LPC2141/42/44/46/48 flash memory provides a minimum of 100. On-chip static RAM On-chip static RAM may be used for code and/or data storage.Finger print based electronic voting machine great degree of flexibility for data storage field firmware upgrades. etc. The SRAM may be accessed as 8-bit. pulivendula Page 26 . as shown in Figure In addition. 256 kB and 500 kB respectively. The LPC2141. Memory map The LPC2141/42/44/46/48 memory map incorporates several distinct regions. Memory mapping table is shown in the table 4. the CPU interrupt vectors may be remapped to allow them to reside in either flash memory (the default) or onchip static RAM.

pulivendula Page 27 . The fastest possible FIQ latency is achieved when only one request is classified as FIQ. Fast interrupt request (FIQ) has the highest priority. If more than one request is assigned to FIQ. vectored Interrupt Request (IRQ). and non-vectored IRQ as defined by programmable settings.2: memory map table Interrupt controller The Vectored Interrupt Controller (VIC) accepts all of the interrupt request inputs and categorizes them as Fast Interrupt Request (FIQ).Finger print based electronic voting machine Table 4. the VIC combines the requests to produce the FIQ signal to the ARM processor. because then the FIQ service routine does not need to branch into the interrupt service routine but JNTUA CE . The programmable assignment scheme means that priorities of interrupts from the various peripherals can be dynamically assigned and adjusted.

among which slot 0 has the highest priority and slot 15 has the lowest. Individual interrupt flags may also represent more than one interrupt source. If any of the vectored IRQs are pending. but may have several internal interrupt flags. as well as the current state of the port pins. Interrupt sources Each peripheral device has one interrupt line connected to the Vectored Interrupt Controller.Finger print based electronic voting machine can run from the interrupt vector location. JNTUA CE . The IRQ service routine can start by reading a register from the VIC and jumping there. Any of the interrupt requests can be assigned to any of the 16 vectored IRQ slots. Separate registers allow setting or clearing any number of outputs simultaneously. otherwise it provides the address of a default routine that is shared by all the non-vectored IRQs. The VIC combines the requests from all the vectored and nonvectored IRQs to produce the IRQ signal to the ARM processor. Non-vectored IRQs have the lowest priority. The value of the output register may be read back. LPC2141/42/44/46/48 introduce accelerated GPIO functions over prior LPC2000 devices: • GPIO registers are relocated to the ARM local bus for the fastest possible I/O timing. pulivendula Page 28 . Sixteen of the interrupt requests can be assigned to this category. Fast general purpose parallel I/O (GPIO) Device pins that are not connected to a specific peripheral function are controlled by the GPIO registers. the FIQ service routine will read a word from the VIC that identifies which FIQ source(s) is (are) requesting an interrupt. The default routine can read another VIC register to see what IRQs are active. the VIC provides the address of the highest-priority requesting IRQs service routine. Vectored IRQs have the middle priority. Pins may be dynamically configured as inputs or outputs. If more than one request is assigned to the FIQ class.

Finger print based electronic voting machine • Mask registers allow treating sets of port bits as a group. • Separate control of output set and clear. • Burst conversion mode for single or multiple inputs. • All I/O default to inputs after reset. 10-bit ADC The LPC2141/42 contain one and the LPC2144/46/48 contain two analog to digital converters. • Direction control of individual bits. • Entire port value can be written in one instruction. Features • Measurement range of 0 V to VREF (2. These converters are single 10-bit successive approximation analog to digital converters. pulivendula Page 29 . • Every analog input has a dedicated result register to reduce interrupt overhead. ADC1 has eight channels. • Each converter capable of performing more than 400.0 V ≤ VREF ≤ VDDA). total number of available ADC inputs for LPC2141/42 is 6 and for LPC2144/46/48 is 14. • All GPIO registers are byte addressable. Therefore. Features • Bit-level set and clear registers allow a single instruction set or clear of any number of bits in one port. While ADC0 has six channels.000 10-bit samples per second. leaving other bits unchanged. 10-bit DAC JNTUA CE .

serial interface engine. bulk. • Scalable realization of endpoints at run time. endpoint buffer memory and DMA controller. The maximum DAC output voltage is the VREF voltage. Features • Fully compliant with USB 2. JNTUA CE . • Buffered output. • Selectable speed versus power. pulivendula Page 30 . An interrupt is also generated if enabled. The serial interface engine decodes the USB data stream and writes data to the appropriate end point buffer memory. The LPC2141/42/44/46/48 is equipped with a USB device controller that enables 12 Mbit/s data exchange with a USB host controller. All transactions are initiated by the host controller. USB 2.0 Full-speed specification. • Supports control.0 device controller The USB is a 4-wire serial bus that supports communication between a host and a number (127 max) of peripherals. A DMA controller (available in LPC2146/48 only) can transfer data between an endpoint buffer and the USB RAM. Features • 10-bit DAC. The host controller allocates the USB bandwidth to attached devices through a token based protocol. • Power-down mode available. • Supports 32 physical (16 logical) endpoints. The status of a completed USB transfer or error condition is indicated via status registers. and dynamic configuration of the devices. It consists of a register interface.Finger print based electronic voting machine The DAC enables the LPC2141/42/44/46/48 to generate a variable analog output. interrupt and isochronous endpoints. unplugging. The bus supports hot plugging.

for inter-IC control using only two wires: a serial clock line (SCL).Finger print based electronic voting machine • Endpoint maximum packet size selection (up to USB maximum specification) by software at run time. slave. JNTUA CE . Transmitters and/or receivers can operate in either master or slave mode. • Bidirectional data transfer between masters and slaves. • Allows dynamic switching between CPU controlled and DMA modes (only in LPC2146/48). or master/slave. • Double buffer implementation for bulk and isochronous endpoints. • Easy to configure as master. and a serial data line (SDA). Each device is recognized by a unique address and can operate as either a receiver-only device (e.g. pulivendula Page 31 . The I2C-bus implemented in LPC2141/42/44/46/48 supports bit rates up to 400 kbit/s (Fast I2C-bus). The I2C-bus is bidirectional. • RAM message buffer size based on endpoint realization and maximum packet size. • One duplex DMA channel serves all endpoints (LPC2146/48 only). Features • Compliant with standard I2C-bus interface. depending on whether the chip has to initiate a data transfer or is only addressed. • Supports SoftConnect and GoodLink LED indicator. I2C-bus serial I/O controller The LPC2141/42/44/46/48 each contain two I2C-bus controllers. • Supports bus-powered capability with low suspend current.. • Supports DMA transfer on all non-control endpoints (LPC2146/48 only). it can be controlled by more than one bus master connected to it. an LCD driver or a transmitter with the capability to both receive and send information (such as memory)). • Programmable clocks allow versatile rate control. The I2C-bus is a multi-master bus. These two functions are sharing one pin.

• Combined SPI master and slave. It can interact with multiple masters and slaves on the bus. • The I2C-bus can be used for test and diagnostic purposes. During a data transfer the master always sends a byte of data to the slave. pulivendula Page 32 . SPI serial I/O controller The LPC2141/42/44/46/48 each contain one SPI controller. The SPI is a full duplex serial interface. Only a single master and a single slave can communicate on the interface during a given data transfer. Features • Compliant with Serial Peripheral Interface (SPI) specification. • Synchronous. Full Duplex.Finger print based electronic voting machine • Multi-master bus (no central master). • Serial clock synchronization can be used as a handshake mechanism to suspend and resume serial transfer. Communication. designed to handle multiple masters and slaves connected to a given bus. SSP serial I/O controller The LPC2141/42/44/46/48 each contain one SSP. only a single master and a single slave can communicate on the bus during a given data transfer. and the slave always sends a byte of data to the master. The SSP controller is capable of operation on a SPI. • Arbitration between simultaneously transmitting masters without corruption of serial data on the bus. • Maximum data bit rate of one eighth of the input clock rate. with data frames of 4 bits to 16 bits of data flowing from the master to the slave and from the slave to the master. JNTUA CE . or Microwire bus. Serial. However. • Serial clock synchronization allows devices with different bit rates to communicate via one serial bus. 4-wire SSI. The SSP supports full duplex transfers. Often only one of these data flows carries meaningful data.

– Stop timer on match with optional interrupt generation. It also includes four capture inputs to trap the timer value when an input signal transitions. or used as external interrupts. optionally generating an interrupt. A capture event may also optionally generate an interrupt. as well as ‘broadcast’ functions among them. JNTUA CE . TI’s 4-wire SSI and National Semiconductor’s Microwire buses. • 8-frame FIFOs for both transmit and receive. Multiple pins can be selected to perform a single capture or match function. The LPC2141/42/44/46/48 can count external events on one of the capture inputs if the minimum external pulse is equal or longer than a period of the PCLK. General purpose timers/external event counters The Timer/Counter is designed to count cycles of the peripheral clock (PCLK) or an externally supplied clock and optionally generate interrupts or perform other actions at specified timer values. • Four 32-bit capture channels per timer/counter that can take a snapshot of the timer value when an input signal transitions. unused capture lines can be selected as regular timer capture inputs. Features • A 32-bit timer/counter with a programmable 32-bit prescaler. • Four bits to 16 bits per frame. providing an application with ‘or’ and ‘and’. • Master or slave operation. • Four 32-bit match registers that allow: – Continuous operation with optional interrupt generation on match. • Synchronous serial communication. pulivendula Page 33 . based on four match registers. • External event counter or timer operation.Finger print based electronic voting machine Features • Compatible with Motorola’s SPI. In this configuration.

– Do nothing on match. the watchdog will generate a system reset if the user program fails to ‘feed’ (or reload) the watchdog within a predetermined amount of time. Features • Internally resets chip if not periodically reloaded. making it suitable for battery powered systems where the CPU is not running continuously (Idle mode). • Incorrect/Incomplete feed sequence causes reset/interrupt if enabled. • Debug mode. • Flag to indicate watchdog reset. The RTC has been designed to use little power. When enabled. • Four external outputs per timer/counter corresponding to match registers. – Set HIGH on match. Features • Measures the passage of time to maintain a calendar and clock. • Selectable time period from (TPCLK × 256 × 4) to (TPCLK × 232 × 4) in multiples of TPCLK × 4. with the following capabilities: – Set LOW on match. • Enabled by software but requires a hardware reset or a watchdog reset/interrupt to be disabled. Real-time clock The RTC is designed to provide a set of counters to measure time when normal or idle operating mode is selected. • Programmable 32-bit timer with internal pre-scaler. – Toggle on match. Watchdog timer: The purpose of the watchdog is to reset the microcontroller within a reasonable amount of time if it enters an erroneous state. JNTUA CE .Finger print based electronic voting machine Reset timer on match with optional interrupt generation. pulivendula Page 34 .

Year. based on seven match registers.3 V. Pulse width modulator The PWM is based on the standard timer block and inherits all of its features. Minutes. Month. The PWM function is also based on match register events. • Dedicated power supply pin can be connected to a battery or the main 3. and Day of Year. Hours. although only the PWM function is pinned out on the LPC2141/42/44/46/48. Programmable reference clock divider allows fine adjustment of the RTC. The ability to separately control rising and falling edge locations allows the PWM to be used for more applications. Day of Week. The oscillator output frequency is called fosc and the ARM processor clock frequency is referred to as CCLK for purposes of rate JNTUA CE . System control Crystal oscillator On-chip integrated oscillator operates with external crystal in range of 1 MHz to 25 MHz. • Can use either the RTC dedicated 32 kHz oscillator input or clock derived from the external crystal/oscillator input at XTAL1.Finger print based electronic voting machine • Ultra-low power design to support battery powered systems. The timer is designed to count cycles of the peripheral clock (PCLK) and optionally generate interrupts or perform other actions when specified timer values occur. pulivendula Page 35 . • Provides Seconds. Day of Month.

wait for the PLL to Lock. then connect to the PLL as a clock source. the multiplier value cannot be higher than 6 on this family of microcontrollers due to the upper frequency limit of the CPU). and the on-chip flash controller has completed its initialization. 4. causing the internal chip reset to remain asserted until the external reset is de-asserted. all of the processor and peripheral registers have been initialized to predetermined values. or 16 to produce the output clock. it is insured that the PLL output has a 50 % duty cycle. PLL The PLL accepts an input clock frequency in the range of 10 MHz to 25 MHz. the processor begins executing at address 0. This is JNTUA CE . The multiplier can be an integer value from 1 to 32 (in practice. Reset and wake-up timer Reset has two sources on the LPC2141/42/44/46/48: the RESET pin and watchdog reset.Finger print based electronic voting machine equations. Since the minimum output divider value is 2. The program must configure and activate the PLL. The RESET pin is a Schmitt trigger input pin with an additional glitch filter. The output divider may be set to divide by 2. Assertion of chip reset by any source starts the Wakeup Timer (see Wake-up Timer description below). The input frequency is multiplied up into the range of 10 MHz to 60 MHz with a Current Controlled Oscillator (CCO). 8. the oscillator is running. pulivendula Page 36 . etc. which is the reset vector. The PLL is turned off and bypassed following a chip reset and may be enabled by software. The Wake-up Timer ensures that the oscillator and other analog functions required for chip operation are fully functional before the processor is allowed to execute instructions. so there is an additional divider in the loop to keep the CCO within its frequency range while the PLL is providing the desired output frequency. At that point. The CCO operates in the range of 156 MHz to 320 MHz. a fixed number of clocks have passed. When the internal reset is removed. fosc and CCLK are the same value unless the PLL is running and connected. The PLL settling time is 100 μs.

as well as any other external circuitry (e. The amount of time depends on many factors. the type of crystal and its electrical characteristics (if a quartz crystal is used). This signal can be enabled for interrupt. Since the oscillator and other functions are turned off during Power-down mode. In normal operation. If this voltage falls below 2.9 V detection to reliably interrupt. the BOD asserts an interrupt signal to the VIC.Finger print based electronic voting machine important at power on. This reset prevents alteration of the flash as operation of the various elements of the chip would otherwise become unreliable due to low voltage.g. or some event caused the chip to exit Power-down mode. any wake-up of the processor from Power-down mode makes use of the Wake-up Timer. Brownout detector The LPC2141/42/44/46/48 include 2-stage monitoring of the voltage on the VDD pins.6 V thresholds include some hysteresis.9 V. if not. The Wake-up Timer monitors the crystal oscillator as the means of checking whether it is safe to begin code execution.9 V and 2. The second stage of low voltage detection asserts reset to inactivate the LPC2141/42/44/46/48 when the voltage on the VDD pins falls below 2. at which point the POR circuitry maintains the overall reset. including the rate of VDD ramp (in the case of power on). The BOD circuit maintains this reset down below 1 V. this hysteresis allows the 2. If after reset onchip boot loader detects a valid checksum in flash and reads 0x8765 4321 JNTUA CE . or a regularly-executed event loop to sense the condition. software can monitor the signal by reading dedicated register.6 V. Both the 2. and the characteristics of the oscillator itself under the existing ambient conditions. capacitors). When power is applied to the chip. Code security This feature of the LPC2141/42/44/46/48 allow an application to control whether it can be debugged or protected from observation. some time is required for the oscillator to produce a signal of sufficient amplitude to drive the clock logic. pulivendula Page 37 . all types of reset. and whenever any of the aforementioned functions are turned off for any reason.

Vectors may be mapped to the bottom of the on-chip flash memory. When the pins are combined. Idle mode eliminates power used by the processor itself. execution of instructions is suspended until either a reset or interrupt occurs. Once debugging is disabled.Finger print based electronic voting machine from address 0x1FC in flash. Memory mapping control The Memory Mapping Control alters the mapping of the interrupt vectors that appear beginning at address 0x0000 0000. Since all dynamic JNTUA CE . and internal SRAM values are preserved throughout Power-down mode and the logic levels of chip output pins remain static. it can be enabled only by performing a full chip erase using the ISP. or to the on-chip static RAM. and internal buses. Peripheral functions continue operation during Idle mode and may generate interrupts to cause the processor to resume execution. This allows code running in different memory spaces to have control of the interrupts Power control The LPC2141/42/44/46/48 supports two reduced power modes: Idle mode and Power-down mode. the oscillator is shut down and the chip receives no internal clocks. external events can be processed as four independent interrupt signals. The processor state and registers. Additionally capture input pins can also be used as external interrupts without the option to wake the device up from Power-down mode. peripheral registers. pulivendula Page 38 . The Power-down mode can be terminated and normal operation resumed by either a reset or certain specific interrupts that are able to function without clocks. In Power-down mode. The External Interrupt Inputs can optionally be used to wake-up the processor from Power-down mode. debugging will be disabled and thus the code in flash will be protected from observation. memory systems and related controllers. In Idle mode. External interrupt inputs The LPC2141/42/44/46/48 include up to nine edge or level sensitive External Interrupt Inputs as selectable pin functions.

Power-down mode reduces chip power consumption to nearly zero. the VPB bus may be slowed down to 1⁄2 to 1⁄4 of the processor clock rate. Because the VPB bus must work properly at power-up (and its timing cannot be altered if it does not work since the VPB divider control registers reside on the VPB bus). The debugging of the target system requires a host computer running the debugger software and an EmbeddedICE protocol convertor. Debugging and trace functions are multiplexed only with GPIOs on Port 1. the default condition at reset is for the VPB bus to run at 1⁄4 of the processor clock rate. EmbeddedICE Standard ARM EmbeddedICE logic provides on-chip debug support. The first is to provide peripherals with the desired PCLK via VPB bus so that they can operate at the speed chosen for the ARM processor. The VPB divider serves two purposes. Emulation and debugging The LPC2141/42/44/46/48 support emulation and debugging via a JTAG serial port. In order to achieve this. EmbeddedICE JNTUA CE . This means that all communication.Finger print based electronic voting machine operation of the chip is suspended. Because the VPB divider is connected to the PLL output. pulivendula Page 39 . the PLL remains active (if it was running) during Idle mode. A trace port allows tracing program execution. timer and interface peripherals residing on Port 0 are available during the development and debugging phase as they are when the application is run in the embedded system itself. The second purpose of the VPB divider is to allow power savings when an application does not require any peripherals to run at the full processor rate. VPB bus The VPB divider determines the relationship between the processor clock (CCLK) and the clock used by peripheral devices (PCLK).

the LPC2144/46/48 UART1 also provide a full modem control handshake interface. The DCC is accessed as a coprocessor 14 by the program running on the ARM7TDMI-S core. In addition to standard transmit and receive data lines. pulivendula Page 40 . It is a lightweight debug monitor that runs in the background while users debug their foreground application. The DCC data and control registers are mapped in to addresses in the EmbeddedICE logic. Compared to previous LPC2000 microcontrollers. The DCC allows a program running on the target to communicate with the host debugger or another separate host without stopping the program flow or even entering the debug state. which enables real-time debug.Finger print based electronic voting machine protocol convertor converts the remote debug protocol commands to the JTAG data needed to access the ARM core.. The DCC allows the JTAG port to be used for sending and receiving data without affecting the normal program flow. The LPC2141/42/44/46/48 contains a specific configuration of Real Monitor software programmed into the on-chip flash UARTs The LPC2141/42/44/46/48 each contain two UARTs. The ARM core has a Debug Communication Channel (DCC) function built-in. which is present in the Embedded memory. Real Monitor Real Monitor is a configurable software module. ICE logic. It communicates with the host using the DCC. UARTs in LPC2141/42/44/46/48 introduce a fractional baud rate generator for both UARTs. enabling these microcontrollers to achieve standard baud rates such as 115200 with any JNTUA CE . developed by ARM Inc.

Finger print based electronic voting machine

crystal frequency above 2 MHz In addition, auto-CTS/RTS flow-control functions are fully implemented in hardware (UART1 in LPC2144/46/48 only).

• 16 byte Receive and Transmit FIFOs. • Register locations conform to ‘550 industry standard. • Receiver FIFO trigger points at 1, 4, 8, and 14 bytes • Built-in fractional baud rate generator covering wide range of baud rates without a need for external crystals of particular values. • Transmission FIFO control enables implementation of software (XON/XOFF) flow control on both UARTs. • LPC2144/46/48 UART1 equipped with standard modem interface signals. This module also provides full support for hardware flow control (auto-CTS/RTS). Universal Asynchronous Receiver/Transmitter 0 (UART0) Features • 16 byte Receive and Transmit FIFOs • Register locations conform to ‘550 industry standard. • Receiver FIFO trigger points at 1, 4, 8, and 14 bytes. • Built-in fractional baud rate generator with autobauding capabilities. • Mechanism that enables software and hardware flow control implementation.

Table 4.3 gives UART Pin description in controller

Table 4.3 pin description of UART in controller Register description

JNTUA CE , pulivendula

Page 41

Finger print based electronic voting machine

UART0 contains registers organized as shown in Table 4.4. The Divisor Latch Access Bit (DLAB) is contained in U0LCR[7] and enables access to the Divisor Latches.

table 4.3: register organization of UART0 UART0 Receiver Buffer Register (U0RBR - 0xE000 C000, when DLAB = 0, Read Only) The U0RBR is the top byte of the UART0 Rx FIFO. The top byte of the Rx FIFO contains the oldest character received and can be read via the bus interface. The LSB (bit 0) represents the “oldest” received data bit. If the character received is less than 8 bits, the unused MSBs are padded with zeroes. The Divisor Latch Access Bit (DLAB) in U0LCR must be zero in order to access the U0RBR. The U0RBR is always Read Only. Since PE, FE and BI bits correspond to the byte sitting on the top of the RBR FIFO (i.e. the one that will be read in the next read from the RBR), the right approach for fetching the valid pair of received byte and its status bits is first to read the content of the U0LSR register, and then to read a byte from the U0RBR. UART0 Receiver Buffer Register (U0RBR - address 0xE000 C000, when DLAB = 0, Read Only) bit description
JNTUA CE , pulivendula Page 42

Finger print based electronic voting machine

UART0 Transmit Holding Register (U0THR - 0xE000 C000, when DLAB = 0, Write Only) The U0THR is the top byte of the UART0 TX FIFO. The top byte is the newest character in the TX FIFO and can be written via the bus interface. The LSB represents the first bit to transmit. The Divisor Latch Access Bit (DLAB) in U0LCR must be zero in order to access the U0THR. The U0THR is always Write Only. UART0 Transmit Holding Register (U0THR - address 0xE000 C000, when DLAB = 0, Write Only) bit description

UART0 Divisor Latch Registers (U0DLL - 0xE000 C000 and U0DLM -C004, when DLAB = 1) The UART0 Divisor Latch is part of the UART0 Fractional Baud Rate Generator and holds the value used to divide the clock supplied by the fractional prescaler in order to produce the baud rate clock, which must be 16x the desired baud rate (Equation 1). The U0DLL and U0DLM registers together form a 16 bit divisor where U0DLL contains the lower 8 bits of the divisor and U0DLM contains the higher 8 bits of the divisor. A 0x0000 value is treated like a 0x0001 value as division by zero is not allowed.The Divisor Latch Access Bit (DLAB) in U0LCR must be one in order to access the UART0 Divisor Latches. Baudrates available when using 20 MHz peripheral clock (PCLK = 20 MHz)

JNTUA CE , pulivendula

Page 43

address 0xE000 C004. when DLAB = 0) The U0IER is used to enable UART0 interrupt sources. pulivendula Page 44 . when DLAB = 0) bit description JNTUA CE .Finger print based electronic voting machine UART0 Interrupt Enable Register (U0IER .0xE000 C004. UART0 Interrupt Enable Register (U0IER .

pulivendula Page 45 .0xE000 C008. JNTUA CE . If an interrupt occurs during an U0IIR access.Finger print based electronic voting machine UART0 Interrupt Identification Register (U0IIR . the interrupt is recorded for the next U0IIR access. Read Only) The U0IIR provides a status code that denotes the priority and source of a pending interrupt. The interrupts are frozen during an U0IIR access.

The interrupt is cleared upon an U0LSR read. pulivendula Page 46 . The RDA is activated when the UART0 Rx FIFO reaches the trigger level defined in U0FCR[7:6] and is reset when the UART0 Rx FIFO depth falls below the trigger level. an interrupt handler routine can determine the cause of the interrupt and how to clear the active interrupt. The CTI interrupt (U0IIR[3:1] = 110) is a second level interrupt and is set when the UART0 Rx FIFO JNTUA CE . parity error (PE). The U0IIR must be read in order to clear the interrupt prior to exiting the Interrupt Service Routine. the CPU can read a block of data defined by the trigger level. Given the status of U0IIR[3:0]. The UART0 RLS interrupt (U0IIR[3:1] = 011) is the highest priority interrupt and is set whenever any one of four error conditions occur on the UART0 Rx input: overrun error (OE). When the RDA interrupt goes active. The UART0 RDA interrupt (U0IIR[3:1] = 010) shares the second level priority with the CTI interrupt (U0IIR[3:1] = 110). The UART0 Rx error condition that set the interrupt can be observed via U0LSR[4:1].Finger print based electronic voting machine Interrupts are handled as described in Table 105. framing error (FE) and break interrupt (BI).

pulivendula Page 47 . These initialization conditions are intended to give the UART0 THR FIFO a chance to fill up with data to eliminate many THRE interrupts from occurring at system start-up.5 character times. if a peripheral wished to send a 105 character message and the trigger level was 10 characters. The initialization conditions implement a one character delay minus the stop bit whenever THRE=1 and there have not been at least two characters in the U0THR at one time since the last THRE = 1 event. For example.5 to 4. A THRE interrupt is set immediately if the UART0 THR FIFO has JNTUA CE . This delay is provided to give the CPU time to write data to U0THR without a THRE interrupt to decode and service. The UART0 THRE interrupt (U0IIR[3:1] = 001) is a third level interrupt and is activated when the UART0 THR FIFO is empty provided certain initialization conditions have been met. the CPU would receive 10 RDA interrupts resulting in the transfer of 100 characters and 1 to 5 CTI interrupts (depending on the service routine) resulting in the transfer of the remaining 5 characters. This interrupt is intended to flush the UART0 RBR after a message has been received that is not a multiple of the trigger level size. Any UART0 Rx FIFO activity (read or write of UART0 RSR) will clear the interrupt.Finger print based electronic voting machine contains at least one character and no UART0 Rx FIFO activity has occurred in 3.

pulivendula Page 48 . UART0 Transmit Enable Register (U0TER . monitors the serial input line. After a valid character is assembled in the U0RSR. When TXEn=1. U0RX. UART0 Transmit Enable Register (U0TER . The THRE interrupt is reset when a U0THR write occurs or a read of the U0IIR occurs and the THRE is the highest interrupt (U0IIR[3:1] = 001). The UART0 receiver block. for valid input.Finger print based electronic voting machine held two or more characters at one time and currently. The UART0 TX Shift Register (U0TSR) JNTUA CE .3. accepts data written by the CPU or host and buffers the data in the UART0 TX Holding Register FIFO (U0THR). it is passed to the UART0 RX Buffer Register FIFO to await access by the CPU or host via the generic host interface.0xE000 C030) LPC2141/2/4/6/8’s U0TER enables implementation of software flow control. The UART0 transmitter block.Table describes how to use TXEn bit in order to achieve software flow control. RXD0. The VPB interface provides a communications link between the CPU or host and the UART0. the U0THR is empty. UART0 transmission will stop. The UART0 RX Shift Register (U0RSR) accepts valid characters via RXD0. As soon as TXEn becomes 0. U0TX.address 0xE000 C030) bit description Architecture The architecture of the UART0 is shown below in the block diagram 4. UART0 transmitter will keep sending data as long as they are available.

Fig 4.Finger print based electronic voting machine reads the data stored in the U0THR and assembles the data to transmit via the serial output pin. Status information from the U0TX and U0RX is stored in the U0LSR. This divided down clock is a 16x oversample clock. The interrupt interface contains registers U0IER and U0IIR. U0BRG.3: Architecture of UART Chapter-5 R303A Series Fingerprint Identification Module JNTUA CE . The U0BRG clock input source is the VPB clock (PCLK). generates the timing enables used by the UART0 TX block. The UART0 Baud Rate Generator block. pulivendula Page 49 . Control information for the U0TX and U0RX is stored in the U0LCR. The interrupt interface receives several one clock wide enables from the U0TX and U0RX blocks. TXD0. NBAUDOUT. The main clock is divided down per the divisor specified in the U0DLL and U0DLM registers.

for 1:N matching. or searching. When matching. The following table 5. When enrolling. system will return the matching result.Finger print based electronic voting machine Fig 5. user needs to enter the finger two times.2 includes two parts: fingerprint enrollment and fingerprint matching (the matching can be 1:1 or 1:N). success or failure. In both circumstances.1 gives the specifications of finger print module R303a JNTUA CE . user enters the finger through optical sensor and system will generate a template of the finger and compare it with templates of the finger library. shown in figure 5. system will compare the live finger with specific template designated in the Module. system will search the whole finger library for the matching finger. For 1:1 matching. generate a template of the finger based on processing results and store the template. The system will process the two time finger images.1: photograph of finger print module Fingerprint module’s processing . pulivendula Page 50 .

pulivendula Page 51 .2: Table 5. between the Module and PC.2 Hardware connection and features Via serial interface.Finger print based electronic voting machine Table 5.2: pin description of FP 5. Should the upper computer (PC) be in RS-232 mode. the Module may communicate with MCU of 3. Serial communication protocol The JNTUA CE . like MAX232. please add level converting circuit. definition of J1 is as shown in the table 5. RD (pin 3 of P1) connects with TXD (transferring pin of MCU).3V or 5V power: TD (pin 2 of P1) connects with RXD (receiving pin of MCU).1 Specifications of fingerprint module 5.1 Serial Communication(P1) When the FP module communicates with user device.

Reset time At power on.3 below JNTUA CE . 8-bit data with the LSB first. During this period.Finger print based electronic voting machine mode is semi duplex asynchronies serial communication. Electrical parameter (All electrical level takes GND as reference) Power supply The logic levels and their corresponding voltage levels are given in the table 5. the Module can’t accept commands for upper computer. There is no check bit. User may set the baud rate in 9600 ~ 115200bps Transferring frame format is 10 bit: the low-level starting bit. And the default baud rate is 57600bps. pulivendula Page 52 . it takes about 500ms for initialization. and an ending bit.

The host can access the page by instructions of PS_WriteNotepad and PS_Read Notepad. Note: Contents of the above buffers will be lost at power-off. where data requiring power-off protection can be stored.Finger print based electronic voting machine Table 5. pulivendula Page 53 . Module system provides abundant resources at user’s use. Note: when write on one page of the pad. Notepad The system sets aside a 512-bytes memory (16 pages* 32 bytes) for user’s notepad.3: logic levels and power supply specifications IV System Resources To address demands of different customer. JNTUA CE . the entire 32 bytes will be written in wholly covering the original contents. Users can read & write any of the buffers by instructions. Buffer There are an image buffer and two 512-byte-character-file buffer within the RAM space of the module.

Capacity of the library changes with the capacity of Flash. Both instructions take Parameter Number as parameter. At the next startup. Module first responses with original configurations. system will recognize the latter automatically. And the basic instructions are SetSysPara & ReadSysPara. Module opens part system parameters for use. pulivendula Page 54 . Character file buffer Character file buffer. When transferring through USB. Assume the fingerprint capacity N. User can only access library by template number. System Configuration Parameter To facilitate user’s developing. to quicken speed. then performs the parameter modification and writes configuration record into Flash. When transferring through UART. 1. And two adjacent pixels of the same row will form a byte before the transferring. that’s fingerprint library. CharBuffer2. that’s 256 grey degrees. can be used to store both character file and template file. 5. When uploaded to PC. 3 … N. That’s 8-bit BMP format. CharBuffer1. Contents of the library remain at power off. 2. the 16-grey-degree image will be extended to 256grey-degree format. When upper computer sends command to modify parameter. only the upper 4 bits of the pixel is transferred (that is 16 grey degrees).3 Fingerprint Library System sets aside a certain space within Flash for fingerprint template storage. system will run with the new configurations. Fingerprint template’s storage in Flash is in sequential order.Finger print based electronic voting machine Image buffer Image Buffer serves for image storage and the image format is 256*288 pixels. the image is 8-bit pixel. then the serial number of template in library is 0. Baud rate control (Parameter Number: 4) JNTUA CE .

corresponding to 32 bytes. however at level 5. then Module (or device) handshaking password must be JNTUA CE . 3. and corresponding value is 1. and can be read via instruction ReadSysPara. FAR is the highest and FRR is the lowest. Its value is 0. FAR is the lowest and FRR is the highest. Corresponding baud rate is 9600*N bps Security Level (Parameter Number: 5) The Parameter controls the matching threshold value of fingerprint searching and matching. 5. 0: system is free. If not. 0FFH. verifying process can be jumped. 64 bytes. 1: image buffer contains valid image. Security level is divided into 5 grades. Module password At power-on reset. system deems upper computer has no requirement of verifying password and will enter into normal operation mode. and its default factory value is 0FFH. 1: Verified device’s handshaking password. refer to instruction SetPwd. Data package length (Parameter Number: 6) The parameter decides the max length of the transferring data package when communicating with upper computer. The password length is 4 bytes. N= [1. Its length is 1 word.Finger print based electronic voting machine The Parameter controls the UART communication speed of the Module. Its value is an integer N. 3. Definition of the register is as follows: Note: Busy:1 bit. That’s. Should the password have be modified. At level 1. 2. 0FFH. 256 bytes respectively. PWD:1 bit. System status register System status register indicates the current operation status of the Module. pulivendula Page 55 . ImgBufStat:1 bit. when Module password remains the default. 1: find the matching finger. 1. 0: wrong finger. 1: system is executing commands. Pass:1 bit. 128 bytes. 0FFH. system first checks whether the handshaking password has been modified. 2. 4. 12].

the transferring and receiving of command/data/result are all wrapped in data package format. JNTUA CE . system will generate a random number and upload it. When communicating with upper computer. Data package format When communicating. especially in fingerprint scanning device. The new modified address remains at power off. The new modified password is stored in Flash and remains at power off. Communication Protocol The protocol defines the data exchanging format when ZFM-20 series communicates with upper computer. For PC. system will refuse to execute and command. USB interface is strongly recommended to improve the exchanging speed. The protocol and instruction sets apples for both UART and USB communication mode. Module system only responds to data package whose address item value is the same with its identifying address.Finger print based electronic voting machine verified before the system enter into normal operation mode. Random number generator Module integrates a hardware 32-bit random number generator (RNG) (without seed). pulivendula Page 56 . and its default factory value is 0xFFFFFFFF. each instruction/data is transferred in data package form. which contains the address item. The address length is 4 bytes. Module address: Each module has an identifying address. Or else. Via instruction GetRandomCode. User may modify the address via instruction SetAdder.

All commands/data are transferred in package format. Module address Each module has an identifying address. Module Instruction System R303A series provide 23 instructions. Module system only responds to data package whose address item value is the same with its identifying address. each instruction/data is transferred in data package form. Via instruction GetRandomCode. User may modify the address via instruction SetAdder. Random number generator Module integrates a hardware 32-bit random number generator (RNG) (without seed). application program may realize muti finger authentication functions. pulivendula Page 57 . system will generate a random number and upload it. When communicating with upper computer.Finger print based electronic voting machine The new modified password is stored in Flash and remains at power off. JNTUA CE . which contains the address item. and its default factory value is 0xFFFFFFFF. Through combination of different instructions. The new modified address remains at power off. The address length is 4 bytes.

Finger print based electronic voting machine Chapter-6 Switches and Pushbuttons and LCD display 6. JNTUA CE . The reasons for this are: vibrations. a common problem with mechanical switches as shown in figure 6.1Switches and Pushbuttons This is the simplest way of controlling appearance of some voltage on microcontroller’s input pin. Anyway. error occurs in almost 100% of cases. pulivendula Page 58 . If contact switching does not happen so quickly.or milliseconds). but long enough to be registered by the microcontroller. several consecutive bounces can be noticed prior to maintain stable state.1 switch bounce patterns This is about something commonly unnoticeable when using these components in everyday life. this whole process does not last long (a few micro. Fig 6. slight rough spots and dirt. It is about contact bounce.1. Concerning the pulse counter. There is also no need for additional explanation of how these components operate.

Even though this is more expensive solution (SPDT switch). radical measures should be taken. In addition to these hardware solutions. the values shown on figure are sufficient. The advantages of such solution are: it is free of charge. the problem is definitely resolved. The circuit (RS flip-flop) changes logic state on its output with the first pulse triggered by contact bounce. the check should be done one more time after certain time delay. it means that switch (or pushbutton) has changed its position. If the change is confirmed. pulivendula Page 59 . Since the bouncing time is not defined. a simple software solution is also commonly applied. effects of disturbances are eliminated and it can be adjusted to the worst-quality contacts. When a program tests the state of some input pin and finds changes.2 Switch interfacing with microcontroller The simplest solution is to connect simple RC circuit as shown in figure 6. 6. Besides. In the most cases. the values of elements are not strictly determined. If complete safety is needed.Finger print based electronic voting machine Fig 6. very short pulses can be also registered in this way.2 LIQUID CRYSTAL DISPLAY: JNTUA CE .2 which will suppress each quick voltage change. since the condensator is not used.

thereby relieving the CPU of the task of refreshing the LCD. In addition. 4.Finger print based electronic voting machine LCD stands for Liquid Crystal Display. characters and graphics. LCD is finding wide spread use replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons: 1. 2. Automatic shifting message on display (shift left and right).3 here is for its low price and great possibilities most frequently used in practice. Incorporation of a refreshing controller into the LCD. JNTUA CE . Fig 6. This is in contrast to LEDs. pulivendula Page 60 . These components are “specialized” for being used with the microcontrollers. which are limited to numbers and a few characters. 3. punctuation marks. It is based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16 characters each. backlight etc. which means that they cannot be activated by standard IC circuits. are considered as useful characteristics. The ability to display numbers. They are used for writing different messages on a miniature LCD. The declining prices of LCDs. In contrast. mathematical symbols etc. appearance of the pointer. it is possible to display symbols that user makes up on its own. It displays all the alphabets. Greek letters. the LED must be refreshed by the CPU to keep displaying the data. Ease of programming for characters and graphics.3 LCD display A model as shown in figure 6.

1 pin description LCD screen: JNTUA CE .Finger print based electronic voting machine Pins Functions There are pins along one side of the small printed board used for connection to the microcontroller. Their function is described in the table 6. pulivendula Page 61 .1 below: Function Pin Number Ground 1 Vss Power supply 2 Vdd Contrast 3 Vee Name Logic State 0 1 Description 0V +5V 0 – Vdd D0 – D7 are interpreted as commands D0 – D7 are interpreted as data Write data (from controller 4 RS Control operating of 5 R/W 0 1 0 to controller) Access to Normal 1 Data/commands transferred to LCD Bit 0 LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 MSB of LCD LCD) Read data (from LCD to LCD disabled operating are 6 E 1 From Data commands 7 8 9 / 10 11 12 13 14 to 0 D0 0/1 D1 0/1 D2 0/1 D3 0/1 D4 0/1 D5 0/1 D6 0/1 D7 0/1 Table 6. There are total of 14 pins marked with numbers (16 in case the background light is built in).

When used during operating. Trimmer potentiometer is usually used for that purpose the connections are as shown in figure 6. Fig 6.4. Built in processor addresses built in “map of characters” and displays corresponding symbols. Some versions of displays have built in backlight (blue or green diodes).D7 are addresses of characters that should be displayed. which depends on logic state on pin RS:  RS = 1 . Displaying position is determined by DDRAM address. a resistor for current limitation should be used (like with any LE diode).4:power supply connection to LCD LCD Basic Commands All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data. For that reason.Finger print based electronic voting machine LCD screen consists of two lines with 16 characters each. pulivendula Page 62 . Contrast on display depends on the power supply voltage and whether messages are displayed in one or two lines.Bits D0 . Each character consists of 5x7 dot matrix. JNTUA CE . variable voltage 0-Vdd is applied on pin marked as Vee. This address is either previously defined or the address of previously transferred character is automatically incremented.

pulivendula 1 .Bits D0 .64mS 40uS 40uS 40uS 40uS 40uS 40uS - I/D S D/C R/L X DL N CGRAM address DDRAM address BF DDRAM address D7 D6 D5 D4 D3 D7 D6 D5 D4 D3 D2 D1 D0 40uS D2 D1 D0 40uS Operation Increment by 1 Decrement by 1 Display shift on Display shift off Display on Display off Cursor on Cursor off Cursor blink on Cursor blink off Shift right Shift left 8-bit interface 4-bit interface Display in two lines Display in one Read from CGRAM or DDRAM 1 Function I/D S D U B R/L DL N Value 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 F 1 line Character format 5x10 dots Character format 5x7 dots Display shift Page 63 0 D/C JNTUA CE .64mS 1.Finger print based electronic voting machine  RS = 0 .2 Command Clear display Cursor home Entry mode set Display on/off control Cursor/Display Shift Function set Set CGRAM address Set DDRAM address Read “BUSY” flag (BF) Write to CGRAM or DDRAM RS RW D7 D6 D5 D4 D3 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 D2 D1 D0 0 0 1 D F 0 1 U X 1 x B x x Execution Time 1.D7 are commands which determine display mode. List of commands which LCD recognizes are given in the table below: 6.

with regards to the fact that data are rarely read from LCD (data mainly are transferred from microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to the Ground. In case of 4-bit LED mode. After that. This means that: 1. Besides.2: LCD command description LCD Connection Depending on how many lines are used for connection to the microcontroller.Finger print based electronic voting machine 0 Cursor shift Table 6. The appropriate mode is determined at the beginning of the process in a phase called “initialization”. Display is cleared 2. there are only 4 higher bits (D4-D7) used for communication. there are 8-bit and 4-bit LCD modes. display is ready to operate. it will not be possible to read from busy flag since it is not possible to read from display. four lower bits are sent afterwards. With the help of initialization. LCD will correctly connect and interpret each data received. The mode of operating is set by default. Consequently. while other may be left unconnected. Even though message displaying will be normally performed. each data is sent to LCD in two steps: four higher bits are sent first (that normally would be sent through lines D4-D7). In the first case. Mode DL = 1 Communication through 8-bit interface N = 0 Messages are displayed in one line JNTUA CE . for the sake of saving valuable I/O pins of the microcontroller. the data are transferred through outputs D0D7 as it has been already explained. LCD Initialization Once the power supply is turned on. LCD is automatically cleared. This process lasts for approximately 15mS. pulivendula Page 64 .

All left over to be done after that is to give basic commands and of course. Algorithm according to the initialization is being performed depends on whether connection to the microcontroller is through display messages. Character entry ID = 1 Addresses on display are automatically incremented by 1 S = 0 Display shift off Automatic reset is mainly performed without any problems. The algorithm is as shown in the figure 6. pulivendula Page 65 . Display/Cursor on/off D = 0 Display off U = 0 Cursor off B = 0 Cursor blink off 4. If voltage supply unit can not meet this condition or if it is needed to provide completely safe operating.or 8-bit interface. display will start perform completely unpredictably. If for any reason power supply voltage does not reach full value in the course of 10mS.5 JNTUA CE .Finger print based electronic voting machine F = 0 Character font 5 x 8 dots 3. the process of initialization by which a new reset enabling display to operate normally must be applied.

the voltage should be varied. As the voltage of this preset is varied. contrast should be adjusted. a preset is used which can behave like a variable voltage device. To adjust the contrast. pulivendula Page 66 . or control the volume (loudness) in an amplifier circuit. for example to set the switching point of a circuit with a sensor. For this. This arrangement is normally used to vary voltage. Potentiometer Variable resistors used as potentiometers have all three terminals connected. If the terminals at the ends of the track are JNTUA CE . the contrast of the LCD can be adjusted.5 algorithm for initialization of 8-bit LCD Contrast Control: To have a clear view of the characters on the LCD.Finger print based electronic voting machine Fig 6.

then the wiper terminal will provide a voltage which can be varied from zero up to the maximum of the supply. JNTUA CE . Therefore. pulivendula Page 67 .Finger print based electronic voting machine connected across the power supply. Receive the Data from Finger print and processing and validating. And take the data from switches and comparing with the data base and updating the data base. 2. the main firmware programmed can be divided into three parts: 1. LCD interface with the microcontroller (4-bit mode): Chapter 7 Firmware Implementation of the project design The firmware programmed in LPC2148 is designed to communicate with Finger print and operates according the commands received from the Switches.

compiling. JNTUA CE .Finger print based electronic voting machine 3. pulivendula Page 68 . and display the command and display the result with respect to the switch operations. and linking your embedded applications.  Links to development tools manuals.  Advanced GDI interface for software debugging in the target hardware and for connection to Keil ULINK. µVision3 helps expedite the development process of your embedded applications by providing the following:     Full-featured source code editor. device datasheets & user's guides.   Dialogs for all development tool settings. and HEX file generator. µVision3 integrates all tools including the C compiler. Integrated make facility for assembling. KEIL ARM Is Used For The Development Of Finger Print Based Electronic Voting Machine 7. linker/locator.  Flash programming utility for downloading the application program into Flash ROM. True integrated source-level Debugger with high-speed CPU and peripheral simulator. and makes facility. macro assembler.1. Device database for configuring the development tool setting. Project manager for creating and maintaining your projects.µVision3 Overview The µVision3 IDE is a Windows-based software development platform that combines a robust editor. project manager.

The Code Coverage feature of the Safety-critical systems can be thoroughly µVision3 statistical Simulator analysis provides tested and validated. pulivendula .Finger print based electronic voting machine The µVision3 IDE offers numerous features and advantages that help you quickly and successfully develop embedded applications. µVision3 offers a Build Mode and a Debug Mode. Simulation expanded capabilities using the may be Sophisticated systems can be accurately drivers. hardware different is available. The µVision3 Device JNTUA CE . The µVision3 IDE and Debugger is the central part of the Keil development tool chain. They are easy to use and are guaranteed to help you achieve your design goals. Database Mistakes in tool settings are practically Page 69 program's execution. Features and Benefits Feature Benefit The µVision3 Simulator is the only Write and test application code before debugger that completely production Investigate design. The ULINK allows you also to download your application into Flash ROM of your target system. Execution analysis of your reports can be viewed and printed for certification requirements. configurations to optimize the hardware Advanced simulated by adding your own peripheral Simulation Interface (AGSI).In the µVision3 Build Mode you maintain the project files and generate the application. In the µVision3 Debug Mode you verify your program either with a powerful CPU and peripheral simulator or with the Keil ULINK USB-JTAG Adapter (or other AGDI drivers) that connect the debugger to the target system. hardware simulates all on-chip peripherals.

Identical Target Debugger and Shortens your learning curve. Simulator User Interface. supports both Debugging programming configurable algorithm files. While debugging. Programming. pulivendula . external tool control. A Status Bar provides editor and debugger information. The Flash ULINK USB-JTAG Adapter The same tool can be used for debugging and and programming. and windows that you use as you interact with and manage the various aspects of your embedded project. The various Page 70 JNTUA CE . debugger features. IDE integrates Quickly access development tools and tools like third-party tools. and on-line help.Finger print based electronic voting machine automatically microcontroller. All configuration details additional third-party and FLASH/Device are saved in the µVision3 project. program debugging. may configure manager. toolbar buttons. keyboard shortcuts. editor. µVision3 incorporates project Accelerates application you development.  The menu bar provides menus for editor operations. dialog boxes. Interface The µVision3 User Interface consists of menus. µVision3 CASE. project maintenance. development tool option settings.  The toolbar buttons allow you to rapidly execute µVision3 commands. editing. you may make source code modifications. No extra configuration with time required. and debugger in While a single environment. configures the eliminated and tool configuration time is development tools for the target minimized. The VCS. window selection and manipulation.

Creating Applications This chapter describes the Build Mode of µVision3 and is grouped into the following sections: JNTUA CE . The following sections list the µVision3 commands that can be reached by menu commands. The µVision3 commands are grouped mainly based on the appearance in the menu bar: • • • • • • • • • • • • • • File Menu and File Commands Edit Menu and Editor Commands Outlining Menu Advanced Menu Selecting Text Commands View Menu Project Menu and Project Commands Debug Menu and Debug Commands Flash Menu Peripherals Menu Tools Menu SVCS Menu Window Menu Help Menu 7. and keyboard shortcuts. pulivendula Page 71 . toolbar buttons.  Keyboard shortcuts offer quick access to µVision3 commands and may be configured via the menu command Edit — Configuration — Shortcut Key.Finger print based electronic voting machine toolbars and the status bar can be enabled or disabled from the View Menu commands.2.

The µVision3 Debugger offers two operating modes that are selected in the Options for Target — Debug dialog. pulivendula . Architecture specific information (like bank switching for 8051) can be found in the Getting Started User's Guide of the related toolchain. Debugging This chapter describes the Debug Mode of µVision3 and shows you how to use the user interface to test a sample program. Also discussed are simulation mode and the different options available for program debugging.  Use Simulator configures the µVision3 Debugger as software-only product that simulates most features of a microcontroller without actually having target hardware. You can test and debug your embedded application before the hardware is ready. µVision3 Page 72 simulates a wide variety of peripherals including the serial port.  Tips and Tricks: provides information about the advanced features of the µVision3 Project Manager.  This chapter uses the ARM as target architecture and only explains generic features of the µVision3 IDE. You can use µVision3 Debugger to test the applications you develop.Finger print based electronic voting machine  Create a Project: explains the steps required to setup a simple application and to generate HEX output. JNTUA CE .  Project Target and File Groups: shows how to create application variants and organized the files that belong to a project.

 Use Advanced GDI drivers. pulivendula Page 73 .  The Status Bar shows the current active debugging tool. The µVision3 simulator simulates the timing and logical behavior of serial communication protocols like UART. JNTUA CE . Signal functions let you simulate analog and digital input to the microcontroller. timing statistics are provided. I²C.  Emulator: which connects to the CPU pins of the target hardware?  In-System Debugger: which is part of the user application program and provides basic test functions?  Test Hardware: such as the Infineon Smart Card ROM Monitor RM66P or the Philips SmartMX DBox.Finger print based electronic voting machine external I/O. For µVision3 various drivers are available that interface to:  JTAG/OCDS Adapter: which connects to on-chip debugging systems like the ARM Embedded ICE. But µVision3 does not simulate the I/O port toggling of the physical communication pins on the I/O port.?  Monitor: that may be integrated with user hardware or is available on many evaluation boards. SPI. Signal functions run in the background while µVision3 simulates your target program. and timers. The peripheral set is selected when you select a CPU from the device database for your target. like the ULINK Debugger to interface to your target hardware. and CAN. Simulation The µVision3 Debugger incorporates a C script language you can use to create Signal Functions. In simulation mode.

the logic behavior of communication peripherals is reflected in virtual registers that are listed with the DIR VTREG command. Flash Programming µVision3 integrates Flash Programming Utilities in the project environment. The chapter contains several Signal function temples that you may use to simulate: • • • • • • • • • • • • • • Digital Input Push Button Interrupt Signal Impulse Patterns Analog Input Square Wave Signal Saw Tooth Signal Sine Wave Noise Signal Signal Combination UART Communication CAN Communication I²C Communication SPI Communication 7. All configurations are saved in context with your current project.3. JNTUA CE .Finger print based electronic voting machine To provide fast simulation speed and optimum access to communication peripherals. pulivendula Page 74 . This has the benefit that you can easily write debug functions that stimulate complex peripherals.

 Flash Algorithms: explains you how to create own Flash Program Algorithms for the Keil ULINK USB-JTAG Adapter.  ULink Configuration: explains the configuration settings for the Keil ULINK USB-JTAG Adapter.  Pre-Download Scripts: allows to you program multiple applications or configure the BUS system which is required for ULINK when you program off-chip Flash devices. pulivendula Page 75 . The Flash Programming Utilities are configured under Project — Options — Utilities.  HEX File Flash Download: explains how to program existing HEX files. JNTUA CE . For more information refer to the following topics:  Configure Flash Menu: configures the Flash Menu for using an external command-line based utility or the Keil ULINK USB-JTAG Adapter. Flash Programming may be started from the Flash Menu or before starting the µVision3 Debugger when you enable Project — Options — Utilities — Update Target before Debugging.Finger print based electronic voting machine You may use external command-line driven utilities (usually provided by the chip vendor) or the Keil ULINK USB-JTAG Adapter.

1 Fig 7. pulivendula Page 76 .1 screenshot of keil µ3vision Flash Magic The screenshot of FLASH MAGIC is as shown in figure 7.Finger print based electronic voting machine The screenshot of µ3vision is as shown in figure 7.2 JNTUA CE .

0XFF. unsignedchar generate_ch[13]={0xEF.0X01.dummy.0XFF.2 screenshot of flashmagic 7. pulivendula Page 77 .CODE: /* Voting mechain using Finger print.h" #define sw1 0x00100000 #define sw2 0x00020000 #define sw3 0x00040000 #define sw4 0x00080000 unsigned char i=0.str[4].0X 08}.0X01.0X00.0X00.rec.0XFF.0XFF.0X04.0X01.0X01. JNTUA CE .0X01.0XFF.0x02.0X00.h> #include "serial.Finger print based electronic voting machine Fig 7.0X03.4.fp[20].j=0.s=0.h" #include"lcd. unsignedchar enroll[12]={0xEF.0XFF.0XFF.0X01.0X00.0X05}.0XFF. */ #include <lpc214x." welcome ").0X11.0XFF.i1=0.0X03.0).0X00. void clearfp(void).0X01.count=0.id2=0.n=0.0X00. while(1) { JNTUA CE .0XFF. message(0.cnt=0. void long_delay (void ).i2=0.0X01.0X01.b2=0.enroll_check=0. /*------------------------------------------------------------------------main program --------------------------------------------------------------------------*/ int main (void ) { lcd_init()."EVM with FP").eeprom_add=0.en_byte. i=0.0XFF.0XFF. unsignedchar identify[12]={0xEF.0X06. unsignedchar part_A=0.part_B=0.aa.0X06.0).check=0. //lcd_cmd(0x01. again: lcd_cmd(0x01.0XFF.part_D=0. void convert (unsigned char temp_value).0X15}.Finger print based electronic voting machine unsignedchar store[11]={0xEF.0XFF.0XFF. message(0. pulivendula Page 78 . delay(1000).0X01}. lcd_cmd(0xc0.0).part_C=0. delay(1000).id1=0.0XFF. unsigned char b1=0.

. rec=UART1_getch()..0). i++."Enrolling ok"). dummy=UART1_getch(). rec=UART1_getch().0). rec=UART1_getch().Finger print based electronic voting machine /******* Enrolling your ID *********************/ if((IOPIN0&sw1)==0) { while((IOPIN0&sw1)==0). i=0. rec=UART1_getch(). } rec=UART1_getch(). if(!rec) { lcd_cmd(0x01. rec=UART1_getch(). rec=UART1_getch(). message(0. } else JNTUA CE . pulivendula Page 79 //checking for sw1 . while(i<12) { send_ch_UART0(enroll[i]). lcd_cmd(0x01. dummy=UART1_getch().. rec=UART1_getch()."). rec=UART1_getch(). message(0. rec=UART1_getch()."Enrolling.

if(!rec) { lcd_cmd(0x01. rec=UART1_getch(). } JNTUA CE . rec=UART1_getch(). goto again. rec=UART1_getch(). message(0. } i=0. rec=UART1_getch(). message(0. rec=UART1_getch().Finger print based electronic voting machine { lcd_cmd(0x01. } rec=UART1_getch(). rec=UART1_getch(). rec=UART1_getch()."Enrolling not ok"). dummy=UART1_getch(). rec=UART1_getch().0).0)."gen char ok"). i++. pulivendula Page 80 . rec=UART1_getch(). while(i<13) { send_ch_UART0(generate_ch[i]). dummy=UART1_getch().

rec=UART1_getch(). rec=UART1_getch().Finger print based electronic voting machine else { lcd_cmd(0x01. pulivendula Page 81 . } i=0.0)."store ok"). i++. dummy=UART1_getch(). if(!rec) { lcd_cmd(0x01. rec=UART1_getch(). rec=UART1_getch(). dummy=UART1_getch(). rec=UART1_getch()."genchar not ok"). } JNTUA CE . rec=UART1_getch(). message(0. while(i<11) { send_ch_UART0(store[i]). rec=UART1_getch(). rec=UART1_getch().0). message(0. goto again. } rec=UART1_getch(). rec=UART1_getch().

JNTUA CE . message(0. goto again. lcd_cmd(0x01. i++. } /*********** identifying your ID *******************/ if((IOPIN0&sw2)==0) { while((IOPIN0&sw2)==0).0). i=0. en_byte=16."). enroll_check =1. //en_byte=12.0)."Identfying.Finger print based electronic voting machine else { lcd_cmd(0x01. message(0. pulivendula Page 82 //checking for sw2 . } //check=1. } check=1. //enroll_check =0. while(i<12) { send_ch_UART0(identify[i])..."store not ok").

check=0. convert(part_B). lcd_cmd(0xc0. } /********* receiving data from FP *********/ if(check==1) { count=0. lcd_cmd(0xcc. JNTUA CE .0). goto again.0).0). message(1. convert(part_A)."A B C D"). pulivendula Page 83 //checking for sw3 . convert(part_C).0). long_delay().Finger print based electronic voting machine } /*********** final result *******************/ if((IOPIN0&sw3)==0) { while((IOPIN0&sw3)==0). part_A=part_B=part_C=part_D=0. lcd_cmd(0x01.0). convert(part_D). lcd_cmd(0xc7. lcd_cmd(0xc4. long_delay().

// lcd_cmd(b2+0x30. i1=0. long_delay(). JNTUA CE . pulivendula Page 84 .0). } long_delay().Finger print based electronic voting machine while(count<en_byte) { fp[count]=UART0_getch(). b1=fp[n+11]/10.0). i1=b1-48. message(0xc0. // message(0xc0. count++.0). lcd_cmd(0xc0."Id:"). id=0. lcd_cmd(0x80.1).1). n=0.0). b1=0. while(n<20) { if((fp[n]==0xEF)&&(fp[n+1]==0x01)&&(fp[n+9]==0x00)) { lcd_cmd(0x01. // lcd_cmd(b1+0x30.0). i2=0. message(1." Successfully ")." completed"). // lcd_cmd(0xc0. long_delay(). b2=0. // lcd_cmd(0xC3. b2=fp[n+11]%10. long_delay().

enroll_check=0. } } } } /*----------------------------------------------------polling your vote ----------------------------------------------------*/ JNTUA CE . } goto again. } else { lcd_cmd(0x01. goto poll. message(1. i2=i2*1." Plz poll ur vote ").0). if(enroll_check ==1) { lcd_cmd(0x01. message(1. pulivendula Page 85 . goto again. long_delay(). long_delay(). i2=b2-48. // clearfp(). id=i1+i2.0)." Failed").Finger print based electronic voting machine i1=i1*10.

// goto again. } if((IOPIN0&sw2)==0) { part_B++.0)."Vote for part C"). long_delay().Finger print based electronic voting machine poll: while(1) { if((IOPIN0&sw1)==0) { part_A++. lcd_cmd(0x01. message(1. pulivendula . long_delay(). lcd_cmd(0x01.0). // goto again. } if((IOPIN0&sw3)==0) { part_C++. message(1.0). Page 86 //sw1 //sw2 //sw3 JNTUA CE . lcd_cmd(0x01."Vote for part A"). goto again. long_delay(). goto again."Vote for part B"). goto again. message(1.

goto again. long_delay(). --------------------------------------------------------------------------------------*/ goto again.Finger print based electronic voting machine } if((IOPIN0&sw4)==0) { part_D++. } /*--------------------------------------------------------------------------------------. // } } } /*-----------------------------------------------Clear the string clearfp ------------------------------------------------*/ void clearfp(void) { unsigned char cl=0. //sw4 JNTUA CE . pulivendula Page 87 . lcd_cmd(0x01. } j=0. message(1.convertion program Binary to ASCii . while(cl<20) { fp[cl]=' '."Vote for part D").0). cl++.

delay(4). } /*--------------------------------------------------------------------------------. // msgdisplay(".Finger print based electronic voting machine void convert(unsigned char temp_value) { unsigned char value. k++."). pulivendula Page 88 .g++) delay(40000). d1=d1+30. lcd_cmd(d3.d3. for(g=0. delay(10).d1.d2.1). lcd_cmd(d2. d3=temp_value%10. ----------------------------------------------------------------------------------*/ void long_delay (void ) { unsigned int g.g<500. d2=d2+30. value=temp_value/10. temp_value = temp_value. d2=value%10. d3=d3+0x30.k=0. d1=value/10.1). // lcddata(d1). delay(10). long delay . k=0. } JNTUA CE .

CU communicates with switching unit in order to exchange various signals. check it for proper connections before switching on the power supply. some features could not be fine-tuned and are not working properly.  The CU is accepting fingerprints in enrolling mode and is responding accordingly. Because of the creative nature of the design. As the users work with the system. After assembling the circuit on the PCB.  CU is counting the votes for individual candidate (20 in number) and total number of votes cast can be checked at anytime.  In identifying and vote casting mode. whenever the “Result Button” is pressed. pulivendula Page 89 .  In result mode. both the units are working independently and in collaboration with each other as well. JNTUA CE . the CU checks for finger print detection routine  In identifying and vote casting mode. the complete system (including all the hardware components and software routines) is working as per the initial specifications and requirements of our project.1. the CU displays the votes of individual candidate.  The total number of votes can be checked in result mode. in consecutive order. and due to lack of time.1 Results Assemble the circuit on the PCB as shown in Fig 5.  The EVM consists of a controller and switching unit . So certain aspects of the system can be modified as operational experience is gained with it. In total.Finger print based electronic voting machine Chapter 8 Results and Discussions 8.

Circuit is implemented in Orcad and implemented on the microcontroller board. pulivendula Page 90 . The mechanism is controlled by the microcontroller.Advantages  Cost effective  Low power consumption  It is economical  Less manpower required JNTUA CE . The performance has been verified both in software simulator and hardware design.3. It can be concluded that the design implemented in the present work provide portability. Design is done to meet all the specifications and requirements. The total circuit is completely verified functionally and is following the application software.Finger print based electronic voting machine they develop various new ideas for the development and enhancement of the project 8. The communication is properly done without any interference between different modules in the design. The performance of the system is more efficient. Orcad Lite for the schematic diagram have been used to develop the software code before realizing the hardware. Flash Magic to dump the source code into the microcontroller. flexibility and the data transmission is also done with low power consumption. Software tools like Keil Uvision Simulator.2 Conclusion The implementation of Finger print based voting machine using microcontroller is done successfully. 8. Reading the Data and verifying the information with the already stored data and perform the specified task is the main job of the microcontroller.

as less time required for voting & counting  Avoids invalid voting  Saves transportation cost due to its compact size  Convenient on the part of voter 8. like resident welfare association. • Fast track voting which could be used in small scale elections. “panchayat” level election and other society level elections.Applications This project can be used as an voting machine that can prevent rigging during the elections in the polling booths. JNTUA CE . • • It could also be used to conduct opinion polls during annual share 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 holders meeting. pulivendula Page 91 .4.Finger print based electronic voting machine  Time conscious.

pulivendula Page 92 .  It could be interfaced with printer to get the hard copy of the result almost instantly from the machine itself.  Again. once the result is on the server it could be relayed on the network to various offices of the election conducting authority.  It could also be interfaced with the personal computer and result could be stored in the central server and its backup could be taken on the backend servers. Thus our project could make the result available any corner of the world in a matter of seconds other JNTUA CE .Finger print based electronic voting machine CHAPTER 9 FUTURE SCOPE  Number of candidates could be increased.

aimglobal.html http://csrc. http://www.pdf 5.asp 4. http://focus.microdigitaled.asp 2.html 11. http://www. http://www.Finger print based electronic voting machine CHAPTER 10 REFERENCES 7.pdf JNTUA CE . 6. http://www.pdf 8.nist.technovelgy.ti. pulivendula Page 93 .pdf