Security
Security
• system operation :
1. Receive the unique code .(password)
2. Make the verification operation .
3. Display the result on 7-segment .
• Type of user :
1. Administration password .
2. Normal user’s .
• System modes :
1. Programming mode .
2. Verification mode .
Project description :
THIS DEV
ICE ARE
USED IN O
UR
PROJECT
CURRENT SYSTEM :
Searching centre
Universities
Hospital's
Ministries
Libraries
Laboratories
Airport's
Companies
80C51 microcontroller family
The processing unit in our project is AT89S8252 , which is
one of the 8051 family , there are many type of
microcontroller that is compatible with it . This type of
microcontroller have extra feature more than any one .
Pin configuration :
EXTERNAL
INTERRUPTS
On-chip
Interrupt flash
ETC
control On-chip TIMER 0
COUNTER
INPUTS
RAM TIMER 1
CPU
TXD RXD
P0 P2 P1 P3
ADDRESS/DATA
Fundamental operation of Microcontroller
A typical micro-controller system has the following
configuration.
Peripheral IO devices,
GND e.g. 8255, 8253 real time
clock, etc.
AT89S8252 features :
NTERFACE
MUC UNIT
AT89s89 To port1 PA and PB Keypad
(PPI)
52 switches
USB DEVICE
Relay device
Electrical lock
IC’s description
The following are the major units of the system:
1. AT89S8252; The microcontroller used as the processing unit in the
System, it is derivative of the 8051microcontroller and compatible
With it.
2 .8255 parallel peripheral interface (PPI): this chip is used as an
interface
Between Inputs (output) devices and the microcontroller.
3 .Seven segment display: this chip accept seven-segment code and
displays it.
4 .Relay device (12 v) .
5 .amplifier ( 2n2222) .
6 .connect to the system external supply 12v to operate electric lock .
7 .switches to enter the code into the system .
Addressing mode
The AT89S8252 use multiplexed address in port 0 so for 16 bit address (64 k )
The 8bit low address is issue thought port 0 , and after that latched using the
ALE / signal . The figure show below is illustrate that :
Memory or PPI
AT 89S8252 Latch
74LS373
Port0 low address 8bit
11110001
11110001
OE/
ALE/
WR/ RD/
clear
Note : the pin P1.7 (97H) of part1 is used for clearing the flip flop (97H)
Output unit :
2000
1FFF
Internal
Flash
(8kb)
0000
Next user
password
-
X 60H -
X 61H -
Temporary -
X 62H
storage X
-
63H -
-
- -
-
-
-
-
How determine the address of PPI (8055)
B B B B B B
B B B B B B B B B B
A1 A1 A1 A1 A1 A1
A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
4 4 3 2 1 0
P2 P2 P2 P2 P2 P2 P2 P2 P0 P0 P0 P0 P0 P0 P0 P0
ADDRESS .7 .6 .5 .4 .3 .2 .1 .0 .7 .6 .5 .4 .3 .2 .1 .0 PPI SELECTION AND
OF PPI G2 DATA TRANSFER
G1 A C B A A1 A0
N DONT
DONT CARE
CARE
DEC DEC SELECT PPI
SELECT PPI CS/ MODE
8063H
1 0 X X X X X X X 1 1 0 X X 1 1 CONTROL PORT
How to activate the latches that connects to 7-segment :
This routine is based on the polling technique , the polling technique is based
on checked the I/O port , if there is no input , then jump to check the I/Oport
again , until an input is occurred .
Output routine :
This routine will displays the output on six 7-segment chips . The block
diagram of the 7-segment chip used is shown in this figure :
Example :
The following two codes is
are examples of the 7-
segment :
E EQU 10000110b
A EQU 10010000b
The main routine for displaying the output will display one of the following :
“-ADDED”,”EDITED”,”DELETD”,”-PASS-”, “-FAIL-”,”-ERROR” and
“TINEDT”
Operation on user’s database :
Base Address + ( 4 x user counter ) = the address of the next empty location ;
Editing user’s
Editing a user information means changing his password .
There are two flags associated with editing user's code . this flags are :
• EDIT_FLAG1
• EDIT_FLAG2
The flag EDIT_FLAG1 is set to one if :
1. the user enters the administrator password correctly .
2. the user chooses "1" when "CHOOSE" message appears as an
output
Adjust time :
1. The user chooses 4 when “CHOOSE” massage appears as output .
2. This message “HH - - MM” is appear as output “
3. Enter the adjust time or real time .
show time :
1. The user chooses 5 when “CHOOSE” massage appears as output .
2. The real time is appear as output “
3. Press switch 3 allow to exit to normal operation..
Method of clocking :
Note :
• Here we using second method , because this method is less part of
board .
• Using real time programming or multitasking . (pipeline ),
Timing by using software :
Another unit of this project is to add real time in order to use
it and display it when user password is recognized and PASS is
displayed . this time is recorded with each entry in EEPROM ,
the administration can display all successful accesses with the
time of each access . In this actual project we will concentrate to
create a real time running with the following conditions:
After reset the time must be displayed the format “ HH-
MM” for correct time. When the password of user is
recognized, the time must be displayed for some seconds before
PASS is displayed to indicate access time. In the menu
CHOOSE if SW4 is pressed , the actual time will be displayed
for 2 sec and pass to setting time display.
When SW5 is pressed in the menu CHOOSE the time will be
continuously displayed for any change by administrator . The
SW3 (END) switch allow to exit to normal operation.
Time- base operation :
Time delay 10 ms
Counter 1msec
equal 100
Reset counter1
NO
Counter 2 1sec
equal 60
Reset counter2
NO Counter 3 1min
equal 60
Reset counter3
NO Counter 4 1hour
equal 24
Reset counter4
Number in binary
Conversion to BCD
MOV 77h,#26
MOV 76h,#205
This delay is gives approximate 10 m sec
TT1: DJNZ 76h,TT1
DJNZ 77h,TT1 Execution time of any instruction is equal
2usec
Calculation 1 m sec :
(26*205)*2 u sec+2 u sec + 2 u sec = 0.010664 u sec=10.664 m sec
Calculation 1 sec :
10.664 m sec * 100 = 1 sec
Calculation 1 min :
1 sec * 60 = 1 min
Calculation 1 hour :
1min * 60 = 1 hour
Percentage of Error :
10 m 10 m
sec sec
Ideal
-----------
Theory
Time
10 m 10 m
sec After code sec
Practice
50 code delay
delay instruction
Time
Call time_base
Call time_base
After code = 50*2usec = 100usec
140usec
= = 0.014
10msec
= 1.4 %
7- enter the code to be added then press enter , the massage “ADDED”
will be display .
11- enter the code to be deleted then press enter , the massage “DELETD”
will be appear .
12- press switch 4 the be make adjust time :
What is achieved ?
1. We built the circuit that operate the electric lock
using amplifier , relay and diode.
2. connect LED into board and write program to
operated .
3. Written software for timing clock .
4. Learning write language of microcontroller .
Conclusion :
What is not achieved and why ?
1. Keypad interface .
2. Download information into USB .
Problem :
1. one of great problem that I have faced is time
, this no enough time .
2. The previous project take along time so ,
didn‘t have enough time to absorb ,
understand and handle completely the
present project .
3. didn’t have softcopy of previous project .
References :