Showing posts with label LCD Interfacing with 8051. Show all posts

voting software

program for single user electronic voting machine in assembly language:



org 00h

lcd equ p0

rs equ p1.0

rw equ p1.1

en equ p1.2

mov lcd,#38h

acall cmd

acall delay

mov lcd,#06h

acall cmd

acall delay

mov lcd,#01h

acall cmd

acall delay

mov lcd,#0ch

acall cmd

acall delay

mov lcd,#85h

acall cmd

nop

mov lcd,#'0'

acall disp

mov lcd,#86h

acall cmd

nop

mov lcd,#'0'

acall disp

nop                                                                                        ;jdsjdkd

setb p2.0

mov dptr,#300h

mov r0,dpl

mov r3,dph

mov r6,#00d

check: jb p2.0,check

inc r6

mov a,r6

mov b,#10

div ab

mov r5,b                                                             

cjne r5,#00,go                                   ;gdhfjgk

mov dpl,r0

mov dph,r3                                                         ;//////*********1st**********//////

                                               

mov a,r5

movc a,@a+dptr

mov lcd,#86h

acall cmd

mov lcd,#'0'

acall disp

mov lcd,#85h

acall cmd

mov lcd,a

acall disp

inc dptr

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

mov r0,dpl

mov r3,dph

sjmp check



go: mov dptr,#200h

mov a,r5

movc a,@a+dptr

mov lcd,#86h

acall cmd

acall delay

acall delay

acall delay

acall delay

acall delay

mov lcd,a

acall disp

sjmp check





abc2: sjmp abc2



cmd: clr rs

clr rw

setb en

acall delay2

clr en

ret



delay2: mov r1,#0cch

here3: mov r2,#001h

here: djnz r2,here

djnz r1,here3

ret



disp: setb rs

clr rw

setb en

acall delay2

clr en

ret



delay: mov r4,#0f1h

abn2: mov r7,#0ffh

abn: djnz r7,abn

djnz r4,abn2

ret



org 200h

db '0123456789'



org 300h

db '123456789'



Single user electronic voting machine

It is a nice project and easy to implement. You are required to know about the LCD interfacing so that you can understand the concept behind voting machine easily. I have implemented this circuit on proteus and hardware both.

Hardware is also easy to implement. You just have to interface LCD and connect a momentry switch to a particular pin of microcontroller.

Working of voting machine: When we start the project it initializes to zero. as we press the switch, value is increased by one.
I have used a general purpose register of microcontroller and register is initializes to zero when it starts. It checks the status of switch regularly. when switch is pressed value of register is increased by one. As we know that LCD always display ASCII value. It is not able to display the hex or decimal value. To display the number as ASCII value, i have stored the ASCII value from 0 to 9 in program memory. So that we are able to pick the equivalent ASCII value according to the stored value.






- Copyright © Microcontroller Projects -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -