EEE310 MICROPROCESSORS M. Fatih Tüysüz CHAPTER 7

Similar documents
1 = Enable SOD 0 = Disable SOD. Serial Output Data. Fig.12.9 SIM Instruction Format

Hierarchy of I/O Control Devices

Counters & Time Delays. Microprocessors & Interfacing 1

EC2304-MICROPROCESSOR AND MICROCONROLLERS 2 marks questions and answers UNIT-I

INSTRUCTION SET OF 8085

Subject Code: Model Answer Page No: /25

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT I THE 8085 & 8086 MICROPROCESSORS. PART A (2 Marks)

EKT222 Miroprocessor Systems Lab 5

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER


The due date for submitting this assignment has passed. 1) How many times will the following loop be executed? Depends on the initial value of A

Sender Receiver Sender

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

LIST OF PROGRAMS. Prg. Name of the Program. 1 Study of Pin Diagram of Study of Architecture of Study of 8085 Kit.

1. What is Microprocessor? Give the power supply & clock frequency of 8085?

(2) Explain the addressing mode of OR What do you mean by addressing mode? Explain diff. addressing mode for 8085 with examples.

Architecture of 8085 microprocessor

QUESTION BANK. EE 6502 / Microprocessor and Microcontroller. Unit I Processor. PART-A (2-Marks)

Assembly Language Programming of 8085

Interrupt is a process where an external device can get the attention of the microprocessor. Interrupts can be classified into two types:

م.م. ماجد عيدان. Introduction to microprocessor and microcomputer

LABORATORY 1 INTRODUCTION TO 8085 MICROPROCESSOR DEVELOPMENT SYSTEM BOARD

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

ROEVER ENGINEERING COLLEGE

Assembly Language Programming of 8085

Assembly language Programming

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

8085 Interrupts. Lecturer, CSE, AUST

MICROPROCESSOR BASICS AND RELATED TERMS

8085 INSTRUCTION SET INSTRUCTION DETAILS

DE60/DC68 MICROPROCESSORS & MICROCONTROLLERS JUNE 2013

Its Assembly language programming

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

MCS-51 Serial Port A T 8 9 C 5 2 1

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

Micro Processor & Micro Controllers

S.R.M. INSTITUTE OF SCIENCE & TECHNOLOGY SCHOOL OF ELECTRONICS & COMMUNICATION ENGINEERING

Fig.12.5 Serial Data Line during Serial Communication

AE66/AC66/AT66/ AE108/AC108/AT108 MICROPROCESSORS & MICROCONTROLLERS

UNIT I. Differences between: Microcomputer, Microprocessor and Microcontroller

DE60/DC68 MICROPROCESSORS & MICROCONTROLLERS JUN 2015

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Microprocessor Architecture

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Unit 1 8 BIT MICROPROCESSOR ARCHITECTURE

SAMPLE STUDY MATERIAL

Interrupts. by Rahul Patel, Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

LAB 1 Introduction to 8085 Microprocessor Development System Board

1. Internal Architecture of 8085 Microprocessor

INSTITUTE OF ENGINEERING AND MANAGEMENT, KOLKATA Microprocessor

Practical Course File For

GATE Exercises on Microprocessors

Serial Communication Prof. James L. Frankel Harvard University. Version of 2:30 PM 6-Oct-2015 Copyright 2015 James L. Frankel. All rights reserved.

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07)

Chapter 1: Basics of Microprocessor [08 M]

CHAPTER 5 : Introduction to Intel 8085 Microprocessor Hardware BENG 2223 MICROPROCESSOR TECHNOLOGY

1. What is microprocessor? It is a program controlled semi conductor device (IC), which fetches, decodes and execute instructions.

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

EE309: Computer Organization, Architecture and MicroProcessors. sumantra/courses/up/up.html GND HIGH ORDER ADDRESS BUS

PERIPHERAL INTERFACING Rev. 1.0

MICROPROCESSOR MICROPROCESSOR. From the above description, we can draw the following block diagram to represent a microprocessor based system: Output

ELECTRICAL ENGINEERING

Introduction to Assembly Language Programming (Instruction Set) 1/18/2011 1

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

1. Internal Architecture of 8085 Microprocessor

8051 Serial Communication

ECE251: Thursday November 8

Lecture-65 SERIAL DATA COMMMUNICATION The data bus of a microcomputer system is designed to transfer data to and from I/O device in parallel - all

COPYRIGHT IS NOT RESERVED BY AUTHORS. AUTHORS ARE NOT RESPONSIBLE FOR ANY LEGAL ISSUES ARISING OUT OF ANY COPYRIGHT DEMANDS

EECE 340 Introduction to Microprocessors w/lab Section A. Term Project Parking Visitor Counter

The functional block diagram of 8085A is shown in fig.4.1.

CS 1304-MICROPROCESSORS

8051 Timers and Serial Port

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

PART B (5 x 16 =80) ADDRESS BUS The 8085 has eight signal lines, A15 A8 : Unidirectional, known as high order address.

MICROPROCESSORS & MICRO CONTROLLER COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK

Lecture-15 W-Z: Increment-Decrement Address Latch:

1. Internal Architecture of 8085 Microprocessor

Serial Communications

Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

MACHINE CONTROL INSTRUCTIONS: 1. EI

Asynchronous Data Transfer

CS2252 Microprocessor & Microcontroller TWO MARKS

EC6504 MICROPROCESSOR AND MICROCONTROLLER

Interfacing a Hyper Terminal to the Flight 86 Kit

EC1362 Microprocessors & Microcontrollers

Question Bank Microprocessor and Microcontroller

Pin Description, Status & Control Signals of 8085 Microprocessor

Department of Computer Science and Engineering

Control Unit: The control unit provides the necessary timing and control Microprocessor resembles a CPU exactly.

8085 Microprocessor Programs

The advantages of registers over memory locations are as follows:

VALLIAMMAI ENGINEERING COLLEGE

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

Microprocessor Micro Syllabus BSc. CSIT, IOST, TU. Microprocessor

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

Transcription:

EEE31 MICROPROCESSORS M. Fatih Tüysüz CHAPTER 7

CHAPTER 7 Contents Midterm Questions & Solutions Serial I/O Data Transfer

Midterm Questions & Solutions Q1: a) Why Microprocessors use only two digits ( and 1), explain it in detail. b) What is inside a Microprocesor? Explain each unit of it.

Q2: Write an assembly program to add data at 4H and 5H memory locations and store the result at 45H and the complement of the result at 451H memory locations. Solution: LXI H 4H MOV A, M LXI H 5H ADD M LXI H 45H MOV M, A CMA INX H MOV M, A

Q3: How many T-states are required for the following program to be completed. In addition, if the Microprocessor is running at 2 MHz, How long will it take to complete the program? MVI B, 1H LOOP2 MVI C, 9H LOOP1 DCR C JNZ LOOP1 DCR B JNZ LOOP2 7 T-States 7 T-States 4 T-States 1 T-States 4 T-States 1 T-States Delay of inner loop TO1 = 7 T-States MVI C, 9H instruction TL1 = (9 X 14) - 3 = 123 T-States 14 T-States for the DCR C & JNZ instructions repeated 9 times minus 3 for the final JNZ

Q3: How many T-states are required for the following program to be completed. In addition, if the Microprocessor is running at 2 MHz, How long will it take to complete the program? Delay of outer loop T O2 = 7 T-States MVI B, 1H instruction T L1 = (16 X (14 + (123+7))) - 3 = 231 T-States 14 T-States for the DCR B and JNZ instructions and 13 T-States for loop1 repeated 16 times (1 16 = 16 1 ) minus 3 for the final JNZ. T Delay = 7 + 231 = 238 T-States Total Delay T Delay = 238 X.5 µsec = 1.154 msec

Q4: Plot the timing diagram of the instruction MOV M, A. Also, explain the diagram in detail. Instruction: MOV M,A T1 T2 T3 T4 T5 T6 T7 MSB xxh Content Of Reg H A15- A8 (Higher Order Address bus) LSB xxh Instruction Data DA7-DA (Lower order address/databus) L Reg Content of Reg A ALE RD WR IO/M Op-Code Fetch Cycle Memory Write Cycle

Q5: What is done in the program below? Or in other words, What is the purpose of the program? Also, explain what the program performs on each line one by one, using the comment lines. It simply clears the memory locations starting from 21H. The length of data bytes is given in 2H memory location.

Basic Concepts in Serial I/O Interfacing requirements: Identify the device through a port number. Memory-mapped. Peripheral-mapped. Enable the device using the Read and Write control signals. Read for an input device. Write for an output device. Only one data line is used to transfer the information instead of the entire data bus.

Basic Concepts in Serial I/O Controlling the transfer of data: Microprocessor control. Unconditional, polling, status check, etc. Device control. Interrupt.

Synchronous Data Transmission The transmitter and receiver are synchronized. A sequence of synchronization signals is sent before the communication begins. Usually used for high speed transmission. More than 2 K bits/sec. Message based. Synchronization occurs at the beginning of a long message.

Asynchronous Data Transmission Transmission occurs at any time. Character based. Each character is sent separately. Generally used for low speed transmission. Less the 2 K bits/sec.

Asynchronous Data Transmission Follows agreed upon standards: The line is normally at logic one (mark). Logic is known as space. The transmission begins with a start bit (low). Then the seven or eight bits representing the character are transmitted. The transmission is concluded with one or two stop bits. Start D D 1 D 2 D 3 D 4 D 5 D 6 D 7 One Character Stop Time

Simplex and Duplex Transmission Simplex. One-way transmission. Only one wire is needed to connect the two devices Like communication from computer to a printer. Half-Duplex. Two-way transmission but one way at a time. One wire is sufficient. Full-Duplex. Data flows both ways at the same time. Two wires are needed. Like transmission between two computers.

Rate of Transmission For parallel transmission, all of the bits are sent at once. For serial transmission, the bits are sent one at a time. Therefore, there needs to be agreement on how long each bit stays on the line. The rate of transmission is usually measured in bits/second or baud.

Length of Each Bit Given a certain baud rate, how long should each bit last? Baud = bits / second. Seconds / bits = 1 /baud. At 12 baud, a bit lasts 1/12 =.83 m Sec.

Transmitting a Character To send the character A over a serial communication line at a baud rate of 56.6 K: ASCII for A is 41H = 11. Must add a start bit and two stop bits: 11 11 Each bit should last 1/56.6K = 17.66 µ Sec. Known as bit time. Set up a delay loop for 17.66 µ Sec and set the transmission line to the different bits for the duration of the loop.

Error Checking Various types of errors may occur during transmission. To allow checking for these errors, additional information is transmitted with the data. Error checking techniques: Parity Checking. Checksum. These techniques are for error checking not correction. They only indicate that an error has occurred. They do not indicate where or what the correct information is.

Parity Checking Make the number of 1 s in the data Odd or Even. Given that ASCII is a 7-bit code, bit D 7 is used to carry the parity information. Even Parity The transmitter counts the number of ones in the data. If there is an odd number of 1 s, bit D 7 is set to 1 to make the total number of 1 s even. The receiver calculates the parity of the received message, it should match bit D 7. If it doesn t match, there was an error in the transmission.

Checksum Used when larger blocks of data are being transmitted. The transmitter adds all of the bytes in the message without carries. It then calculates the 2 s complement of the result and send that as the last byte. The receiver adds all of the bytes in the message including the last byte. The result should be. If it isn t an error has occurred.

RS 232 A communication standard for connecting computers to printers, modems, etc. The most common communication standard. Defined in the 195 s. It uses voltages between +15 and 15 V. Restricted to speeds less than 2 K baud. Restricted to distances of less than 5 feet (15 m).

Software-Controlled Serial Transmission The main steps involved in serially transmitting a character are: Transmission line is at logic 1 by default. Transmit a start bit for one complete bit length. Transmit the character as a stream of bits with appropriate delay. Calculate parity and transmit it if needed. Transmit the appropriate number of stop bits. Transmission line returns to logic 1.

Serial Transmission Accumulator D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 1 1 Shift D Output Port Stop 1 1 Start Time

Flowchart of Serial Transmission Set up Bit Counter Set bit D of A to (Start Bit) Wait Bit Time Get character into A Wait Bit Time Rotate A Left Decrement Bit Counter No Last Bit? Yes Add Parity Send Stop Bit(s)

Software-Controlled Serial Reception The main steps involved in serial reception are: Wait for a low to appear on the transmission line. Start bit Read the value of the line over the next 8 bit lengths. The 8 bits of the character. Calculate parity and compare it to bit 8 of the character. Only if parity checking is being used. Verify the reception of the appropriate number of stop bits.

Serial Reception Input Port D 7 Accumulator Shift D 7 1 D 6 D 5 D 4 D 3 D 2 D 1 1 D Stop 1 1 Start Time

Flowchart of Serial Reception No Read Input Port Start Bit? Wait Bit Time Read Input Port Yes Decrement Counter Wait for Half Bit Time No Bit Still Low? Last Bit? No Yes Yes Start Bit Counter Check Parity Wait for Stop Bits

The 885 Serial I/O Lines The 885 Microprocessor has two serial I/O pins: SOD Serial Output Data SID Serial Input Data Serial input and output is controlled using the RIM and SIM instructions respectively.

SIM and Serial Output As was discussed in Chapter 5, the SIM instruction has dual use. It is used for controlling the maskable interrupt process For the serial output process. The figure below shows how SIM uses the accumulator for Serial Output. 7 6 5 4 3 2 1 SDO SDE XXX R7.5 MSE M7.5 M6.5 M5.5 Serial Output Data Disable SOD 1 Enable SOD

RIM and Serial Input Again, the RIM instruction has dual use Reading the current settings of the Interrupt Masks Serial Data Input 7 6 5 4 3 2 1 Serial Input Data SDI P7.5 P6.5 P5.5 IE M7.5 M6.5 M5.5 The figure below shows how the RIM instruction uses the Accumulator for Serial Input

Ports? Using the SOD and SID pins, the user would not need to bother with setting up input and output ports. The two pins themselves can be considered as the ports. The instructions SIM and RIM are similar to the OUT and IN instructions except that they only deal with the 1-bit SOD and SID ports.

Example Transmit an ASCII character stored in register B using the SOD line. SODDATA MVI C, BH ; Set up counter for 11 bits XRA A ; Clear the Carry flag NXTBIT MVI A, 8H ; Set D7 =1 RAR ; Bring Carry into D7 and set D6 to 1 SIM ; Output D7 (Start bit) CALL BITTIME STC ; Set Carry to 1 MOV A, B ; Place character in A RAR ; Shift D of the character to the carry Shift 1 into bit D7 MOV B, A ; Save the interim result DCR C ; decrement bit counter JNZ NXTBIT