Alexandria University Faculty of Engineering Communications & Electronics Department. TO : DR \ HOSSAM ELDIN MOSTAFA PRESENTED BY : 1. AHMED OSMAN HASSAN NEGM 24 2. AHMED MOHAMED IBRAHIM AHMED ABD ELWAHED 30 3. AHMED MOHAMED IBRAHIM IBRAHIM ALI SALMAN 29 4. AHMED MOHAMED MAHMOUD ABD EL KADER 39 5. AMIR MOHAMED FATHI 70 SEC (6)
2
Contents Safety information Safety information 4 Before you begin Features...5 Accessories.. 6 Controls and functions Keypad....7 LCD...8 Operation Operation...9 EEPROM Programmer EEPROM Programmer Schematic....10 Keypad Keypad Schematic..11 Keypad Datasheet...12 Access Control Access Control Schematic 14 Access Control Datasheet.....15 Access Control Program... 16 3
Safety information: - Be sure to read this user's manual before starting the operation of the access controller. Don t open the cover. It is dangerous to touch the inside of the circuit due to electric damage. Don t touch a power supply with wet hand. It may an electric shock. Place the access controller circuit in well ventilated and noheat environment. General information: - This manual provides complete instructions for work and use the access controller circuit. All functions of the circuit can carried out using the buttons on the keypad. The access controller circuit is easy and convenient to use. If you have any problems with the operation of your circuit, please refer to the relevant section of this manual or call your dealer. Any updates or enquiring checkout our web site www.navigator.4mg.com 4
Features: - LCD display with (16*1). Keypad with brightness keys. Small size circuit. Power supply 5
Accessories: - User manual. Keypad. Power supply. Adaptor. LCD display Keypad 6
Operation: - The controller system is used to allow some of persons to enter place or use machine board and provide any unknown persons to use this features of any of them. 1. LCD display (HELLO) at any time. 2. Touch any key LCD will display (press 1 for ENG). 3. You will see three statements rotate (press 1 for ENG) then (press 2 for TECH) then (press 3 for mang). 4. If you will not choose 1, 2 or 3 the statement will rotate three times before (HELLO) return on LCD. 7
5. If you choose 1,2 or 3 the LCD display (enter password: ); 6. Enter your password, which content 7 digits. 7. If you don t complete the password the LCD return to (HELLO) in 41 seconds. 8. If your password right the LCD display (WELCOME ENG) if you are engineer. 9. The green lamp will light. 10. If your password wrongs the LCD display (INVALID PASSWORD). 8
11. The red lamp will light. 12. If you enter your password three times the system will shut down and will not be able to access. 13. The red lamp will light red and not shutdown. 14. Reset the system 9
10
11
74148 (8 to 3 Priority Encoder): This TTL encoder features priority decoding of the inputs to ensure that only the highest-order data line is encoded. It encodes eight data lines to three-line (4-2-1) binary octal (8 lines to 3-line priority). 74148 Diagram: : Encoder Truth Table: Inputs Outputs EI 0 1 2 3 4 5 6 7 A2 A1 A0 EO GS 1 X X X X X X X X 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 X X X X X X X 0 0 0 0 0 1 0 X X X X X X 0 1 0 0 1 0 1 0 X X X X X 0 1 1 0 1 0 0 1 0 X X X X 0 1 1 1 0 1 1 0 1 0 X X X 0 1 1 1 1 1 0 0 0 1 0 X X 0 1 1 1 1 1 1 0 1 0 1 0 X 0 1 1 1 1 1 1 1 1 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 12
74LS00 (4 2 Input NAND): This device contains four independent 2-input NAND gates. Logic function: Y = AB 74LS00 Diagram: NAND Truth Table: A B Y 0 0 0 1 0 0 0 1 0 1 1 1 13
14
15 2864 10 9 8 7 6 5 4 3 25 24 21 23 2 11 12 13 15 16 17 18 19 28 14 20 22 27 A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 D0 D1 D2 D3 D4 D5 D6 D7 VCC GND CE OE WE ICs Numbers: IC Number Number of ICs. 8052 1 2864 1 74LS00 1 74573 1 74148 2 Push Button 13 1KΩ 16 10KΩ 1 33pF 2 4.7µF 1 Crystal 12MHz 1 LCD 16*1 1 ICs Configuration: 74HC573 2 3 4 5 6 7 8 9 11 1 19 18 17 16 15 14 13 12 10 20 D0 D1 D2 D3 D4 D5 D6 D7 LE OE Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 GND VCC 74148 10 11 12 13 1 2 3 4 5 9 7 6 14 15 16 8 D0 D1 D2 D3 D4 D5 D6 D7 EI Q0 Q1 Q2 GS EO VCC GND 8051 29 30 40 20 31 19 18 9 39 38 37 36 35 34 33 32 1 2 3 4 5 6 7 8 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 PSEN ALE VCC GND EA X1 X2 RST P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 P3.0/RXD P3.1/TXD P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P3.6/WR P3.7/RD
;MICRO CONTROLLER PROJECT LCD_DATA_4 bit P1.4 LCD_DATA_5 bit P1.5 LCD_DATA_6 bit P1.6 LCD_DATA_7 bit P1.7 LCD_RS BIT P1.2 LCD_EN BIT P1.3 key_pad_0 bit P3.0 key_pad_1 bit P3.1 key_pad_2 bit P3.2 key_pad_3 bit P3.3 CODE_TABLE: ORG 0H ;LOCATE ROUTINE AT 00H LJMP start ;JUMP TO START ORG ORG ORG ORG 0a00H 3H 3H 3H 3H 3H 3H 3H 0a10H 01H 01H 01H 01H 01H 01H 01H 0a20H 02H 02H 02H 02H 02H 02H 02H 100H ;MAIN PROGRAM STARTS HERE start: 16
mov sp, #2FH mov p1,#20h clr lcd_rs setb lcd_en lcall aaa clr lcd_en lcall aaa lcall delay2 mov a, #28h lcall send_command mov a, #0ch lcall send_command mov a, #02h lcall send_command MOV R6,#03H SETB key_pad_0 SETB key_pad_1 SETB key_pad_2 SETB key_pad_3 START1: hh: SETB p1.0 SETB p1.1 LCALL CLR_LCD mov r1,#5h lcall space djnz r1,hh mov a, #'H' mov a, #'E' mov a, #'L' lcall scnd_lcd MOV A, #'L' mov a, #'O' LCALL READ_PAD mov r0,#3d AGAIN: MOV R5,#'1' LCALL PRESS LCALL ENG lcall INPUT_PAD 17
MOV R5,#'2' LCALL PRESS LCALL TECH lcall INPUT_PAD MOV R5,#'3' LCALL PRESS LCALL MANG lcall INPUT_PAD aa: djnz r0, AGAIN sjmp START1 lcall CLR_LCD LCALL PASSWORD mov a ':'# mov r0,#7h mov r1, #8fh INPUT: LCALL READ_PAD mov @r1,a cjne a,#0bh,input2 jmp aa input2: MOV A '*'# LCALL send_data inc r1 dec r0 MOV A,R0 jnz input lcall SCND_LCD lcall CLR_LCD compare: comp1: mov r0, #95h mov r1, #6h mov a,r1 MOVC A,@A+DPTR XRL A,@R0 JNZ GET_OUT DEC R1 MOV A,R1 DEC R0 JZ WELCOME JMP COMP1 18
WELCOME: clr p1.0 MOV R6,#03H mov a, #'W' mov a, #'E' mov a, #'l' mov a, #'C' mov a, #'O' mov a, #'M' mov a, #'E' LCALL SPACE TEST: TEST1: TEST2: TEST3: lcall SCND_LCD MOV A,0EH cjne a,#01,test1 LCALL ENG cjne a,#02,test2 LCALL TECH cjne a,#03,test3 LCALL MANG LCALL DELAY1 LJMP START1 GET_OUT: clr p1.1 mov a, #'I' mov a, #'N' mov a, #'V' mov a, #'A' mov a, #'L' mov a, #'I' mov a, #'D' LCALL SPACE lcall SCND_LCD LCALL PASSWORD LCALL DELAY1 19
DEC R6 MOV A,R6 JZ SECURITY LJMP START1 SECURITY: mov a, #08h lcall send_command JMP SECURITY READ_PAD: MOV TMOD,#10H MOV TL1,#00H ;DELAY CHANGING VALUE FFFF MOV TH1,#00H ;- TH1 TL1 SETB TR1 clr tf1 mov r2,#0ffh READ_PAD1: MOV A, #00H MOV R4,#0A0H DLY5: MOV R5,#0FFH DLY6: MOV A, P3 NOP DJNZ R5,DLY6 DJNZ R4,DLY5 ANL A, #0FH jnz bb DJNZ R2,read_pad1 JB TF1,ST JZ READ_PAD1 bb: ST: CLR TF1 LJMP START1 ret INPUT_PAD: MOV R5, #10H DLY4: MOV R2,#0FFH LCALL DLY1 MOV A, #00H MOV A, P3 ANL A, #0fH JNZ CHECK DJNZ R5,DLY4 check: check1: cjne a,#01h,check1 MOV DPTR, #0a00H MOV 0EH,A ljmp aa cjne a,#02h,check2 MOV DPTR, #0a10H MOV 0EH,A ljmp aa 20
check2: check3: cjne a,#03h,check3 MOV DPTR, #0a20H MOV 0EH,A ljmp aa ret PASSWORD: mov a, #'P' mov a, #'A' mov a, #'S' mov a, #'S' mov a, #'W' mov a, #'O' mov a, #'R' mov a, #'D' lcall SCND_LCD PRESS: LCALL CLR_LCD mov a, #'P' mov a, #'R' mov a, #'E' mov a, #'S' mov a, #'S' LCALL SPACE MOV A,R5 LCALL SEND_DATA LCALL SPACE lcall SCND_LCD mov a, #'F' mov a, #'O' mov a, #'R' LCALL SPACE 21
ENG: TECH: MANG: CLR_LCD: mov a, #'E' mov a, #'N' mov a, #'G' mov a, #'T' mov a, #'E' mov a, #'C' mov a, #'H' mov a, #'M' mov a, #'A' mov a, #'N' mov a, #'G' MOV A,#01H LCALL SEND_COMMAND SCND_LCD: SPACE: mov a, #0C0h lcall send_command mov a' '# send_command: lcall DELAY2 lcall lcd_data clr LCD_RS setb LCD_EN clr LCD_EN swap a 22
lcall DELAY2 lcall lcd_data clr LCD_RS setb LCD_EN clr LCD_EN ret send_data: lcall DELAY2 lcall lcd_data setb LCD_RS setb LCD_EN clr LCD_EN swap a lcall DELAY2 lcall lcd_data setb LCD_RS setb LCD_EN clr LCD_EN ret lcd_data: clr c mov 20h,a mov c,4h mov LCD_DATA_4, c mov c,5h mov LCD_DATA_5, c mov c,6h mov LCD_DATA_6, c mov c,7h mov LCD_DATA_7, c ret DELAY2: MOV R2,#09d LCALL DLY1 aaa: mov r0, #47h aaaa: djnz r0,aaaa ret DELAY: MOV R2,#02d LCALL DLY1 DELAY1: MOV R5, #07H DLY3: MOV R2,#0FFH LCALL DLY1 DJNZ R5,DLY3 DLY1: DLY2: MOV R3,#0FFH NOP 23
NOP DJNZ R3,DLY2 DJNZ R2,DLY1 END ;END PROGRAM ; **************************************************************** ************* 24