EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 9 Simple I/O Interfacing

Size: px
Start display at page:

Download "EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 9 Simple I/O Interfacing"

Transcription

1 Department of Electrical Engineering Lecture 9 Simple I/O Interfacing Week 10 1

2 In this Lecture. Interface 8051 with the following Input/Output Devices Switches Solenoid and relays LEDs Seven Segment Display Dot matrix display 2

3 Introduction The 8051 microcontroller is commonly used for real-world applications, e.g. display control, lighting control, machine control, etc. Various input and output devices are connected to the I/O ports of the microcontroller to deal with different applications. We will introduce some common I/O devices for simple application in this lecture. They are: Mechanical switches Electromagnetic relays Solid-state relays LEDs 7-segment Display Dot Matrix Display 3

4 Mechanical Switches Mechanical switches are common input devices One or more pairs of contacts that can be open or close. Typical switch designations are: SPST (single-pole-single-throw) SPDT (single-pole-double-throw) N.O. SPST N.O. DPST DPDT (double-pole-double-throw) N.O. DPST Normally open (N.O.) contacts close when the switch is activated and normally close (N.C.) contacts close when the switch is activated. 4

5 Connect mechanical switches to 8051 Reset EA V CC XTAL1 XTAL V SS P3.7 P3.6 P3.5 P3.4 SW opens, input to 8051 is HIGH (1) SW closes, input to 8051 is LOW (0) +5V Figure 9.1 SW1 SW2 SW3 SW4 ORG 0000H : JNB P3.7, CASE1 JNB P3.6, CASE2 JNB P3.5, CASE3 JNB P3.4, CASE4 : CASE1: : Check the : status of SW1 : CASE2: : : CASE3: : : CASE4: : : 5

6 Electromagnetic Relays EEE3410 Microcontroller Applications Electromagnetic relay consists of two parts - solenoid and relay contacts Solenoid is a coil of wire used to produce a magnetic field to move a steel actuator where points of contacts are located. The actuator is used to close/open the contact points, such construction is called a relay. Figure 9.2 construction of a Electromagnetic relay 6

7 Driving an Electromagnetic Relays EEE3410 Microcontroller Applications Figure 9.3 show a typical driving circuit of an electromagnetic relay. The transistor will act as a switch to allow current passing through the solenoid. The diode placed across the coil terminal is to protect the transistor damaged from spike voltage during ON/OFF. The external circuit connected to relay terminals will be turned ON/OFF by the TTL. Contact closed if TTL = High Contact opened if TTL = Low TTL +5V Vs Figure 9.3 Driving circuit of an electromagnetic relay 7

8 Solid State Relays/Switches Solid-state relays has no mechanical parts and made of semiconductor materials It combines the isolation, driving, and contact closure functions into a single package It is commonly use to control ac loads Relay closed if input = High Relay opened if input = Low Input Control + SSR T1 T2 a.c. power supply Figure 9.4 Driving a solid state relay 8

9 Light-Emitting Diode (LED) Light-emitting diodes (LEDs) can be turned on when a current passes through it. Figure 9.5 Shows a typical TTL circuit driving a LED The 330Ω resistor is used to limit the amount of current to pass through the LED to prevent it burning off. The TTL output is LOW, the LED will ON The TTL output is HIGH, the LED will OFF +5V 330Ω TTL Figure 9.5 9

10 Control of LEDs +5V EA V CC Reset P1.7 P1.6 8 LEDs are connected to Port 1 and linked to 5V supply 8051 P1.5 P1.4 The LEDs can directly be turned ON/OFF by the 8051 XTAL1 XTAL2 V SS P1.3 P1.2 P1.1 P1.0 Figure 9.6 Under this connection, the LEDs will be OFF when port bit is at logic 1 ON when port bit is at logic 0 10

11 Example 9.1 : Control the 8 LEDs ON/OFF at the same time All LEDs ON All LEDs OFF 11

12 Program Listing for Example 9.1 Start Set A = 00 Move the content of A to P1 Delay for 0.1s Invert the content of A ORG 0000H CLR A LOOP: MOV P1, A CPL A ACALL DELAY AJMP LOOP DELAY: MOV R6, #250 DL1: MOV R7, #200 DL2: DJNZ R7, DL2 DJNZ R6, DL1 RET END Assume 12MHz clock, determine the delay time. 12

13 Example 9.2 : Glowing a LED in rotating sequence ORG 0000H START: MOV R1, #07H MOV A, # B LEFT: MOV P1, A ACALL DELAY RL A DJNZ R1, LEFT ; MOV R1, #07H MOV A, # B RIGHT: MOV P1, A ACALL DELAY RR A DJNZ R1, RIGHT AJMP START ; DELAY:. 13

14 Example 9.3: Turning LEDs ON/OFF in a preset sequence by using a Look-up Table 14

15 Program Listing of Example 9.3 ORG 0000H START: MOV R0, #OK DATA+1 MOV DPTR, #DATA MOV R1, #00H LOOP: MOV A, R1 MOVC MOV P1, A ACALL DELAY INC R1 DJNZ R0, LOOP AJMP START ; DELAY: MOV R5, #2 DL1: MOV R6, #250 DL2: MOV R7, #200 DL3: DJNZ R7, DL3 DJNZ R6, DL2 DJNZ R5, DL1 RET ; DATA: DB B DB B DB B DB B DB B DB B DB B DB B ; DB B DB B DB B DB B DB B DB B DB B DB B ; DB B DB B DB B OK: DB B END 15

16 Exercise: Write a 8051 program, using a look-up table, to light-up the LEDs in the sequence as shown below 16

17 Simple I/O applications +5V EA V CC Reset XTAL P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0 Figure 9.7 XTAL2 P3.7 P3.6 P3.5 P3.4 SW1 SW2 SW3 SW4 V SS 17

18 Example 9.4: Refer to the 8051 circuit in figure 9.5, write a 8051 program to light-up the LEDs in the pattern as shown below when the respect switch is closed. When SW1 Closed When SW2 Closed When SW3 Closed When SW4 Closed Priority: SW1 SW2 SW3 SW4 18

19 Flow Chart of Example Start SW1 closed? Y SW1 Handler 1 Initialization 2 N SW2 closed? Y SW2 Handler Set P3 as input port N SW3closed? Y SW3 Handler Read SW1 SW4 status N SW4 closed? Y SW4 Handler 1 19

20 Program Listing of Example 9.4 ORG 0000H MOV R1, # B MOV R2, # B MOV R3, # B MOV R4, # B ; TEST: ORL P3, #0FFH JNB P3.7, CASE1 JNB P3.6, CASE2 JNB P3.5, CASE3 JNB P3.4, CASE4 AJMP TEST ; CASE1: MOV A, R1 MOV P1, A ACALL DELAY XRL A, # B MOV P1, A AJMP TEST ; CASE2 MOV A, R2 MOV P1, A ACALL DELAY XRL A, # B MOV P1, A AJMP TEST ; CASE3 MOV A, R3 MOV P1, A ACALL DELAY XRL A, # B MOV P1, A AJMP TEST ; CASE4 MOV A, R4 MOV P1, A ACALL DELAY XRL A, # B MOV P1, A AJMP TEST ; DELAY:.. END 20

21 7-Segment LED Numeric Display A single-character display panel Contains 7 LED segments arranged as an 8 Two configurations: common-anode and common-cathode a f e g d b c Dp Segment Pattern 21

22 7-Segment LED Numeric Display Common-anode configuration Common a b c d e f g Dp Common-cathode configuration Common a b c d e f g Dp 22

23 7-Segment LED Numeric Display Segment displays are driven by connecting each segment to a port bit, or they can be driven by decoder/driver IC Output Port bit Display segment Dp g f e d c b a Normally the LED should be connected to the power via resistors to protect them from burning When using common-cathode configuration, a segment will be lit only if the lead of the segment connected with a High voltage and the common cathode lead with Low voltage 23

24 7-Segment LED Numeric Display EEE3410 Microcontroller Applications XTAL1 XTAL P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 Vcc a b a c d f b g e f e c g Dp d Dp.. Figure 9.8 Use R3 as counter, write a 8051 assembly language program using look-up table method, to display the value in R3 to a 7-segment display 24

25 Program Listing ORG 0000H MOV R3, #00H LOOP: MOV DPTR, #TABLE MOV A, R3 MOVC ; ; Display numbers on 7-segment display MOV P1, A ACALL DELAY ; ; Increase R3 by 1 and loop back MOV A, R3 ADD A, #1 DA A ANL A, #0FH MOV R3, A AJMP LOOP ; DELAY:.. TABLE: DB B ; 0 DB B ; 1 DB B ; 2 DB B ; 3 DB B ; 4 DB B ; 5 DB B ; 6 DB B ; 7 DB B ; 8 DB B ; 9 ; END 25

26 Dot-matrix LED Display Consists of a number of LED arranged in the form of a matrix e.g. 35 LED in a 5 columns x 7 rows matrix, or 64 LED in a 8 x 8 matrix a b c d e f g To display a digit/character, use the method of scanning i.e. scan a column at a time. If the scanning is fast enough, it appears that the digit/character is displayed (due to illusion of our eyes) 26

27 Dot-matrix LED Display Internal circuitry of a 5 x 7 dot matrix display is shown on the right Voltage should be supplied to terminals C and 1 to light up the LED indicated in this picture a b c d e f g

28 Dot-matrix LED Display EA Reset 8051 XTAL1 XTAL2 Vcc V SS P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P1.0 P1.1 P1.2 P1.3 P a b c d e f g 28

29 Dot-matrix LED Display EEE3410 Microcontroller Applications Example: Displaying the character E on the dot-matrix. a b c d e fg a b c d e fg a b c d e fg a b c d e fg isplaying the character E on the 5x7dot-matrix Step 1: signals on pins pins pins gfedcba Step 2: signals on pins pins pins gfedcba Step 3: signals on pins pins pins gfedcba a b c d e fg a b c d e fg Step 4: signals on pins pins pins gfedcba

30 Code Words and Displays of 0 to B B B B B B B B B B B B B B B B B B B B B B B B B 30

31 Code Words and Displays of 5 to B B B B B B B B B B B B B B B B B B B B B B B B B 31

32 Program Listing character display on 5x7 Dot-matrix display (1/2) ORG 0000H START: MOV DPTR, #TABLE ; point to the starting add of 1 st char MOV R3, #10 ; display 10 characters LOOP: MOV R2, #100 ; scan 100 times for each character SCAN: ACALL SACN1 ; 10ms x 100 = 1000ms DJNZ R2, SCAN INC DPTR ; increase DPTR by 5 to INC DPTR ; point to the starting address of INC DPTR ; the next character INC DPTR INC DPTR DJNZ R3, LOOP ; loop back to display 10 char AJMP START ; ====================== ; == Scan Subroutine == ; ====================== SCAN1 MOV R1, #00H ; R1 points to the starting add of a char MOV R5, # B ; start from the leftmost column MOV R4, #05 ; there are 5 columns LOOP1 MOV A, R1 ; get the code at add R1+DPTR MOVC MOV P3, A ; send the code to the dot-matrix display MOV P1, R5 ; turn-on a particular transistor 32

33 Program Listing character display on 5x7 Dot-matrix display (2/2) MOV R6, #5 ; delay for 2ms DL1: MOV R7, #200 DL2: DJNZ R7, DL2 DJNZ R6, DL1 ORL P1, # B ; turn-off display MOV A, R5 ; RL A ; move to next column MOV R5, A ; totally there are 5 columns INC R1 ; DJNZ R4, LOOP1 ; RET ; return the main program ; ============================ ; == Character Table == ; ============================ TABLE: DB B ; codes for 0 DB B DB B DB B DB B DB B ; code for 1 : ; codes for 2 to 9 : ; END 33

34 Department of Electrical Engineering END of Lecture 9 Simple I/O Interfacing Week 10 1

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

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

Assembly Language programming (2)

Assembly Language programming (2) EEE3410 Microcontroller Applications LABORATORY Experiment 2 Assembly Language programming (2) Name Class Date Class No. Marks Arithmetic, Logic and Jump instructions Objectives To learn and practice the

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

More information

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

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas 8051 I/O and 8255 Class 6 EE4380 Spring 03 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Why I/O Ports Controllers need to get external inputs and produce

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller EE4380 Fall 2001 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Architecture Programmer s View Register Set Instruction Set Memory

More information

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

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

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

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution: Assignment 2 1. Assume that 5 binary data items are stored in RAM locations starting at 50h, as shown below. Write a program to find the sum of all the numbers. The calculation is in 16-bit format and

More information

INTERFACING 16 2 LCD WITH 8051

INTERFACING 16 2 LCD WITH 8051 INTERFACING 16 2 LCD WITH 8051 LCD display is an inevitable part in almost all embedded projects and this article is about interfacing 16 2 LCD with 8051 microcontroller. Many guys find it hard to interface

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP 805 Microcontroller General Description The Digital Blocks Microcontroller Verilog IP Core is complaint with the MCS 5 Instruction Set and contains standard 805 MCU peripherals,

More information

Assembly Language programming (3)

Assembly Language programming (3) EEE3410 Microcontroller Applications LABORATORY Experiment 3 Assembly Language programming (3) Name Class Date Class No. Marks Conditional Program Branching and Subroutine Call in 8051 Objectives To learn

More information

CHAPTER 1.0: INTRODUCTION TO AUTOMATION SYSTEM

CHAPTER 1.0: INTRODUCTION TO AUTOMATION SYSTEM CHAPTER 1.0: INTRODUCTION TO AUTOMATION SYSTEM 1.1. Introduce types of automation in industry 1.1.1 Definition of automation system. Is a technology dealing with the application of mechatronics and computers

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP DB805C-FSM 805 Microcontroller FSM Finite State Machine General Description The Digital Blocks DB805C-FSM IP Core contains Digital Blocks compact DB805C CPU Core & GPIO

More information

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

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MICROCONTROLLERS AND APPLICATIONS 1 Module 2 Module-2 Contents: Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MEMORY

More information

TOPIC 6 LATCH. FIGURE 1 INTERFACING OF ROM/EPROM TO µc 8051.

TOPIC 6 LATCH. FIGURE 1 INTERFACING OF ROM/EPROM TO µc 8051. TOPIC 6 MEMORY AND I/O INTERFACING MEMORY INTERFACING i. External ROM (program memory) Interfacing P1 P0 D 0-D 7 P3 EA clock LATCH A 0 ROM/ A 7 EPROM A 8 Address lines A 15 PSEN OE FIGURE 1 INTERFACING

More information

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

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458 ET2640 Unit 5:ADVANCED I/O TECHNIQUES skong@itt-tech.edu HARDWARE CONNECTION CHAPTER 8 8051 PINOUT XTAL1 & XTAL2 On-chip oscillator requires an external clock Quartz crystal clock 2 external 30 pf capacitors

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

Application Brief D-005

Application Brief D-005 Interfacing the Avago HDSP-2xxx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-005 Introduction The HDSP-21xx/-25xx series of products is ideal for applications where

More information

FACULTY OF ENGINEERING LAB SHEET

FACULTY OF ENGINEERING LAB SHEET FACULTY OF ENGINEERING LAB SHEET MICROCONTROLLER AND MICROPROCESSOR SYSTEMS ECE2216 TRIMESTER 1 (2017/2018) MP2: Construction and programming of a basic electronic piano *Note: On-the-spot evaluation may

More information

SN8F5000 Family Instruction Set

SN8F5000 Family Instruction Set SONiX Technology Co., Ltd. 8051-based Microcontroller 1 Overview SN8F5000 is 8051 Flash Type microcontroller supports comprehensive assembly instructions and which are fully compatible with standard 8051.

More information

Embedded Controller Programming

Embedded Controller Programming Embedded Controller Programming Counters, Timers and I/O in Assembly Language Ken Arnold Copyright 2000-2004 Ken Arnold 1 Outline Timer/Counters Serial Port More 8051 Instructions Examples Copyright 2000-2004

More information

If I wanted to connect an LED and little light bulb and have them switch on and off with one switch, my schematic would look like the one below.

If I wanted to connect an LED and little light bulb and have them switch on and off with one switch, my schematic would look like the one below. Relays Relays are great tools for turning on and off entire circuits, either with a small control switch, or with a microcontroller like the Arduino. To understand how relays are useful and how to control

More information

Module Contents of the Module Hours COs

Module Contents of the Module Hours COs Microcontrollers (EE45): Syllabus: Module Contents of the Module Hours COs 1 8051 MICROCONTROLLER ARCHITECTURE: Introduction to Microprocessors and Microcontrollers, the 8051 Architecture, 08 1 and pin

More information

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM The present concept implements controlling of pump which pumps water from the sump (underground tank) to the overhead tank, using 8951 microcontroller.

More information

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

Contents 8051 Instruction Set BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter I : Control Transfer Instructions Lesson (a): Loop Lesson (b): Jump (i) Conditional Lesson (c): Lesson (d): Lesson (e):

More information

Applications of 8051 Microcontrollers

Applications of 8051 Microcontrollers Applications of 8051 Microcontrollers INTRODUCTION: A microcontroller is a versatile chip which can be used in various fields starting from simple consumer electronics, measuring devices to high end medical,

More information

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices CPEG300 Embedded System Design Lecture 0 805 Interface with Peripheral Devices Hamad Bin Khalifa University, Spring 208 Typical Devices for an Electronics System Power generation PWM control Input devices

More information

Experiment# 8: Photo-Interrupter Control

Experiment# 8: Photo-Interrupter Control Experiment# 8: Photo-Interrupter Control I. Objective 1. Study the schematic diagram of photo interrupter (PH1, and PH2) and the pulse generator circuit. 2. To demonstrate the control applications of photo-interrupter,

More information

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1 SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1 Subject: Microcontroller and Interfacing (151001) Class: B.E.Sem V (EC-I & II) Q-1 Explain RISC

More information

TUTORIAL Assembly Language programming (2)

TUTORIAL Assembly Language programming (2) 8051 Assembly Language programming (2) TUTORIAL 4 EEE3410 Microcontroller Applications 1. Write the instructions to move value 34h into register A and value 3Fh into register B, then add them together.

More information

8051 Interfacing and Applications Microcontroller

8051 Interfacing and Applications Microcontroller 8051 Interfacing and Applications Objectives: At the end of this chapter, we will be able to: List the different devices that can be interfaced with 8051 Understand the working principle. Develop the following

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

More information

Report Title: Digital Voltmeter using 89C51

Report Title: Digital Voltmeter using 89C51 VIVEKANAND EDUCATION SOCIETY'S INSTITUTE OF TECHNOLOGY Approved by AICTE & Affiliated to Mumbai University ELECTRONIC WORKSHOP - 2 REPORT Report Title: Digital Voltmeter using 89C51 PROJECT MEMBERS: 1.

More information

~: Simple Programs in 8051 assembly language :~

~: Simple Programs in 8051 assembly language :~ ~: Simple Programs in 8051 assembly language :~ Here some simple programs of 8051 are given to understand the operation of different instructions and to understand the logic behind particular program.

More information

Exercise 2. Switches EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Introduction to switches. Switch types

Exercise 2. Switches EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. Introduction to switches. Switch types Exercise 2 Switches EXERCISE OBJECTIVE When you have completed this exercise, you will be familiar with the operation of switches. You will be introduced to the various types of switches and to the various

More information

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote Programming Book1 8051 Microcontroller Kit Rev 3.0 January, 016 016 Wichit Sirichote 1 Contents Overview...3 SAFTY INFORMATION...3 Tools...3 Experiment 1 Blinking LED...4 Experiment Binary number counting...9

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

Memory & Simple I/O Interfacing

Memory & Simple I/O Interfacing Chapter 10 Memory & Simple I/O Interfacing Expected Outcomes Explain the importance of tri-state devices in microprocessor system Distinguish basic type of semiconductor memory and their applications Relate

More information

Chapter 9. Input/Output (I/O) Ports and Interfacing. Updated: 3/13/12

Chapter 9. Input/Output (I/O) Ports and Interfacing. Updated: 3/13/12 Chapter 9 Input/Output (I/O) Ports and Interfacing Updated: 3/13/12 Basic Concepts in I/O Interfacing and PIC18 I/O Ports (1 of 2) I/O devices (or peripherals) such as LEDs and keyboards are essential

More information

UNIT 9: RELAYS WHAT IS A RELAY (PRINCIPLE OF OPERATION)?

UNIT 9: RELAYS WHAT IS A RELAY (PRINCIPLE OF OPERATION)? UNIT 9: RELAYS AIMS Purpose of this unit is to grasp the concept of a relay; we will examine their basic types, their principle of operation, and we will take a brief introduction on their usage with the

More information

Microcontroller and Embedded Systems:

Microcontroller and Embedded Systems: Microcontroller and Embedded Systems: Branches: 1. Electronics & Telecommunication Engineering 2. Electrical & Electronics Engineering Semester: 6 th Semester / 7 th Semester 1. Explain the differences

More information

1. Pin diagram of 8051 and ports

1. Pin diagram of 8051 and ports e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Programming parallel ports Module No: CS/ES/9 Quadrant 1 e-text In this lecture pin diagram of 8051 controller will be shown and

More information

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics

ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.6 Arithmetic and Logics Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Arithmetic instructions Signed number operations Logic

More information

Introduction To MCS-51

Introduction To MCS-51 Introduction To MCS-51 By Charoen Vongchumyen Department of Computer Engineering Faculty of Engineering KMITLadkrabang 8051 Hardware Basic Content Overview Architechture Memory map Register Interrupt Timer/Counter

More information

Highlights. FP51 (FPGA based 1T 8051 core)

Highlights. FP51 (FPGA based 1T 8051 core) Copyright 2017 PulseRain Technology, LLC. FP51 (FPGA based 1T 8051 core) 10555 Scripps Trl, San Diego, CA 92131 858-877-3485 858-408-9550 http://www.pulserain.com Highlights 1T 8051 Core Intel MCS-51 Compatible

More information

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR 159.233 COMPUTER SYSTEMS Semester One June 2008 Time allowed: THREE (3) hours This exam contains THREE (3) questions ANSWER ALL THREE (3) QUESTIONS

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2014 Chapter

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

8051 Microcontroller Assembly Programming

8051 Microcontroller Assembly Programming 8051 Microcontroller Assembly Programming EE4380 Fall 2002 Class 3 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Machine code 8051 Addressing Modes

More information

VALLIAMMAI ENGINEERING COLLEGE S.R.M. NAGAR, KATTANKULATHUR-603203. DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING VII-EEE EE6502- MICROPROCESSORS AND MICROCONTROLLERS QUESTION BANK UNIT I 1. What

More information

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices. Code No: R05320202 Set No. 1 1. (a) Discuss the minimum mode memory control signals of 8086? (b) Explain the write cycle operation of the microprocessor with a neat timing diagram in maximum mode. [8+8]

More information

Lab-Report Microprocessors

Lab-Report Microprocessors Lab-Report Microprocessors Digital Voltage Meter (DVM) NO YES Name: Dirk Becker Course: BEng 2 Group: A Student No.: 9801351 Date: 05/May/1999 1. Contents 1. CONTENTS... 2 2. INTRODUCTION... 3 3. THE PROJECT...

More information

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

Q. Classify the instruction set of 8051 and list out the instructions in each type. INTRODUCTION Here is a list of the operands and their meanings: A - accumulator; Rn - is one of working registers (R0-R7) in the currently active RAM memory bank; Direct - is any 8-bit address register

More information

ELEG3923 Microprocessor Ch.9 Timer Programming

ELEG3923 Microprocessor Ch.9 Timer Programming Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.9 Timer Programming Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Programming 8051 Timers Counter programming Timer programming

More information

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

ET2640 Microprocessors

ET2640 Microprocessors ET2640 Microprocessors Unit -2 Processor Programming Concepts Basic Control Instructor : Stan Kong Email : skong@itt-tech.edu Figure 2 4 Bits of the PSW Register 8051 REGISTER BANKS AND STACK 80 BYTES

More information

Chapter 3. Bit Addressable Area. By DeccanRobots

Chapter 3. Bit Addressable Area. By DeccanRobots Chapter 3 Bit Addressable Area By DeccanRobots What is Bit Addressable Area? FFh 2Fh 20h 00h Data Memory General purpose Memory Area Bit Addressable Memory Registers Memory Area from 20H to 2FH is Bit

More information

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

NAME as31 - An Intel 8031/8051 assembler. SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm NAME as31 - An Intel 8031/8051 assembler SYNOPSIS as31 [-h] [-l] [-s] [-v] [-Aarg] [-Ffmt] [-Ofile] infile.asm DESCRIPTION As31 assembles infile.asm into one of several different output formats. The output

More information

8051 Programming using Assembly

8051 Programming using Assembly 8051 Programming using Assembly The Instruction Addressing Modes dest,source ; dest = source A,#72H ;A=72H A, # r ;A= r OR 72H R4,#62H ;R4=62H B,0F9H ;B=the content of F9 th byte of RAM DPTR,#7634H DPL,#34H

More information

Timer-1 can be run using the internal clock, fosc/12 (timer mode) or from any external source via pin T1 (P3.5) (Counter mode).

Timer-1 can be run using the internal clock, fosc/12 (timer mode) or from any external source via pin T1 (P3.5) (Counter mode). EC 6504 MICROPROCESSOR AND MICROCONTROLLER Electronics and Communication Engineering Fifth Semester UNIT-V Part A 1. List the modes of Timer in 8051. [N/D16] The timers available in 8051 are Timer 0 (T0)

More information

DR bit RISC Microcontroller. Instructions set details ver 3.10

DR bit RISC Microcontroller. Instructions set details ver 3.10 DR80390 8-bit RISC Microcontroller Instructions set details ver 3.10 DR80390 Instructions set details - 2 - Contents 1. Overview 7 1.1. Document structure. 7 2. Instructions set brief 7 2.1. Instruction

More information

LCD AND KEYBOARD INTERFACING

LCD AND KEYBOARD INTERFACING LCD AND KEYBOARD The 8051 Microcontroller and Embedded Systems: Using Assembly and C Mazidi, Mazidi and McKinlay Chung-Ping Young 楊中平 Home Automation, Networking, and Entertainment Lab Dept. of Computer

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 15, 2016 8051 INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS 8051 INSTRUCTIONS Repeating a sequence of instructions

More information

MICROPROCESSOR LABORATORY MANUAL

MICROPROCESSOR LABORATORY MANUAL MICROPROCESSOR LABORATORY MANUAL T.C. AYDIN ADNAN MENDERES UNIVERSITY ENGINEERING FACULTY ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT Prepared by: Res. Asst. Abdullah GÜLDEREN Aydın 2019 Contents 1.

More information

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code:

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code: MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code: I m p o r t a n t I n s t r u c t i o n s t o e x a m i n e r s : 1) The answers should be examined by key

More information

JUMP, LOOP AND CALL INSTRUCTIONS

JUMP, LOOP AND CALL INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS After you have understood the tutorial on Introduction to assembly language which includes simple instruction sets like input/output operations, now it s time to learn

More information

Chapter Family Microcontrollers Instruction Set

Chapter Family Microcontrollers Instruction Set Chapter 4 8051 Family Microcontrollers Instruction Set Lesson 5 Program Flow Control and Interrupt Flow Control Instructions 2 Branch instructions- Jump to new value of Program Counter (PC) LJMP address16

More information

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO. ADD A,Rn Add register to 28..2F 1 12 X X X accumulator ADD A,direct Add direct byte 25 2 12 X X X to accumulator ADD A,@Ri Add indirect RAM 26..27

More information

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller. UNIT V -8051 MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS 1. What is micro controller? Micro controller is a microprocessor with limited number of RAM, ROM, I/O ports and timer on a single chip

More information

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

ET355 Microprocessors Thursday 6:00 pm 10:20 pm ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor

More information

What are output transducers An output transducer will convert electrical signals passed to it by the process into another form of energy.

What are output transducers An output transducer will convert electrical signals passed to it by the process into another form of energy. What are output transducers An output transducer will convert electrical signals passed to it by the process into another form of energy. ACTIVITY Can you find the symbols of the output components listed

More information

Product Manual Dual Relay Board

Product Manual Dual Relay Board Product Manual 3051 - Dual Relay Board Phidgets 3051 - Product Manual For Board Revision 1 Phidgets Inc. 2009 Contents 4 Product Features 4 Connections 5 Getting Started 5 Checking the Contents 5 Connecting

More information

1. LCD (Liquid Crystal Display)interface

1. LCD (Liquid Crystal Display)interface e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: I/O devices Interfacing Module No: CS/ES/16 Quadrant 1 e-text In this lecture, the interfacing of 8051 with an output device and

More information

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

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas 8051 - Interrupts EE4380 Fall 2001 Class 9 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Polling Vs Interrupts Polling: MCU monitors all served devices continuously,

More information

DEV-1 HamStack Development Board

DEV-1 HamStack Development Board Sierra Radio Systems DEV-1 HamStack Development Board Reference Manual Version 1.0 Contents Introduction Hardware Compiler overview Program structure Code examples Sample projects For more information,

More information

Application Brief D-002

Application Brief D-002 HCMS-29xx and HCMS-39xx Interfacing the Avago Technologies HCMS-29xx / HCMS-39xx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-002 Introduction The HCMS-29xx/HCMS-39xx

More information

Instruction Set Of 8051

Instruction Set Of 8051 Instruction Set Of 8051 By Darshan Patel M.Tech (Power Electronics & Drives) Assistant Professor, Electrical Department Sankalchand Patel college of Engineering-Visnagar Introduction The process of writing

More information

Experiment #2 PLC Input Output Wiring Methods. OBJECTIVES After successfully completing this laboratory, you should be able to:

Experiment #2 PLC Input Output Wiring Methods. OBJECTIVES After successfully completing this laboratory, you should be able to: Experiment #2 PLC Input Output Wiring Methods OBJECTIVES After successfully completing this laboratory, you should be able to: Read and explain the nameplate of DELTA s PLC DVP Series Model. Make different

More information

Application Note. Interfacing the X9241 XDCPs to 8051 Microcontrollers AN20. by Applications Staff, June 2000

Application Note. Interfacing the X9241 XDCPs to 8051 Microcontrollers AN20. by Applications Staff, June 2000 Interfacing the X9241 XDCPs to 8051 Microcontrollers by Applications Staff, June 2000 The X9241 has a variety of different instructions that provide flexibility to the designer. Additionally, the nonvolatile

More information

;~~~~~~~~~~~~ ;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.

;~~~~~~~~~~~~ ;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. ;~~~~~~~~~~~~ ;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.7 PASS1 REG 70H PASS2 REG 71H TURN REG 72H IN_CODE REG 73H TIME REG

More information

ELEG3923 Microprocessor Ch.4 I/O Ports

ELEG3923 Microprocessor Ch.4 I/O Ports Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.4 I/O Ports Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 8051 I/O programming I/O bit manipulation programming I/O PORT

More information

Dodatak. Skup instrukcija

Dodatak. Skup instrukcija Dodatak Skup instrukcija Arithmetic Operations [@Ri] implies contents of memory location pointed to by R0 or R1 Rn refers to registers R0-R7 of the currently selected register bank 2 ADD A,

More information

8051 Microcontroller Logical Operations. Prepared by : A. B. Modi Target Audience : 5 th Semester Students

8051 Microcontroller Logical Operations. Prepared by : A. B. Modi Target Audience : 5 th Semester Students 8051 Microcontroller Logical Operations Prepared by : A. B. Modi Target Audience : 5 th Semester Students Learning Objectives After learning this chapter, Students should be able to: Describe and Use byte-level

More information

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

CONTENTS. 1.0 Introduction Description of the Circuit Installation Connection of Power Supply 4 1 CONTENTS PAGE NO 1.0 Introduction 2 2.0 Description of the Circuit 3 3.0 Installation 3 3.1 Connection of Power Supply 4 3.2 Connection of Output Signals to Relay Contacts 4 3.3 Interfacing to ESA Trainers

More information

Assembly Language programming (1)

Assembly Language programming (1) EEE3410 Microcontroller Applications LABORATORY Experiment 1 Assembly Language programming (1) Name Class Date Class No. Marks Familiarisation and use of 8051 Simulation software Objectives To learn how

More information

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

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue Control Transfer Instructions Jump, Loop, and Call 1 Jump Instructions JZ label ; Jump if A=0 JNZ label ; Jump if A!=0 DJNZ reg, label ; Decrement and Jump if A (or reg.)!=0 CJNE A, byte ; Compare and

More information

Interrupt Programming: Interrupts vs. Polling Method:

Interrupt Programming: Interrupts vs. Polling Method: UNIT 4: INTERRUPT PROGRAMMING & SERIAL COMMUNICATION WITH 8051: Definition of an interrupt, types of interrupts, Timers and Counter programming with interrupts in assembly. 8051 Serial Communication: Data

More information

Module 12: Elementary Input/Output

Module 12: Elementary Input/Output Module 12: Elementary Input/Output I/O Concepts Typical Organization of an I/O Device Memory-mapped vs Isolated I/O Elementary output with latch and LED Elementary input with buffer and switch 7-segment

More information

CPEG300 Embedded System Design. Lecture 8 Timer

CPEG300 Embedded System Design. Lecture 8 Timer CPEG300 Embedded System Design Lecture 8 Timer Hamad Bin Khalifa University, Spring 2018 Review 8051 port and port schematic Internal read/write data path Serial communication vs. parallel communication

More information

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

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000, 8051 TUTORIAL Donal Heffernan University of Limerick May-2002 8051 Tutorial D.Heffernan 2000, 2001 1 Blank 8051 Tutorial D.Heffernan 2000, 2001 2 Some reference material: Test books + MacKenzie Scott.

More information

CPEG300 Embedded System Design. Lecture 6 Interrupt System

CPEG300 Embedded System Design. Lecture 6 Interrupt System CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:

More information

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution 1. (a) 1. (b) T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution Priority modes. 1) Fully Nested Mode : It is a general purpose mode. IR 0 highest priority IR 1 lowest

More information

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

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen 8051 Single Board Monitor Programming Monitor Program Available Monitor Program Minmon - Yeralan & Ahluwalia Programming and Interfacing the 8051 Microcontroller PaulMon1 & PaulMon2 - Paul Stoffregen http://www.pjrc.com/tech/8051

More information

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU VRS540-4kB Flash, 28B RAM, 25~40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com P.3 P.2 XTAL NC P0./AD VRS540 Overview

More information

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

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following. (9M) 1) Describe the instructions SWAP A and MOVX@DPTR,A with one example. (3Marks) SWAP A

More information

Lecture (02) PIC16F84 (I)

Lecture (02) PIC16F84 (I) Lecture (02) PIC16F84 (I) By: Dr. Ahmed ElShafee ١ Review of Memory Technologies The PIC 16 Series PIC 16F84A The PIC 16F84A Memory The Oscillator Instruction Cycle Power up and Reset Parallel ports Technical

More information