micro-p mini project Full Report

May 13, 2018 | Author: Wei Hor | Category: Electronic Circuits, Input/Output, Subroutine, Pointer (Computer Programming), Password
Share Embed Donate


Short Description

good...

Description

UNIVERSITI MALAYSIA PERLIS

EMT 245 INTRODUCTION TO MICROPROCESSOR DESIGN

A PROPOSAL REPORT ON THE MINI PROJECT ( DIGITAL CODE LOCKING SYSTEM)

COURSE: RK 86- ELECTRONIC ENGINEERING

DATE OF SUMISSION: !8 MAY 2"!6

GROUP MEMERS: NO# ! 2 $ 4

NAME AINUL KAMILAH INTI MOHD YUSOFF KENNY FONG PENG &YE NUR AIN SHA'LIN INTI JUSOH SEE &EI HOR

MATRIC NO !4!"$!%"% !4!"$!%26 !4!"$!%6% !4!"$!%8!

READ AND APPROVED Y

   (

    

)

DATE

TALE OF CONTENTS

NO

CONTENT

PAGE

!#

INTRODUCTION

$

2#

ACKGROUND

4-5

$#

METHODOLOGY

6-8

4#

RESULT  DISCUSSION

*-!%

5#

CONCLUSION

!8

6#

REFERENCE

!*

!#"

I+,./01,.+:

Page | 2

Throughout this mini project that had been conducted on Digital Code Locking System, we had use a digital lock which is a device which has an electronic control assembly attached to it. They are provided with an access control system that allows only authorized  persons to access a restricted area. This system allows the user to unlock the device with a  password. The password is entered by making use o a keypad. The user can also set his  password to ensure better protection. The major components include a keypad!"#$T %& as a input, L'D !"#$T (& and )*segment L'D !"#$T C& as output then, the controller (T+C- which belongs to the +/+- series o microcontrollers. 0sing the digital code lock it will reduce the risk and liability o keys alling into wrong hands. 1t also can be adapted to any electronic gadget which needs to be protected rom unauthorised2access. 1t will only responds to the right se3uence o three digits that are keyed in remotely. 1 a wrong key is touched, it resets the lock and the program will be halted. The 45 Sim+- was used to do a program or this mini project. The +/+- simulator program 45 Sim+-, has several  built*in input output graphical user interaces !601s& developed or the users7 practice. (lthough not e8actly accurate as in the actual hardware input and output devices, but these graphical interaces do oer the user some added value demonstration materials in understanding our program urther. #ne can especially observe our simulation program and analyse on any assembly code improvements.

2#"

31.0+/:

Page | 3

9or this mini project, we were used + types o components. That is L'D or "#$T (, :8; o 

Components + L'Ds !output& !"#$T (&

=

:8; o

Press frst button?

5es

Show value in 7 segment

ompare value with !

$ight

rong

Light up led

Light up the led

"ead data

Page | 6

 >o

Press se#ond button?

5es

Show value in 7 segment

ompare value with 4

$ight

rong

Light up led

Light up led

"ead data

 >o

Press third button?

Page | 7

5es

Show value

ompare value with $

$ight

Light up upper bit o%  led

Light up led

ompare value with !3

Light up lower bit o%  led

&nd

Page | $

4#"

R0, D10.+:

The hardware simulation re3uires the origin address start at =///?. L1 S", ;99/? will allows Stack "ointer points to the address ;99/?. 4E1 (, //////% is or the indication o  the output and input or port (, port %, port C. The port % is set to be input and the other   ports will be set as output. #0T +;? is the control port that controls the input and output  ports as to be set as planned. % register is used to be the counter or counting the times o  ailure o user pressed. C register is used to count the total amount o value or successul keypad inputs. The program continues with a loop test with port %. T'ST" is a loop or a the button in keypad is pressed or not. 1> +? indicates when a value is pressed or released. (>1 /? commands the logical (>D with accumulator. 1 no button is pressed, the F lag !zero lag& will be  and the program continue looping back to T'ST". (ter detected a button is pressed, the program continue to T'ST"( loop which test the  button is released or not. 1 the button is not released, it will continue looping T'ST"(. (>1 /? commands the logical (>D with accumulator. 1 the button is not released, the F lag !zero lag& will be / and the program continue looping back to T'ST"(. 4eanwhile i  the button is released and F lag will be  and the program continue.

Page | '

T indicates the position o the keypad pressed and released, to make sure that the button  pressed and released is in the keypad. L1 ?, ;///h is the loading the data rom ;///?. L1 D, ////? is used to make sure the D' register pair is / since the ' register !lower bit& will be used. Then, move accumulator value to register '. >ow register ' have the keypad position value. D(D D stands or add register pair D' to ?L register and save in ?L register. 1 the  position pressed is -, means that the memory pointer will point rom address ;/// to address ;//- and then display the value in address ;//-. #0T +=? indicate the accumulator value will display on the ) segment since +=? stand or port C and port C is connected to ) segment. This allows user to know what he typed. C"1 //////% stand or immediately compare the accumulation value with the data typed in. 1 the value is the same as the compared value, F 9lag will be set otherwise the F lag will be /. 1 the F lag is reset !/& the  program will jump conditionally to $#>6 subroutine. 4eanwhile, i the F lag is set !& the program will jump conditionally to $16?T subroutine.

Page | !(

1n the $#>6 subroutine, the program will show the "() to light up in port (. 4eanwhile, in the $16?T subroutine, the program will show the "(/ to light up in port (. The arrangement is made like this to prevent conusion or user and the program. The lower bits will indicate the correct password and the upper bits will indicate the wrong password. (dditional in the $16?T subroutine, the C register will be saved value o  into the program. Since the irst password is , the value o  is then save into C register. Since the D(D D and moving 4 to ( may cause conusion to the program. L1 ?,;///? will be typed again. The program will continue as the second input is pressed. 1t is similar to the irst value where the program will wait until the second value is pressed. T'ST"= is a looping condition where program waits user to press the second key in the keypad.

Page | !!

(ter a key is pressed, T'ST"=( looping condition will be tested when the user haven7t released the button. 1 the user didn7t release the button that he pressed, the program will continue loop back to T'ST"=(. Similar to the irst value, the accumulator now have the position o keypad in the program T=. (ter gotten the value, the value is copied to ' register. D(D D will unction again to have the memory pointer points to the desire memory address and get its value rom ;///?. Then, the ?L registers have the value rom the ;///?. 9or e8ample, i : is pressed, the memory  pointer will points to ;//:? in the memory to get its value stored. The value o ?L will be moved to accumulator to display its result in the +=? ! port C &.

Page | !2

(ter the program allows the ) segment to display what is the user pressed, immediately compare with the password :. 1 the password is correct, the zero lag will be set. Then the  program will jump conditionally with F lag e3ual to  to C#$$'CT=. 1 the password  pressed is not :, the zero lag will not be set. Then the program will jump conditionally with  jump not zero !B>F& to $#>6. 1n the $#>6 subroutine, the program is set to allow the "(A to be light up and set the output or port ( !+/?&. This shows a dierent L'D lights up. 4eanwhile, in the C#$$'CT= subroutine, additional program or the C register is present. The value stored in C register will be moved to accumulator and then add immediately with :. 1 the password is correct or both times, the accumulator now will be -. The program continues with moving  back to C register. The correct L'D lights up will be the "( since it is the second password and it is not the irst password already. (ter displaying the L'D either "( or "(A the  program will jump unconditionally to T'ST"; where the program allow user to press the third password.

Page | !3

1n line A), T'ST"; is similar to T'ST" and T'ST"=. T'ST"; is a looping program to detect the third password to be pressed. 1 nothing is pressed in this time, the program will continue looping back to T'ST";. 1n line ), T'ST";( is similar to T'ST"( and T'ST"=(. T'ST";( is a looping program to detect when the user released the pressed password. 1 the user didn7t released, the program will just loop back to T'ST";(. T; indicate or the program to know the location o the keypad pressed.

Page | !4

L1 ? indicate the memory location pointed out by the A bit address into register L and copies the contents o the ne8t memory location into register ?. The contents o source memory location are not altered. %y resetting the D' to // another memory pointer location can be easily get or the program. 1 a + keypad is press, the memory pointer will point rom ;///? to ;//?. !+ is the  th number is the keypad& Then the memory point will point to ;//? and get the value stored in the accumulator. (ter that, the value o accumulator is then displayed in port C or the )segment display. The value is immediately compared with the saved password G +. 1 the password is correct, then the zero lag will be set. Thereore, the program will ignore line +: since it is a jump conditionally when zero lag is reset and  proceed to line +-. Line +- indicates a jump conditionally when zero lag is set and it will  jump to C#$$'CT; subroutine. Line +A is the $#>6= subroutine, when L'D "(- will lights up. This allows the programmer to understand which password is correct or wrong. The L'D is set as port (.

Page | !5

Line + indicates the subroutine or C#$$'CT;. 1n the subroutine, the register C value is moved to accumulator and added immediately with value + and then move back to register C. Since this subroutine is determined the third correct password. Thereore "(= is set to be light up. (ter that the program jumps unconditionally to subroutine correct. Line A indicate the wrong password combination that user typed. L'D is set to light up rom "(: to "() !?igher bits& and beore the user able to key in again, the register % is decrement  by . Since this program only allow user to try ; times. This is a saety precaution or prevent thet issues in real lie. 1 the password is wrongly key in ; times, the program will be jump to '>D. %eore the Hlie7 is been used up, the program will loop back to T'ST" which is the allows user to key in the irst password again.

Page | !6

Line /= indicates subroutine or correct8 which is only when the last password is typed. This program makes sure that the password typed in is correct and is in order. The saved  password is :+ and total value o this password is ;. Thereore, the register o C is then moved out to accumulator and compare with ;. 1 the value is less than ; the zero lag will  be reset and jump conditionally to 8orc subroutine !reer above&. 1 the value is ;, the  program will let the lower bit o the L'D in port ( lights up. 9inally, the program will be halt straight i the password is correct. (lthough the total value o the password is ;, i user key in the password not in order or  other amount that can be ; !such as =;+& it will not be trigger as the correct password  because only when the irst password is correct, the C register will stored  continue by the second password is correct, the value o C register will accumulate to -. Then only i the third  password is correct again, the value o C register will be accumulated to ;. #ther than this way, the C register will not have the value o ; and it is impossible to show the correct arrangement or the L'D in port (. Line / is the program or the keypad. This program starts at origin o ;///?. D9% indicate the data value set into the keypad. 9or e8ample, i  in the keypad is pressed, the memory  point will point to ;///? and the value o ;///? which is //////% is taken as the value. This is output will be shown at the ) segment and to be compared or the password. 1n this program, there is a special declaration or the )segment display. The +/-Development board or "C is spoiled. Thereore "C is replaced by "C) since ) segment only use ) port and "C) normally is not been used. The interchange o "C and "C) will show the perect result or display the value.

Page | !7

5#"

C.+10.+:

The overall system was constructed and tested. The results are it works perectly. e were able to e8ecute all the unctions speciied in our proposal. The biggest hurdle we had to overcome with this project was interacing the microcontroller with the hardware components. e think that this digital code lock is very marketable because it is ine8pensive due to low power consumption, easy to use, comparatively and highly reliable. (s such, we design a cheap and eective security system or buildings, cars, saes, doors and gates, so as to prevent unauthorized person rom having access to ones properties through the use o  codes, we thereore e8periment the application o electronic devices as locks.

This simple digital code lock using microcontroller can be enhanced by incorporating new means o authentication. 4ost prevalent orm o digital lock is that using a numerical code or authenticationI the correct code must be entered in order or the lock to deactivate. Such locks typically provide a keypad, and some eature an audible response to each press. Combination lengths are ; digits long in our program o digital code locking system. The code entered this way is then compared to the password stored in memory. The microcontroller continuously monitors the keypad or a match with the stored password. (s and when there is a match the output line is enabled which can then be used to trigger an L'D. (n LCD display is also used to display whether the entered password is correct or not. 9urthermore, we set the program that user has only ; times to key in the password.

Page | !$

6#"

R;+1:

%ookJ K >.ew DelhiJ "?l Learning "rivate Limited, =//, pp. ;=*;A. ebsitesJ K; Shivam 6upta. !=/:,>ovember&. Digital code locking s ystem K#nline. (vailableJhttpsJ22ershivamgupta.wordpress.com2project*=2---*timer*based*project2digital* code*lock system2 K: $aja >abila $aja 4uzaar. !=/,December&. Digital code lock. K#nline. (vailableJhttpJ22www.slideshare.net2%(1
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF