project report_code lock

62
PROJECT REPORT ON MICROCONTROLLER BASED DIGITAL CODE LOCK Submitted By: NAME : SHIKHA SARDANA(09) ANKITA GUPTA(22) SHRUTI SINGH(29) CLASS : B.TECH 4 TH YEAR/8 TH SEM ROLL NO . : 09,22,29 BRANCH : INSTRUMENTATION & CONTROL Institute of Instrumentation Engg, Kurukshetra University,

Upload: rajat-narula

Post on 12-Nov-2014

34 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Project Report_code Lock

PROJECT REPORT ON

MICROCONTROLLER BASED

DIGITAL CODE LOCK

Submitted By: NAME : SHIKHA SARDANA(09) ANKITA GUPTA(22) SHRUTI SINGH(29)

CLASS : B.TECH 4TH YEAR/8TH SEM ROLL NO. : 09,22,29 BRANCH : INSTRUMENTATION & CONTROL

Institute of Instrumentation Engg,Kurukshetra University,

Kurukshetra

Page 2: Project Report_code Lock

AUTHENTICATION CERTIFICATE

This is to certify that the work presented in this project is entirely carried out by SHIKHA SARDANA, ANKITA GUPTA & SHRUTI SINGH under my guidance and is submitted to Institute of Instrumentation Engineering,Kurukshetra University,Kurukshetra and this project has not been submitted by them to any other university for attainment of any degree/diploma/PG or certificate course.

Signature of the Project Guide

(DR.D.S. RANA)

ACKNOWLEDGEMENT

Page 3: Project Report_code Lock

This project has helped us learn a lot and enabled us to understand a lot

about the applications of microcontrollers in various fields.

This has been possible only due to the immense help extended by

Dr.D.S.RANA, Sh.Suresh Ahlawat(electronic workshop incharge,I.I.E kuk),

and Tushar Sachdeva Sir(student 2006-2010 batch at I.I.E kuk), who have

gladly taken time off their busy schedule to make sure that our project

proves worthwhile.

We would like to thank them all profusely for all of their time and help as

now we can say we have benefited a lot because of them.

Thank You Sirs,

SHIKHA SARDANA

ANKITA GUPTA

SHRUTI SINGH

MICROCONTROLLER BASED CODE LOCK

Page 4: Project Report_code Lock

ABOUT THE PROJECT:

Code locks can be constructed using digital and timer ICs employing pushbuttons

or keypads for entering the code for authentication and operation of the code lock.

However,such circuits would require a large number of ICs. On the other hand, a

microcontroller-based code lock will require very few peripheral components.With

the cost of microcontrollers now dropping to the equivalent cost of approximately

four digital ICs, it makes sense to design simple logic circuits using

microcontrollers and free version of programming languages. Although free-

version-language code length is normally limited to around 2 kB, but that is

adequate for projects like this one.This simple code lock project is based on a 20-

pin ATMEL microcontroller AT89C2051. It employs a 5-digit sequential code

with time-out security feature[1]. In addition to the microcontroller, the circuit

uses a single additional IC (L293D) and IC(7404) to drive a motor. Although the

project uses a liquid-crystal display (LCD), it is useful for design and

developmental purpose only and is not really an essential part of the circuit. The

same can be removed from the circuit without any change in the software.As

regards LCD modules, these are available in 14- or 16-pin packages. The 16-pin

variety has an additional backlight option. Popular brands available in India are

Lampex, Hantronix and Hitachi. Most other models also have the same pin

configuration. The model used in this project is Lampex LM16200 16-

character×2-line alphanumeric dot-matrix display with backlight option.

Page 5: Project Report_code Lock
Page 6: Project Report_code Lock
Page 7: Project Report_code Lock
Page 8: Project Report_code Lock
Page 9: Project Report_code Lock
Page 10: Project Report_code Lock

CIRCUIT DESCRIPTION:

As already mentioned, the project makes use of ATMEL AT89C2051

microcontroller,in 20-pin DIP package,which supports 2 kB of flash-based program

memory. A 6MHz crystal is used for providing the clock. Port-3 of the microcontroller

is used to drive the LCD in 4-bit mode with 10-kilo-ohm pull-up resistors. The 10-

kilo-ohm resistor controls the contrast of the LCD panel.Timer 1 of AT89C2051 is

used as an internal counter that increments a variable every second.After

initialisation, the software switches on and waits for a 5-digit code to be entered. The

valid code for this project is ‘56712.’ The code is entered using the twelve input

switches(hex keypad) that are connected to port-1. One LED at port-1 is interfaced to

P1.3 pin to provide ‘microcontroller output(low)’ indication via LED whereas

another LED is connected at pin-3 of L293D to indicate ‘MOTOR ON’.The P1.3 line is

also interfaced to L293D at pin-2(input) of L293D through an inverter 7404 to

switch on a motor, which can activate an electrically operated lock . The motor is

connected between pin-3 and pin-6 of L293D(H-bridge).Whenever the correct lock is

entered,we get a low output from pin P1.3 of AT89C2O51 which is inverted by

7404(inverter) to obtain a high output.This high output(5V) is fed to pin 2 of L293D

which is a motor driver IC and works on 12V input and thus the output is taken

between pin 3 and 6 of motor driver.After three unsuccessful attempts of entering the

password, the circuit will wait for sometime (before accepting the next keystroke) to

avoid unwanted tampering attempts. All these timings can be changed through the

software program to suit your specific requirements.Also we can change the security

5-digit password by first entering ’54321#’ and then entering the 10-digit master

password ‘8776934265#’ and then entering the new 5-digit code(say 92229#) which

will be saved for future[3].

Page 11: Project Report_code Lock

PARTS LIST:

Semiconductors: IC1 - AT89C2051 microcontroller IC2 – L293D (Motor driver/h-bridge) IC3 - 7805 +5V regulator IC4 – 7812 +12V regulator IC5 – 7804 (inverter) LED1 & LED2 - 5mm LED

Resistors (all ¼-watt, ±5% carbon): R1, R2, R3, R5 – 1-kilo-ohm R4 - 330-ohm R6 - 10-kilo-ohm

Capacitors: C1, C2 - 33pF ceramic disk C3 - 10 F ceramic diskμ

Miscellaneous: XTAL - 6MHz crystal S1- S13 - Push-to-on switch S1 - On/off switch 16-character×2-line LCD(LM016L) 12V D.C Motor 18V Supply through batteries

Page 12: Project Report_code Lock

MICROCONTROLLER AT89C2051 :

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable read-only memory (PEROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications[2].The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

Features:• Compatible with MCS®-51Products• 2K Bytes of Reprogrammable Flash Memory – Endurance: 10,000 Write/Erase Cycles• 2.7V to 6V Operating Range• Fully Static Operation: 0 Hz to 24 MHz• Two-level Program Memory Lock• 128 x 8-bit Internal RAM• 15 Programmable I/O Lines• Two 16-bit Timer/Counters• Six Interrupt Sources• Programmable Serial UART Channel• Direct LED Drive Outputs• On-chip Analog Comparator• Low-power Idle and Power-down Modes• Green (Pb/Halide-free) Packaging Option

Page 13: Project Report_code Lock

PIN CONFIGURATION:20-lead PDIP/SOIC:

Page 14: Project Report_code Lock

BLOCK DIAGRAM

Page 15: Project Report_code Lock

PIN DESCRIPTION:

Page 16: Project Report_code Lock

VCC :- Supply voltage.

GND : -Ground.

Port 1 :-The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IL) because of the internal pull-ups.Port 1 also receives code data during Flash programming and verification.

Port 3 :-Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general-purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IL) because of the pull-ups.Port 3 also serves the functions of various special features of the AT89C2051 as listed below:

Page 17: Project Report_code Lock

RST :-Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. Each machine cycle takes 12 oscillator or clock cycles.

XTAL1 :-Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2 :-Output from the inverting oscillator amplifier.

Oscillator Characteristics :-The XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in figure below. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in figure below. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking

circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

Page 18: Project Report_code Lock

4X3 HEX KEYPAD:A keypad is the most widely used input devices of a microcontroller.At the lowest level, keyboards are organized in a matrix of rows and columns. The CPU accesses both rows and column through ports; therefore, with a port of microcontroller, a 4X3 matrix of keys can be connected. When a key pressed, a row and column make a connection; otherwise, there is no connection between row and column[4].

HEX KEYPAD SCANNING AND INTERFACING:

When a key is pressed, the row for that key will be physically connected to the column for that key. Therefore, the port input for the column will be at the same logic level as the port output for the row.

Since the columns (inputs) are normally at the HIGH logic level due to pull-up resistors, the only way to make a column LOW will be to press a key and make the row for that key LOW.

By periodically strobing each row LOW one row at a time, and reading the column input levels during each strobe, one can determine which key is pressed.

Page 19: Project Report_code Lock
Page 20: Project Report_code Lock
Page 21: Project Report_code Lock

SCANNING ALGORITHM:

Keypads are often used as a primary input device for embedded microcontrollers.

The keypads actually consist of a number of switches, connected in a row/column arrangement.

In order for the microcontroller to scan the keypad, it outputs a nibble to force one (only one) of the columns low and then reads the rows to see if any buttons in that column have been pressed.

The rows are pulled up by the internal weak pull-ups in the 8051 ports. Consequently, as long as no buttons are pressed, the microcontroller sees a logic high on each of the pins attached to the keypad rows.

The nibble driven onto the columns always contains only a single 0. The only way the microcontroller can find a 0 on any row pin is for the keypad button to be pressed that connects the column set to 0 to a row.

The controller knows which column is at a 0-level and which row reads 0,allowing it to determine which key is pressed. For the keypad, the pins from left to right are: R1, R2, R3, R4, C1, C2, C3, C4.

A Column is generally high (output). One row at a time is made to go low(input) and than the columns are

read. If one or more columns are low than the switches of the corresponding

columns are active and their respective values should be displayed on the terminal.

16X2 LCD(LM016L):LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special and even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data[5].The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling

Page 22: Project Report_code Lock

display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

Pin diagram:

Pin description:-

Page 23: Project Report_code Lock

IC 7404(INVERTER):

7404 is a NOT gate IC. It consists of six inverters which perform logical invert action. The output of an inverter is the complement of its input logic state, i.e., when input is high its output is low and vice versa[6].

Pin diagram:

Pin description:

Page 24: Project Report_code Lock

IC L293D(MOTOR DRIVER):

L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors[7].L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions, respectively.Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable input is high, the associated driver gets enabled. As a result, the outputs become active and work in phase with their inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are off and in the high-impedance state.

Pin diagram:

Page 25: Project Report_code Lock

Pin description:

Page 26: Project Report_code Lock

ASSEMBLY PROGRAM:

ORG 0000H0000| LJMP 032DH0003| CLR A0004| MOV 22H,A0006| LCALL 043CH0009| LCALL 0703H000C| MOV R7,#01H000E| LCALL 0647H0011| MOV R3,#0FFH0013| MOV R2,#02H0015| MOV R1,#9CH0017| LCALL 066FH001A| MOV R7,#0C0H001C| LCALL 0647H001F| CLR A0020| MOV R7,A0021| LCALL 0622H0024| MOV R7,#3AH0026| LCALL 0622H0029| MOV R7,#05H002B| LCALL 03B9H002E| MOV 21H,R70030| MOV 27H,#0FFH0033| MOV 28H,#02H0036| MOV 29H,#0ACH0039| MOV 2AH,#05H003C| MOV R3,#00H003E| MOV R2,#00H0040| MOV R1,#08H0042| LCALL 05B5H0045| JNC 05H0047| LCALL 01D9H004A| SJMP 0C0H004C| MOV A,21H004E| CJNE A,#01H,0BBH

Page 27: Project Report_code Lock

0051| JNB 01H,0BH0054| MOV 27H,#00H0057| MOV 28H,#00H005A| MOV 29H,#12H005D| SJMP 09H005F| MOV 27H,#0FFH0062| MOV 28H,#05H0065| MOV 29H,#6AH0068| MOV 2AH,#05H006B| MOV R3,#00H006D| MOV R2,#00H006F| MOV R1,#08H0071| LCALL 05B5H0074| MOV 02H,C0076| JNB 02H,74H0079| MOV 17H,#03H007C| CLR 93H007E| MOV R7,#01H0080| LCALL 0647H0083| MOV R7,#03H0085| LCALL 0622H0088| MOV R3,#0FFH008A| MOV R2,#02H008C| MOV R1,#0B2H008E| LCALL 066FH0091| MOV R7,#0C0H0093| LCALL 0647H0096| MOV R3,#0FFH0098| MOV R2,#02H009A| MOV R1,#0BBH009C| LCALL 066FH009F| MOV R7,#0FAH00A1| LCALL 06E4H00A4| MOV R7,#0FAH00A6| LCALL 06E4H00A9| MOV R7,#0FAH00AB| LCALL 06E4H00AE| MOV R7,#0FAH00B0| LCALL 06E4H

Page 28: Project Report_code Lock

00B3| MOV R7,#01H00B5| LCALL 0647H00B8| MOV R3,#0FFH00BA| MOV R2,#02H00BC| MOV R1,#0C8H00BE| LCALL 066FH00C1| MOV R7,#0C0H00C3| LCALL 0647H00C6| MOV R3,#0FFH00C8| MOV R2,#02H00CA| MOV R1,#0D9H00CC| LCALL 066FH00CF| LCALL 04A8H00D2| CJNE R7,#0CH,0FAH00D5| SETB 93H00D7| MOV R7,#01H00D9| LCALL 0647H00DC| MOV R7,#03H00DE| LCALL 0622H00E1| MOV R3,#0FFH00E3| MOV R2,#02H00E5| MOV R1,#0E5H00E7| LCALL 066FH00EA| LJMP 000CH00ED| DEC 17H00EF| MOV R7,#01H00F1| LCALL 0647H00F4| MOV R7,#02H00F6| LCALL 0622H00F9| MOV R3,#0FFH00FB| MOV R2,#02H00FD| MOV R1,#0F5H00FF| LCALL 066FH0102| MOV R7,#0C0H0104| LCALL 0647H0107| MOV R3,#0FFH0109| MOV R2,#03H010B| MOV R1,#02H010D| LCALL 066FH

Page 29: Project Report_code Lock

0110| MOV A,17H0112| ADD A,#30H0114| MOV R7,A0115| LCALL 0622H0118| MOV R7,#0FAH011A| LCALL 06E4H011D| MOV R7,#0FAH011F| LCALL 06E4H0122| MOV R7,#0FAH0124| LCALL 06E4H0127| MOV R7,#0FAH0129| LCALL 06E4H012C| MOV A,17H012E| JZ 03H0130| LJMP 000CH0133| MOV R7,#01H0135| LCALL 0647H0138| MOV R7,#02H013A| LCALL 0622H013D| MOV R3,#0FFH013F| MOV R2,#03H0141| MOV R1,#10H0143| LCALL 066FH0146| MOV R7,#02H0148| LCALL 0622H014B| MOV R7,#0C0H014D| LCALL 0647H0150| CLR A0151| MOV R7,A0152| LCALL 0622H0155| MOV R7,#3AH0157| LCALL 0622H015A| MOV R7,#0AH015C| LCALL 03B9H015F| MOV 21H,R70161| MOV 27H,#0FFH0164| MOV 28H,#05H0167| MOV 29H,#60H016A| MOV 2AH,#0AH

Page 30: Project Report_code Lock

016D| MOV R3,#00H016F| MOV R2,#00H0171| MOV R1,#08H0173| LCALL 05B5H0176| JNC 32H0178| MOV 17H,#03H017B| MOV R7,#01H017D| LCALL 0647H0180| MOV R7,#02H0182| LCALL 0622H0185| MOV R3,#0FFH0187| MOV R2,#03H0189| MOV R1,#18H018B| LCALL 066FH018E| MOV R7,#02H0190| LCALL 0622H0193| MOV R7,#0FAH0195| LCALL 06E4H0198| MOV R7,#0FAH019A| LCALL 06E4H019D| MOV R7,#0FAH019F| LCALL 06E4H01A2| MOV R7,#0FAH01A4| LCALL 06E4H01A7| LJMP 000CH01AA| MOV R7,#01H01AC| LCALL 0647H01AF| MOV R7,#02H01B1| LCALL 0622H01B4| MOV R3,#0FFH01B6| MOV R2,#03H01B8| MOV R1,#22H01BA| LCALL 066FH01BD| MOV R7,#02H01BF| LCALL 0622H01C2| MOV R7,#0FAH01C4| LCALL 06E4H01C7| MOV R7,#0FAH01C9| LCALL 06E4H

Page 31: Project Report_code Lock

01CC| MOV R7,#0FAH01CE| LCALL 06E4H01D1| MOV R7,#0FAH01D3| LCALL 06E4H01D6| LJMP 0133H01D9| MOV R7,#01H01DB| LCALL 0647H01DE| MOV R7,#80H01E0| LCALL 0647H01E3| MOV R3,#0FFH01E5| MOV R2,#05H01E7| MOV R1,#11H01E9| LCALL 066FH01EC| MOV R7,#0C0H01EE| LCALL 0647H01F1| CLR A01F2| MOV R7,A01F3| LCALL 0622H01F6| MOV R7,#3AH01F8| LCALL 0622H01FB| MOV R7,#0AH01FD| LCALL 03B9H0200| MOV 23H,R70202| MOV A,23H0204| XRL A,#01H0206| JZ 03H0208| LJMP 0292H020B| MOV 27H,#0FFH020E| MOV 28H,#05H0211| MOV 29H,#60H0214| MOV 2AH,#0AH0217| MOV R3,A0218| MOV R2,#00H021A| MOV R1,#08H021C| LCALL 05B5H021F| JNC 4FH0221| MOV R7,#01H0223| LCALL 0647H0226| MOV R3,#0FFH

Page 32: Project Report_code Lock

0228| MOV R2,#05H022A| MOV R1,#22H022C| LCALL 066FH022F| MOV R7,#0C0H0231| LCALL 0647H0234| CLR A0235| MOV R7,A0236| LCALL 0622H0239| MOV R7,#3AH023B| LCALL 0622H023E| MOV R7,#05H0240| LCALL 03B9H0243| MOV 23H,R70245| MOV A,23H0247| XRL A,#01H0249| JNZ 1AH024B| MOV R7,#01H024D| LCALL 0647H0250| MOV R7,#03H0252| LCALL 0622H0255| MOV R3,#0FFH0257| MOV R2,#05H0259| MOV R1,#31H025B| LCALL 066FH025E| SETB 01H0260| LCALL 06D1H0263| SJMP 19H0265| MOV A,23H0267| XRL A,#02H0269| JZ 0B6H026B| MOV A,23H026D| XRL A,#03H026F| RET0270| MOV R7,#01H0272| LCALL 0647H0275| MOV R3,#0FFH0277| MOV R2,#05H0279| MOV R1,#42H027B| LCALL 066FH

Page 33: Project Report_code Lock

027E| MOV R7,#0FAH0280| LCALL 06E4H0283| MOV R7,#0FAH0285| LCALL 06E4H0288| MOV R7,#0FAH028A| LCALL 06E4H028D| MOV R7,#0FAH028F| LJMP 06E4H0292| MOV A,23H0294| XRL A,#02H0296| JNZ 03H0298| LJMP 01D9H029B| RET029C| ORL A,6EH029E| MOV A,#65H02A0| ORL C,20H02A2| XRL A,R402A3| XRL A,R702A4| XRL 6BH,#20H02A7| XRL 6FH,#64H02AA| XRL A,00H02AC| ADDC A,34H02AE| RLC A02AF| RETI02B0| ACALL 100H02B2| JB 4CH,6FH02B5| XRL 6BH,#20H02B8| XRL A,R102B9| JMP @A+DPTR02BA| NOP02BB| XRL A,#65H02BD| AJMP 363H02BF| MOV A,#69H02C1| MOV @R0,#61H02C3| MOV A,#65H02C5| XRL A,#21H02C7| NOP02C8| JNC 72H02CA| XRL A,73H

Page 34: Project Report_code Lock

02CC| JMP @A+DPTR02CD| JB 27H,23H02D0| ADD A,@R102D1| JB 6BH,65H02D4| MOV R1,#20H02D6| MOV A,#6FH02D8| NOP02D9| XRL A,R402DA| XRL A,R702DB| XRL 6BH,#20H02DE| AJMP 367H02E0| AJMP 369H02E2| XRL A,R602E3| AJMP 100H02E5| ORL A,R402E6| XRL A,R702E7| XRL 6BH,#20H02EA| XRL A,R102EB| JMP @A+DPTR02EC| JB 61H,63H02EF| MOV A,#69H02F1| MOV @R0,#65H02F3| AJMP 100H02F5| JB 57H,72H02F8| XRL A,R702F9| XRL A,R602FA| XRL A,@R102FB| JB 43H,6FH02FE| XRL A,#65H0300| AJMP 100H0302| ANL A,#72H0304| XRL A,R10305| XRL A,73H0307| JB 6CH,65H030A| XRL A,@R0030B| MOV A,#20H030D| ADDC A,R5030E| JB 00H,42H0311| ORL A,R4

Page 35: Project Report_code Lock

0312| ORL A,R70313| ORL 4BH,#45H0316| ORL A,#00H0318| ANL A,4EH031A| ORL 4CH,A031C| ORL A,R7031D| ORL 4BH,#45H0320| ORL A,#00H0322| ANL A,@R10323| ANL 4FH,A0325| ORL A,R60326| ORL A,@R10327| JB 43H,4FH032A| ORL A,#45H032C| NOP032D| MOV R0,#7FH032F| CLR A0330| MOV @R0,A0331| DJNZ R0,0FDH0333| MOV 81H,#2AH0336| LJMP 0374H0339| LJMP 0003H033C| CLR A033D| MOVC A,@A+DPTR033E| INC DPTR033F| MOV R0,A0340| CLR A0341| MOVC A,@A+DPTR0342| INC DPTR0343| JC 03H0345| MOV @R0,A0346| SJMP 01H0348| MOVX @R0,A0349| INC R0034A| DJNZ R7,0F4H034C| SJMP 29H034E| CLR A034F| MOVC A,@A+DPTR0350| INC DPTR

Page 36: Project Report_code Lock

0351| MOV R0,A0352| ANL A,#07H0354| ADD A,#0CH0356| XCH A,R00357| CLR C0358| RLC A0359| SWAP A035A| ANL A,#0FH035C| ORL A,#20H035E| XCH A,R0035F| MOVC A,@A+PC0360| JC 04H0362| CPL A0363| ANL A,@R00364| SJMP 01H0366| ORL A,@R00367| MOV @R0,A0368| DJNZ R7,0E4H036A| SJMP 0BH036C| AJMP 002H036E| INC A036F| INC R00370| JBC 20H,40H0373| SJMP 90H0375| INC @R00376| CPL A0377| CLR A0378| MOV R6,#01H037A| MOVC A,@A+DPTR037B| JZ 0BCH037D| INC DPTR037E| MOV R7,A037F| ANL A,#3FH0381| JNB 0E5H,09H0384| ANL A,#1FH0386| MOV R6,A0387| CLR A0388| MOVC A,@A+DPTR0389| INC DPTR

Page 37: Project Report_code Lock

038A| JZ 01H038C| INC R6038D| XCH A,R7038E| ANL A,#0C0H0390| ADD A,0E0H0392| JZ 0A8H0394| JC 0B8H0396| CLR A0397| MOVC A,@A+DPTR0398| INC DPTR0399| MOV R2,A039A| CLR A039B| MOVC A,@A+DPTR039C| INC DPTR039D| MOV R0,A039E| CLR A039F| MOVC A,@A+DPTR03A0| INC DPTR03A1| XCH A,R003A2| XCH A,82H03A4| XCH A,R003A5| XCH A,R203A6| XCH A,83H03A8| XCH A,R203A9| MOVX @DPTR,A03AA| INC DPTR03AB| XCH A,R003AC| XCH A,82H03AE| XCH A,R003AF| XCH A,R203B0| XCH A,83H03B2| XCH A,R203B3| DJNZ R7,0E9H03B5| DJNZ R6,0E7H03B7| SJMP 0BEH03B9| MOV 24H,R703BB| CLR A03BC| MOV 25H,A03BE| LCALL 04A8H

Page 38: Project Report_code Lock

03C1| MOV 26H,R703C3| MOV A,R703C4| JZ 0F8H03C6| MOV R7,26H03C8| LCALL 06B4H03CB| MOV 26H,R703CD| MOV A,#08H03CF| ADD A,25H03D1| MOV R0,A03D2| MOV @R0,26H03D4| MOV A,26H03D6| XRL A,#78H03D8| JNZ 20H03DA| MOV A,25H03DC| JNZ 03H03DE| MOV R7,#03H03E0| RET03E1| DEC 25H03E3| MOV A,25H03E5| ADD A,#0C2H03E7| MOV R7,A03E8| LCALL 0647H03EB| MOV R7,#20H03ED| LCALL 0622H03F0| MOV A,25H03F2| ADD A,#0C2H03F4| MOV R7,A03F5| LCALL 0647H03F8| SJMP 0C4H03FA| MOV A,26H03FC| CJNE A,#65H,03H03FF| MOV R7,#01H0401| RET0402| INC 25H0404| MOV A,25H0406| SETB C0407| SUBB A,24H0409| JC 2AH040B| MOV R7,#01H

Page 39: Project Report_code Lock

040D| LCALL 0647H0410| MOV R7,#02H0412| LCALL 0622H0415| MOV R3,#0FFH0417| MOV R2,#05H0419| MOV R1,#4EH041B| LCALL 066FH041E| MOV R7,#0FAH0420| LCALL 06E4H0423| MOV R7,#0FAH0425| LCALL 06E4H0428| MOV R7,#0FAH042A| LCALL 06E4H042D| MOV R7,#0FAH042F| LCALL 06E4H0432| MOV R7,#02H0434| RET0435| MOV R7,26H0437| LCALL 0622H043A| SJMP 82H043C| LCALL 05EAH043F| MOV R7,#28H0441| LCALL 0647H0444| MOV R7,#0CH0446| LCALL 0647H0449| MOV R7,#06H044B| LCALL 0647H044E| MOV R7,#40H0450| LCALL 0647H0453| CLR A0454| MOV 23H,A0456| MOV DPTR, #0694H0459| LCALL 061EH045C| INC 23H045E| MOV A,23H0460| CLR C0461| SUBB A,#08H0463| JC 0F1H0465| CLR A

Page 40: Project Report_code Lock

0466| MOV 23H,A0468| MOV DPTR, #069CH046B| LCALL 061EH046E| INC 23H0470| MOV A,23H0472| CLR C0473| SUBB A,#08H0475| JC 0F1H0477| CLR A0478| MOV 23H,A047A| MOV A,23H047C| MOV DPTR, #06A4H047F| MOVC A,@A+DPTR0480| MOV R7,A0481| LCALL 0622H0484| INC 23H0486| MOV A,23H0488| CLR C0489| SUBB A,#08H048B| JC 0EDH048D| CLR A048E| MOV 23H,A0490| MOV A,23H0492| MOV DPTR, #06ACH0495| MOVC A,@A+DPTR0496| MOV R7,A0497| LCALL 0622H049A| INC 23H049C| MOV A,23H049E| CLR C049F| SUBB A,#08H04A1| JC 0EDH04A3| MOV R7,#80H04A5| LJMP 0647H04A8| CLR A04A9| MOV 2AH,A04AB| MOV 29H,#01H04AE| MOV 27H,A04B0| MOV R7,27H

Page 41: Project Report_code Lock

04B2| MOV A,#80H04B4| MOV R0,07H04B6| INC R004B7| SJMP 02H04B9| CLR C04BA| RRC A04BB| DJNZ R0,0FCH04BD| MOV R6,A04BE| CPL A04BF| ANL 90H,A04C1| MOV R7,90H04C3| ANL 07H,#07H04C6| CLR C04C7| MOV A,#07H04C9| SUBB A,R704CA| JZ 2BH04CC| JB 90H,09H04CF| MOV 2AH,29H04D2| JNB 90H,0FDH04D5| MOV R7,2AH04D7| RET04D8| JB 91H,0BH04DB| MOV A,29H04DD| INC A04DE| MOV 2AH,A04E0| JNB 91H,0FDH04E3| MOV R7,2AH04E5| RET04E6| JB 92H,0CH04E9| MOV A,29H04EB| ADD A,#02H04ED| MOV 2AH,A04EF| JNB 92H,0FDH04F2| MOV R7,2AH04F4| RET04F5| INC 28H04F7| MOV A,#03H04F9| ADD A,29H04FB| MOV 29H,A

Page 42: Project Report_code Lock

04FD| MOV A,R604FE| ORL 90H,A0500| MOV R7,#0AH0502| LCALL 06E4H0505| INC 27H0507| MOV A,27H0509| CLR C050A| SUBB A,#04H050C| JC 0A2H050E| MOV R7,#00H0510| RET0511| ORL A,6EH0513| MOV A,#65H0515| ORL C,20H0517| ORL A,R50518| AJMP 373H051A| MOV A,#65H051C| ORL C,63H051E| XRL A,R7051F| XRL A,#65H0521| NOP0522| ORL A,6EH0524| MOV A,#65H0526| ORL C,20H0528| XRL A,R60529| XRL A,77H052B| JB 63H,6FH052E| XRL A,#65H0530| NOP0531| XRL A,R40532| XRL A,R70533| XRL 6BH,#20H0536| XRL 6FH,#64H0539| XRL A,20H053B| JMP @A+DPTR053C| AJMP 376H053E| XRL A,64H0540| AJMP 100H0542| ANL A,@R1

Page 43: Project Report_code Lock

0543| ANL 4FH,A0545| ORL A,R60546| ORL A,@R10547| JB 43H,4FH054A| ORL A,#45H054C| AJMP 100H054E| JB 43H,6FH0551| XRL A,#65H0553| JB 74H,6FH0556| XRL A,R70557| JB 4CH,6FH055A| XRL A,R6055B| XRL A,@R1055C| ADD A,R6055D| ADD A,R6055E| ADD A,R6055F| NOP0560| ADDC A,R00561| ADDC A,@R10562| ADDC A,@R10563| ADDC A,@R00564| ADDC A,R10565| RLC A0566| ADDC A,#32H0568| ADDC A,@R00569| ADDC A,35H056B| ADDC A,@R0056C| ADDC A,@R1056D| ACALL 132H056F| CJNE R3,#01H,06H0572| MOV 82H,R10574| MOV 83H,R20576| MOVX A,@DPTR0577| RET0578| JNC 02H057A| MOV A,@R1057B| RET057C| CJNE R3,#0FEH,02H057F| MOVX A,@R1

Page 44: Project Report_code Lock

0580| RET0581| MOV 82H,R10583| MOV 83H,R20585| CLR A0586| MOVC A,@A+DPTR0587| RET0588| CJNE R3,#01H,0CH058B| MOV A,82H058D| ADD A,R1058E| MOV 82H,A0590| MOV A,83H0592| ADDC A,R20593| MOV 83H,A0595| MOVX A,@DPTR0596| RET0597| JNC 06H0599| MOV A,R1059A| ADD A,82H059C| MOV R0,A059D| MOV A,@R0059E| RET059F| CJNE R3,#0FEH,06H05A2| MOV A,R105A3| ADD A,82H05A5| MOV R0,A05A6| MOVX A,@R005A7| RET05A8| MOV A,82H05AA| ADD A,R105AB| MOV 82H,A05AD| MOV A,83H05AF| ADDC A,R205B0| MOV 83H,A05B2| CLR A05B3| MOVC A,@A+DPTR05B4| RET05B5| MOV 24H,R305B7| MOV 25H,R205B9| MOV 26H,R1

Page 45: Project Report_code Lock

05BB| CLR A05BC| MOV R7,A05BD| MOV A,R705BE| CLR C05BF| SUBB A,2AH05C1| JNC 25H05C3| MOV R3,27H05C5| MOV R2,28H05C7| MOV R1,29H05C9| MOV 82H,R705CB| MOV 83H,#00H05CE| LCALL 0588H05D1| MOV R6,A05D2| MOV R3,24H05D4| MOV R2,25H05D6| MOV R1,26H05D8| MOV 82H,R705DA| MOV 83H,#00H05DD| LCALL 0588H05E0| XRL A,R605E1| JZ 02H05E3| CLR C05E4| RET05E5| INC R705E6| SJMP 0D5H05E8| SETB C05E9| RET05EA| MOV 0B0H,#0FFH05ED| MOV R7,#14H05EF| LCALL 06E4H05F2| MOV 0B0H,#83H05F5| MOV 0B0H,#03H05F8| MOV R7,#0AH05FA| LCALL 06E4H05FD| MOV 0B0H,#83H0600| MOV 0B0H,#03H0603| MOV R7,#01H0605| LCALL 06E4H0608| MOV 0B0H,#83H

Page 46: Project Report_code Lock

060B| MOV 0B0H,#03H060E| MOV R7,#01H0610| LCALL 06E4H0613| MOV 0B0H,#82H0616| MOV 0B0H,#02H0619| MOV R7,#01H061B| LJMP 06E4H061E| MOV A,23H0620| MOVC A,@A+DPTR0621| MOV R7,A0622| MOV A,R70623| SWAP A0624| ANL A,#0FH0626| MOV R6,A0627| ORL A,#0A0H0629| MOV 0B0H,A062B| MOV A,R6062C| ORL A,#20H062E| MOV 0B0H,A0630| MOV A,R70631| ANL A,#0FH0633| MOV R6,A0634| ORL A,#0A0H0636| MOV 0B0H,A0638| MOV A,R60639| ORL A,#20H063B| MOV 0B0H,A063D| MOV R7,#0C8H063F| LCALL 06FCH0642| MOV R7,#0C8H0644| LJMP 06FCH0647| MOV A,R70648| MOV R0,#04H064A| MOV C,0E7H064C| RRC A064D| DJNZ R0,0FBH064F| MOV R6,A0650| ANL A,#0FH0652| ORL A,#80H

Page 47: Project Report_code Lock

0654| MOV 0B0H,A0656| MOV A,R60657| ANL A,#0FH0659| MOV 0B0H,A065B| MOV A,R7065C| ANL A,#0FH065E| MOV R6,A065F| ORL A,#80H0661| MOV 0B0H,A0663| MOV 0B0H,R60665| MOV R7,#0C8H0667| LCALL 06FCH066A| MOV R7,#0C8H066C| LJMP 06FCH066F| MOV 27H,R30671| MOV 28H,R20673| MOV 29H,R10675| MOV R3,27H0677| MOV R2,28H0679| MOV R1,29H067B| LCALL 056FH067E| JZ 13H0680| INC 29H0682| MOV A,29H0684| JNZ 02H0686| INC 28H0688| DEC A0689| MOV R1,A068A| LCALL 056FH068D| MOV R7,A068E| LCALL 0622H0691| SJMP 0E2H0693| RET0694| INC R60695| INC R20696| DEC R70697| DEC R70698| DEC R30699| DEC R3

Page 48: Project Report_code Lock

069A| INC R6069B| NOP069C| INC R6069D| LJMP 1F1FH06A0| DEC R306A1| DEC R306A2| INC R606A3| NOP06A4| DEC R706A5| DEC R306A6| DEC R306A7| DEC R306A8| DEC R306A9| DEC R706AA| DEC R306AB| DEC R706AC| NOP06AD| AJMP 003H06AF| DEC @R006B0| DEC R406B1| INC R006B2| NOP06B3| NOP06B4| MOV A,R706B5| CLR C06B6| SUBB A,#0AH06B8| JNC 05H06BA| MOV A,R706BB| ADD A,#30H06BD| MOV R7,A06BE| RET06BF| CJNE R7,#0AH,03H06C2| MOV R7,#78H06C4| RET06C5| CJNE R7,#0BH,03H06C8| MOV R7,#30H06CA| RET06CB| CJNE R7,#0CH,02H06CE| MOV R7,#65H

Page 49: Project Report_code Lock

06D0| RET06D1| CLR A06D2| MOV R7,A06D3| MOV A,#08H06D5| ADD A,R706D6| MOV R0,A06D7| MOV A,@R006D8| MOV R6,A06D9| MOV A,#12H06DB| ADD A,R706DC| MOV R0,A06DD| MOV @R0,06H06DF| INC R706E0| CJNE R7,#05H,0F0H06E3| RET06E4| MOV R5,07H06E6| MOV R7,05H06E8| DEC R506E9| MOV A,R706EA| JZ 07H06EC| MOV R7,#95H06EE| LCALL 06FCH06F1| SJMP 0F3H06F3| RET06F4| AJMP 600H06F6| AJMP 601H06F8| AJMP 017H06FA| RR A06FB| NOP06FC| MOV R6,07H06FE| DEC R706FF| MOV A,R60700| JNZ 0FAH0702| RET0703| ANL 90H,#0FH0706| RET END

Page 50: Project Report_code Lock

REFERENCES

1. http://kitsnspares.com/admin/pdffiles/Microcontroller%20based

%20Code%20Look.pdf

2. http://www.atmel.com/Images/doc0368.pdf

3. http://efymag.com

4. http://www.hbcc.edu.sa/facpages/kt/embedded/kt_Hex

%20Keypad%20Scanning%20and%20Interfacing.pdf

5. http://www.engineersgarage.com/electronic-components/16x2-

lcd-module-datasheet

6. http://www.engineersgarage.com/electronic-components/74ls04-

datasheet

7. http://www.engineersgarage.com/electronic-components/l293d-

motor-driver-ic

8. The 8051 microcontroller and embedded systems by Muhammad

Ali Mazidi,Janice Gillispie Mazidi,Rolin D. McKinlay

Page 51: Project Report_code Lock