You are on page 1of 9



1. 2. 3. 4. 5. 6.

Introduction Circuit Diagram Circuit Description 8051 Microcontroller Architecture Source code Bibliography


2-Digit Token Display System are ideal for Banks, Airports, Public dealing offices, Hospitals, Doctors Clinics, Restaurants and other such places where people have to wait in line for their turn. These systems allow customers to wait without having to stand in line, once their number is displayed then only will they have to get in line for their turn.

The inconvenience encountered in many public dealing places like restaurants, banks, and canteens etc. where people normally follow queue system has called for many solutions to speed up and ease the dealings. In this project, we show a microcontroller based 2 digit token number display system to overcome the inconvenience mentioned above. We are using microcontroller 89c51 as CPU. Tokens are distributed on first come first serve basis and as soon as any counter are ready to provide services the person there just has to press one push switch to show the incremented token number and respective counter number in displays. Whenever counter has to be stopped another switch is pressed and a message WAIT is displayed. Now when this switch is again pressed, message READY TO SEND is displayed and counter starts from the previous location. Using this system the customers need not wait in long queues in sunlight or rain and wasting time, but come to get their order once their token number is displayed in the large customer display. It consists of two portions: a display unit and a processing unit.


The circuit diagram is shown in figure below-

LCD is connected with the port 1 of the MC. One seven segment display is connected to port 0 and second seven segment is connected to port 2. The two seven segments used is LT542 i.e. anode type. Every time switch s1 is pressed counter is increased and the corresponding number is displayed on the seven segment. Number which is displayed on the seven segment is simultaneously displayed on LCD. And when switch s2 is pressed counter is stopped and wait message is displayed on LCD.Now counter will be incremented only when s2 is again pressed. And ready to send will be displayed on LCD. Switch s3 is used for resetting the counter.


The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology. The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry.

Pin Configuration:

The coding of the token display system prototype is in the assembly language. org 0000h 5

lcd equ p1 rs equ p3.3 rw equ p3.2 en equ p3.1 org 0h acall lcd1 mov r7,#0h go1: mov p0,#0c0h acall go mov p0,#0f9h acall go mov p0,#0a4h acall go mov p0,#0b0h acall go mov p0,#99h acall go mov p0,#92h acall go mov p0,#82h acall go mov p0,#0f8h acall go mov p0,#80h acall go mov p0,#90h acall go sjmp go1 go: mov p2,#0c0h acall delay acall cn mov p2,#0f9h acall delay acall cn mov p2,#0a4h acall delay acall cn mov p2,#0b0h acall delay acall cn mov p2,#99h acall delay 6

acall cn mov p2,#92h acall delay acall cn mov p2,#82h acall delay acall cn mov p2,#0f8h acall delay acall cn mov p2,#80h acall delay acall cn mov p2,#90h acall delay acall cn ret delay: mov r3,#1h hj: mov r1,#0ffh gh: mov r2,#0ffh ty: djnz r2,ty djnz r1,gh djnz r3,hj ret cmd: mov lcd,a clr rs clr rw setb en acall delay1 clr en ret dat: mov lcd,a setb rs clr rw setb en acall delay1 clr en ret lcd1: 7

mov a,#38h acall cmd mov a,#01h acall cmd mov a,#06h acall cmd mov a,#0eh acall cmd mov a,#80h acall cmd ret cn: mov a,r7 mov b,#0ah div ab mov 47h,b mov b,#0ah div ab mov 46h,b mov a,#30h add a,46h acall dat mov a,#30h add a,47h acall dat loop: jnb p3.6,goa jnb p3.7,ngoa sjmp loop goa: mov a,#01h acall cmd inc r7 ret ngoa: mov a,#01h acall cmd mov dptr,#k1 godf: clr a movc a,@a+dptr jz her acall dat 8

inc dptr sjmp godf her: acall delay acall delay here: jnb p3.7,jf sjmp here jf: acall delay mov a,#01h acall cmd mov dptr,#k2 tyr: clr a movc a,@a+dptr jz loop acall dat inc dptr sjmp tyr delay1: mov r6,#23h sj: mov r5,#0ffh ry: djnz r5,ry djnz r6,sj ret k1: db 'WAIT', 0 k2: db 'READY TO SEND, 0 end