Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

I/O Organization popo.
Categories of I/O Devices
Hoofdstuk 8 Interfaces en interface-ontwerp Prof. dr. ir. Dirk Stroobandt Academiejaar
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
COMP3221: Microprocessors and Embedded Systems Lecture 17: Computer Buses and Parallel Input/Output (I) Lecturer: Hui.
Chapter 2 Microprocessor Bus Transfers. Big- and Little-Endian Ordering Bit-endian processor architecture –High-order-byte-first (H-O-B-F) map the highest-order.
Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 1 A simple bus bus structure ProcessorMemory rd'/wr enable addr[0-11]
I/O Unit.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Lecture 8 Lecture 8: CoreConnect and The PLB Bus ECE 412: Microcomputer Laboratory.
Chapter 6 Interfacing.
Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
Basic Input/Output Operations
University College Cork IRELAND Hardware Concepts An understanding of computer hardware is a vital prerequisite for the study of operating systems.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 6 Interfacing ECE4330 Embedded System Design.
TECH CH03 System Buses Computer Components Computer Function
680XX Hardware Interface Outline Goal Reading
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
1 COSC 3P92 Cosc 3P92 Week 11 Lecture slides Violence is the last refuge of the incompetent. Isaac Asimov, Salvor Hardin in "Foundation"
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
2. Methods for I/O Operations
INPUT-OUTPUT ORGANIZATION
Lecture 12 Today’s topics –CPU basics Registers ALU Control Unit –The bus –Clocks –Input/output subsystem 1.
CS-334: Computer Architecture
Computer Architecture Lecture 08 Fasih ur Rehman.
1 LHO 12 Interfacing. 2 A simple bus bus structure ProcessorMemory rd'/wr enable addr[0-11] data[0-7] bus Wires: –Uni-directional or bi-directional –One.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 5 Memory.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
MICROPROCESSOR INPUT/OUTPUT
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
Top Level View of Computer Function and Interconnection.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
MBG 1 CIS501, Fall 99 Lecture 18: Input/Output (I/O): Buses and Peripherals Michael B. Greenwald Computer Architecture CIS 501 Fall 1999.
Computer Architecture Lecture 2 System Buses. Program Concept Hardwired systems are inflexible General purpose hardware can do different tasks, given.
EEE440 Computer Architecture
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 6 Interfacing.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
DIRECT MEMORY ACCESS and Computer Buses
Chapter 5 Memory.
Interconnection Structures
Operating Systems (CS 340 D)
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
Chapter 3 Top Level View of Computer Function and Interconnection
COMP2121: Microprocessors and Interfacing
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
ECEG-3202 Computer Architecture and Organization
COMP3221: Microprocessors and Embedded Systems
Chapter 13: I/O Systems.
Presentation transcript:

Interfacing

This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and bus-based I/O Memory mapped I/O and Standard I/O  Microprocessor interfacing: Interrupts  Microprocessor interfacing: Direct memory access  Arbitration  Priority arbiter  Daisy-chain arbitration  Network oriented arbitration  Advanced communication principles  Serial / Parallel / Wireless communication  Error detection and correction  Serial protocols  Parallel protocols  Wireless protocols Chapter 6 Interfacing

 Embedded system functionality aspects  Processing Transformation of data Implemented using processors  Storage Retention of data Implemented using memory  Communication Transfer of data between processors and memories Implemented using buses Called interfacing Introduction CPUMEM I/O

 Wires:  Uni-directional or bi-directional  One line may represent multiple wires  Bus  Set of wires with a single function Address bus, data bus  Or, entire collection of wires Address, data and control Associated protocol: rules for communication over these wires bus structure Processor Memory rd'/wr enable addr[0-11] data[0-7] bus A simple bus

Ports  Conducting device on periphery  Connects bus to processor or memory  Often referred to as a pin  Actual pins on periphery of IC package that plug into socket on printed-circuit board  Sometimes metallic balls instead of pins  Today, metal “pads” connecting processors and memories within single IC  Single wire or set of wires with single function  E.g., 12-wire address port bus ProcessorMemory rd'/wr enable addr[0-11] data[0-7] port Bus  Port (to  P) Street  Driveway (to building)

Timing Diagrams write protocol rd'/wr enable addr data t setup t write  Most common method for describing a communication protocol  Time proceeds to the right on x-axis  Control signal: low or high  May be active low (e.g., go’, /go, or go_L)  Use terms assert (active) and deassert  Asserting go’ means set go=0  Data signal: not valid or valid  Protocol may have subprotocols  Called bus cycle, e.g., read and write  Each may be several clock cycles  Read example  rd’/wr set low,  address placed on addr for at least t setup time before enable asserted,  enable triggers memory to place data on data wires by time t read read protocol rd'/wr enable addr data t setup t read inactive active

Basic protocol concepts  Actor: processor or memory involved in the data transfer:  master (processor) initiates, servant (slave – usually a peripheral or memory) responds  Direction: sender, receiver. Either master or slave can be the sender or receiver  Addresses: special kind of data  Specifies a location in memory, a peripheral, or a register within a peripheral, where data is to be written  Time (division) multiplexing: Very commonly used in today’s voice / data communications  Share a single set of wires for multiple pieces of data  Saves wires at expense of time data serializingaddress/data muxing MasterServant req data(8) data(15:0) mux demux MasterServant req addr/data req addr/data addrdata muxdemux addrdata req data 15:8 7:0addrdata Time-multiplexed data transfer Send 16 bit data over 8 bit databus Send both data and address through a single bus

Basic protocol concepts: control methods Strobe protocol (faster if response time of servant is known) Handshake protocol (better if there are multiple servants with different response times – ack line required) MasterServant req ack req data Master Servant data req data t access req data ack 1. Master asserts req (uest) to receive data 2. Servant puts data on bus within time t access Master receives data and deasserts req 4. Servant ready for next request Master asserts req to receive data 2. Servant puts data on bus and asserts ack to indicate data is ready and valid 3. Master receives data and deasserts req 4. Servant ready for next request Control methods are schemes for initiating and ending data transfer. I want the homework (the data) in my mailbox (data bus) by Monday (t access ) Master wants to receive data Finish up this report as soon as you can, and let me know when you are done!

A strobe/handshake compromise Fast-response case req data wait Master asserts req to receive data 2. Servant puts data on bus within time t access 3. Master receives data and deasserts req 4. Servant ready for next request 2 Slow-response case MasterServant req wait data req data wait Master asserts req to receive data 2. Servant can't put data within t access, asserts wait 3. Servant puts data on bus and deasserts wait 4. Master receives data and deasserts req 2 t access 5. Servant ready for next request 5 (wait line is unused) I want the homeworks turned in by Monday. If you cannot finish it by then, let me know for an extension. Finish it as soon as you can, and let me know when you do so.

Microprocessor interfacing: I/O addressing  A microprocessor communicates with other devices using some of its pins (non-control pins)  Port-based I/O (parallel I/O) Processor has one or more N-bit ports, connected to dedicated registers Processor’s software reads and writes a port just like a register E.g., P0 = 0xFF; v = P1.2; -- P0 and P1 are 8-bit ports  Bus-based I/O Processor has address, data and control ports that form a single bus Communication protocol is built into the processor A single instruction carries out the read or write protocol on the bus

Compromises/extensions  Parallel I/O peripheral  When processor only supports bus-based I/O but parallel I/O needed  Each port on peripheral connected to a register within peripheral that is read/written by the processor  Extended parallel I/O  When processor supports port-based I/O but more ports needed  One or more processor ports interface with parallel I/O peripheral extending total number of ports available for I/O  e.g., extending 4 ports to 6 ports in figure ProcessorMemory Parallel I/O peripheral Port A System bus Port CPort B Adding parallel I/O to a bus- based I/O processor Processor Parallel I/O peripheral Port APort BPort C Port 0 Port 1 Port 2 Port 3 Extended parallel I/O Address, system and control lines

Types of bus-based I/O: memory-mapped I/O and standard I/O  Processor talks to both memory and peripherals using same bus – two ways to talk to peripherals  Memory-mapped I/O Peripheral registers occupy addresses in same address space as memory e.g., Bus has 16-bit address –lower 32K addresses may correspond to memory –upper 32k addresses may correspond to peripherals  Standard I/O (I/O-mapped I/O) Additional pin (M/IO) on bus indicates whether a memory or peripheral access e.g., Bus has 16-bit address –all 64K addresses correspond to memory when M/IO set to 0 –all 64K addresses correspond to peripherals when M/IO set to 1

Memory-mapped I/O vs. Standard I/O  Memory-mapped I/O  Requires no special instructions Assembly instructions involving memory like MOV and ADD work with peripherals as well Standard I/O requires special instructions to move data between peripheral registers and memory  Standard I/O  No loss of memory addresses to peripherals  Simpler address decoding logic in peripherals possible smaller and/or faster comparators

Microprocessor interfacing: interrupts  Suppose a peripheral intermittently receives data, which must be serviced by the processor  The processor can poll the peripheral regularly to see if data has arrived – wasteful if too frequently performed, may miss service request if not performed frequently enough!  The peripheral can interrupt the processor when it has data  Requires an extra pin or pins: Int  If Int is 1, processor suspends current program, jumps to an Interrupt Service Routine, or ISR  Known as interrupt-driven I/O  Essentially, “polling” of the interrupt pin is built-into the hardware, so no extra time!

Microprocessor interfacing: interrupts  What is the address (interrupt address vector) of the ISR?  Fixed interrupt Address built into microprocessor, cannot be changed Either ISR stored at address or a jump to actual ISR stored if not enough bytes available Several interrupt pins are available to service interrupts from multiple peripherals  Vectored interrupt Peripheral must provide the address Common when microprocessor has multiple peripherals connected by a system bus Only one interrupt pin is necessary, which can be asserted by any peripheral  Compromise: interrupt address table

Interrupt-driven I/O using fixed ISR location 1(a): μP is executing its main program. 1(b): P1 receives input data in a register with address 0x : P1 asserts Int to request servicing by the μP. 3: After completing instruction at 100, μP sees Int asserted, saves the PC’s value of 100, and sets PC to the ISR fixed location of 16. 4(a): The ISR reads data from 0x8000, modifies the data, and writes the resulting data to 0x : The ISR returns, thus restoring PC to 100+1=101, where μP resumes executing. 4(b): After being read, P1 de- asserts Int. Time Read data received by Peripheral 1 (a sensor), transform and write it to Peripheral 2 (a display). μP normally runs its main program which is located at address 100 at the time interrupt from P1 is received.