I/O Systems.

Slides:



Advertisements
Similar presentations
MICROPROCESSOR BASED SYSTEM DESIGN
Advertisements

Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Microprocessors Typical microprocessor controlled devices: Camera, mobile phone, stereo, mp3 player, electronic toys… High-level microprocessor controlled.
1 Memory-Mapped I/O Lecture 23 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Input and Output CS 215 Lecture #20.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Basic Input/Output Operations
Chapter 8 Overview Programmed I/O Introduction to Interrupt Driven I/O Project 3.
Chapter 8 Overview Programmed I/O Interrupt Driven I/O.
Practical Session No. 10 Input &Output (I/O). I/O Devices Input/output (I/O) devices provide the means to interact with the “outside world”. An I/O device.
MIPS I/O and Interrupt. SPIM I/O and MIPS Interrupts The materials of this lecture can be found in A7-A8 (3 rd Edition) and B7-B8 (4 th Edition).
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 8 Input/Output l I/O basics l Keyboard input l Monitor output l Interrupt driven I/O l DMA.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
COMP201 Computer Systems Exceptions and Interrupts.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Input and Output Computer Organization and Assembly Language: Module 9.
MICROPROCESSOR INPUT/OUTPUT
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
MIPS I/O and Interrupt. .data val1:.float 0.6 val2:.float 0.8 msg_done:.asciiz "done\n".text.globl main main: li.s $f0, mfc1 $a0, $f0 jal calsqrt.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 11, 2012.
Copyright © 2007 Elsevier8- Chapter 8 :: Memory Systems Digital Design and Computer Architecture David Money Harris and Sarah L. Harris.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
Input-Output Organization
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
MIPS I/O and Interrupt.
Electronic Analog Computer Dr. Amin Danial Asham by.
PPI-8255.
CIT 673 Created by Suriyong1 Micro controller hardware architechture.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
IT3002 Computer Architecture
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Computer System Structures
Control Unit Lecture 6.
MIPS I/O and Interrupt.
UNIT – Microcontroller.
Chapter 10 Input/Output Organization
MIPS Coding Continued.
Hardware Source: ttp:// under
Introduction of microprocessor
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
CS 286 Computer Organization and Architecture
8085 microprocessor.
MIPS Processor.
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
MIPS I/O and Interrupt.
Interfacing Memory Interfacing.
Number Representations and Basic Processor Architecture
MIPS I/O and Interrupt.
Computer System Overview
Solutions Chapter 2.
MIPS Processor.
Operating Systems Chapter 5: Input/Output Management
Programmable Peripheral Interface
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Computer Architecture and Assembly Language
Hardware Source: ttp:// under
COMS 361 Computer Organization
MIPS I/O and Interrupt.
COMP3221: Microprocessors and Embedded Systems
MIPS Processor.
Conditional Branching (beq)
Presentation transcript:

I/O Systems

What Will We Learn? How to Interface Peripherals Memory Mapped I/O Memory Mapped I/O Example Speech Chip (SPO 256)

What Can Our Processor Do So Far? We can: Calculate Write to and Read from memories Branch, loop, jump and return to sub-programs But how do we interact with the environment? Light the LEDs on the board Read the buttons More complex interfaces, keyboards, video connections

Memory-Mapped Input/Output (I/O) Access I/O devices (like keyboards, monitors, printers) just like it accesses memory Each I/O device assigned one or more address When that address is detected, data is read from or written to I/O device instead of memory A portion of the address space dedicated to I/O devices (for example, addresses 0xFFFF0000 to 0xFFFFFFFF in reserved segment of memory map) But we need additional hardware to help us After all we will not really write to and read from memory

Memory-Mapped I/O Hardware Address Decoder: Looks at address to determine which device/memory communicates with the processor I/O Registers: Hold values written to the I/O devices ReadData Multiplexer: Selects between memory and I/O devices as source of data sent to the processor

The Memory Interface

Memory-Mapped I/O Hardware

Memory-Mapped I/O Code Suppose I/O Device 1 is assigned the address 0xFFFFFFF4 Write the value 42 to I/O Device 1 Read the value from I/O Device 1 and place it in $t3

Memory-Mapped I/O Code: Write Write 42 to I/O Device 1 (0xFFFFFFF4) addi $t0, $0, 42 sw $t0, 0xFFF4($0) # Recall that the 16-bit immediate # is sign-extended to 0xFFFFFFF4

Memory-Mapped I/O Code: Read Read from I/O Device 1 and place it in $t3 lw $t3, 0xFFF4($0) # Recall that the 16-bit immediate # is sign-extended to 0xFFFFFFF4

Example I/O Device: Speech Chip SPO256 Allophone: fundamental unit of sound, for example: “hello” = HH1 EH LL AX OW Each allophone assigned a 6-bit code, for example: “hello” = 0x1B 0x07 0x2D 0x0F 0x20 See http://www.speechchips.com, http://www.futurebots.com/sensor.htm

Speech Chip I/O A6:1: allophone input ALD: allophone load (the bar over the name indicates it is low-asserted, i.e. the chip loads the address when ALD goes low) SBY: standby, indicates when the speech chip is standing by waiting for the next allophone

Driving the Speech Chip Set ALD to 1 Wait until the chip asserts SBY to indicate that it has finished speaking the previous allophone and is ready for the next one Write a 6-bit allophone to A6:1 Reset ALD to 0 to initiate speech

Memory-Mapping the I/O Ports Memory Mapped I/O Allophones in Memory A6:1: 0xFFFFFF00 ALD: 0xFFFFFF04 SBY: 0xFFFFFF08

Software Driver for the Speech Chip init: addi $t1, $0, 1 # $t1 = 1 addi $t2, $0, 20 # $t2 = array size * 4 lui $t3, 0x1000 # $t3 = array base address addi $t4, $0, 0 # $t4 = 0 (array index) start: sw $t1, 0xFF04($0) # ALD = 1 loop: lw $t5, 0xFF08($0) # $t5 = SBY beq $0, $t5, loop # loop until SBY == 1 add $t5, $t3, $t4 # $t5 = address of allophone lw $t5, 0($t5) # $t5 = allophone sw $t5, 0xFF00($0) # A6:1 = allophone sw $0, 0xFF04($0) # ALD = 0 to initiate speech addi $t4, $t4, 4 # increment array index beq $t4, $t2, done # last allophone in array? j start # repeat done:

Hardware for Supporting SP0256

SP0256 Pin Connections

Summary Processors access I/O devices just like memory A range of memory addresses is reserved for I/O An address decoder detects when we access I/O It enables the I/O device or memory for writing Selects between the I/O device or memory for reading A device driver is customized software routine to allow interfacing the I/O device. Device driver knows how the external hardware needs to be accessed.