Alexandria University Faculty of Engineering Communications & Electronics Department.

Similar documents
Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

Microcontroller Intel [Instruction Set]

LCM12232A LCM12232A. 122 x 32 1/32D STN( EL / 100VAC 400HZ LED / 4.2VDC

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

8051 Overview and Instruction Set

Introduction To MCS-51

Digital Blocks Semiconductor IP

8051 Microcontroller

Digital Blocks Semiconductor IP

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

Digital Blocks Semiconductor IP

Application Brief D-005


Q. Classify the instruction set of 8051 and list out the instructions in each type.

Assembly Language programming (2)

Programming of 8085 microprocessor and 8051 micro controller Study material

Dodatak. Skup instrukcija

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Instruction Set Of 8051

8051 Microcontroller Assembly Programming

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

C H A P T E R 1 INTRODUCTION

8051 Programming using Assembly

SN8F5000 Family Instruction Set

Microcontroller and Embedded Systems:

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

TUTORIAL Assembly Language programming (2)

ELEG3924 Microprocessor

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:

Microcontroller. Instruction set of 8051

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

Chapter Family Microcontrollers Instruction Set

8051 Core Specification

Module Contents of the Module Hours COs

Principle and Interface Techniques of Microcontroller

C51 Family. Architectural Overview of the C51 Family. Summary

build_char macro P1,P2,P3,P4,P5,P6,P7,P8 ;Macro for building a custom character

Assembly Language programming (3)

Contents. Join the Technical Community Today!

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

FlashFlex51 Microcontroller Control of CompactFlash Card in TrueIDE Mode

ELEG3923 Microprocessor Ch.3 Jump, Loop, and Call

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen

Chapter 3. Bit Addressable Area. By DeccanRobots

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

To Produce a Bidirectional, Speed Regulated Moving Message Display by Using the SAB80515/SAB80535's Timer 2 & 8-Bit Converter

80C451 operation of port 6

Embedded Controller Programming

DR bit RISC Microcontroller. Instructions set details ver 3.10

8051 I/O and 8051 Interrupts

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

FACULTY OF ENGINEERING LAB SHEET

Application Brief D-002

LCDD Application Note

~: Simple Programs in 8051 assembly language :~

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

Lab-Report Microprocessors

MCS -51 Programmer s Guide and Instruction Set

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

INTEGRATED CIRCUITS. AN408 80C451 operation of port 6

CPEG300 Embedded System Design. Lecture 6 Interrupt System

Dragonchip. Instruction Set Manual

8051 Microcontrollers

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

Highlights. FP51 (FPGA based 1T 8051 core)


8051 Microcontroller. Ali Ziya Alkar 1

;~~~~~~~~~~~~ ;P4-6-1.ASM ~ ;~~~~~~~~~~~~ SYMBOLS RS REG P2.0 EN REG P2.1 PICK REG P3.0 RELAY0 REG P3.1 RELAY1 REG P3.6 RELAY2 REG P3.

NAME as31 - An Intel 8031/8051 assembler. SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm

Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports.

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

D: arc SRC KUT51 KUT51LCD.LST KUT51LCD PAGE 1

Report Title: Digital Voltmeter using 89C51

Chapter 6 Interrupts. (I. Scott Mackenzie) By: Masud-ul-Hasan

Advantages of Using a Dallas Semiconductor DS1232 MicroMonitor

Introduction to uc & Embedded Systems

ET2640 Microprocessors

LCD AND KEYBOARD INTERFACING

Three criteria in Choosing a Microcontroller

IS1U60 IS1U60L Recommended operating conditions. Unit

Hardware Setups for Communication with a DS1267

1. Write A Program to move a block of data within the internal RAM

S.J.P.N Trust's. Hirasugar Institute of Technology, Nidasoshi.

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000,

What Registers are available? Programming in Assembler. Assembler Programming - like early Basic. Assembler Data Movement Instructions

CONTENTS. 1.0 Introduction Description of the Circuit Installation Connection of Power Supply 4

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT- IV

Principle and Interface Techniques of Microcontroller

Chapter 09. Programming in Assembly

UNIT-III ASSEMBLY LANGUAGE PROGRAMMING. The CPU can access data in various ways, which are called addressing modes

1. Pin diagram of 8051 and ports

AL8051S 8-BIT MICROCONTROLLER Application Notes

CPEG300 Embedded System Design. Lecture 8 Timer


CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

Transcription:

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