© 2006 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access (DMA)

Slides:



Advertisements
Similar presentations
Homework Reading Machine Projects Labs
Advertisements

Computer Architecture
I/O Organization popo.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
DMA Controller (8237 Programming Examples)
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
Judul Mata Kuliah Judul Pokok Bahasan 1/total Direct Memory Access (DMA) & Interfacing.
Chapter 13: Direct Memory Access and DMA-Controlled I/O.
Direct Memory Access Introduction to 8237
I/O Unit.
Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access and DMA-
Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
Chapter 7 Interupts DMA Channels Context Switching.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
Unit-5 CO-MPI autonomous
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
1 Computer System Overview Chapter 1 Review of basic hardware concepts.
Microcomputer & Interfacing Lecture 2
MODES OF Details of Pins Pin 1 –Connected Ground Pins 2-16 –acts as both input/output. Outputs address at the first part of the cycle and outputs.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
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.
MICROPROCESSOR INPUT/OUTPUT
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
DMA Versus Polling or Interrupt Driven I/O
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Direct Memory Access (DMA) Microprocessors I -1. Topics to be discussed  Basic DMA Concept Basic DMA Concept  DMA pins and timing DMA pins and timing.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Modes of transfer in computer
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.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
Group 1 chapter 3 Alex Francisco Mario Palomino Mohammed Ur-Rehman Maria Lopez.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Lecture Overview Shift Register Buffering Direct Memory Access.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Amdahl’s Law & I/O Control Method 1. Amdahl’s Law The overall performance of a system is a result of the interaction of all of its components. System.
Input / Output Chapter 9.
Direct memory access Direct memory access (DMA) is a process in which an external device takes over the control of system bus from the CPU. DMA is for.
Direct Memory address and 8237 dma controller LECTURE 6
I/O Memory Interface Topics:
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
8086/8088 Hardware Specifications
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Created by Vivi Sahfitri
Presentation transcript:

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 13 Direct Memory Access (DMA)

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter Objectives Review and compare main types of I/O Introduce Direct Memory Access (DMA) I/O Explain basic DMA operation: HOLD, HLDA Introduce the 8237A programmable DMA controller (DMAC) Describe various types, modes and applications of DMA data transfer

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Review of I/O Types 1. Programmed I/O I/O between memory and the I/O device is performed by the Processor: e.g. IN AL,DX MOV [DI],AL; Transfer is through the  P - slow! 1.1 Polling/Handshaking I/O Processor checks device readiness repeatedly, e.g. in a tight loop 1.2 Interrupt-driven I/O Device signals its readiness by an interrupt. Processor performs I/O by executing an ISR. Otherwise processor is doing other useful work 2. Direct Memory Access (DMA) - Avoids the slow speed of programmed I/O when moving large amounts of data between memory and a peripheral - Data transfer is coordinated by a DMA controller- not the processor - Avoids the bottleneck of having to channel data through the  P - Uses the 3  P buses, so the  P is unable to use them temporarily - Speed is limited only by those of the memory and the DMAC

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e DMA Direct Memory Access (DMA) is a method whereby the memory and I/O space of the microprocessor can be accessed directly without the intervention of the microprocessor or a program. To request DMA access, the DMAC raises the HOLD input high. The microprocessor responds by floating the 3 buses and raising HLDA high to indicate that a hold is in effect. The DMAC can now use the 3 buses to do DMA transfers on them- bypassing the processor

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e During a HOLD, the microprocessor stops running the program and places its address, data, and control bus connections at their HiZ state. This in effect is the same as removing the microprocessor from its socket! While the microprocessor is held, other devices are free to gain access to its memory and I/O space and transfer data directly using them Usually this requires the use of a programmable DMAC chip: (Direct Memory Access Controller), e.g. the 8237A

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e HOLD is sampled during instruction execution while interrupt signals are sampled at the end of instructions HOLD takes effect (HLDA generated) in a clock cycle or two  So, Hold has a higher priority than interrupts The only input with a higher priority than HOLD is the RESET input to the microprocessor. Device Requests DMA Transfer DMA Request Granted-  P has relinquished control of the buses I/P O/P DMA finished

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e DMA Applications Wherever large amounts of data need to be transferred fast between memory and an I/O peripheral device, e.g. - Hard disk, CD - Video memory to refresh display - Sound cards - Network cards - Data acquisition boards Also for row address generation by hardware to refresh large DRAMs fast

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Memory Read I/O Write Simultaneously ! Memory address Generated by fast Counters on the DMAC C HOLD

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e DMA Control Signals Because during a DMA both memory and an I/O device may be accessed simultaneously, the DMAC may need to generate: - #MRDC and #IOWC (simultaneously) for memory to I/O device transfers - #IORC and #MRWC (simultaneously) for I/O device to memory transfers This was not necessary with programmed I/O as processor either accessed memory or an I/O device at any given time moving data between it and the processor

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e DMAC Interface The DMAC is a Programmable I/O device for the microprocessor, Just like the PPI, PIC, UART, … DMA activities by the DMAC will be programmed into it by the processor before hand With HLDA Active Two types of DMA data transfers: 1. Sequential DMA: Read then Write through the DMAC Data rests in DMAC. Only M or IO controls are needed at any given time 2. Simultaneous DMA: Data moved directly between peripheral and memory. Both M & IO controls used at the same time

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e The 8237A Programmable DMAC Four separate prioritized DMA channels (expandable by using multiple DMACs) Transfer rates up to 1.6 M bytes/s DMA transfers by the DMA channels are programmed a priori into the DMAC by the processor Can address 64KB of memory in one programming operation  16-bit addresses Allows the following DMA transfer combinations: -Memory to peripheral -Peripheral to memory -Peripheral to peripheral -Memory to memory No longer used on the PC in chip form nowadays- its functionality has been embedded into modern chip set ICs On-chip Address I/Ps  16 I/O adrs (Programming) DMA Device PP For address Counters - Data Bus (during Programng) - A8-A15 During DMA Address bus (during DMA)

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Programming the DMAC (Only these 3 numbers are written into the DMAC)

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e DMA Modes: Byte, Burst & Block (3 Bees!) Byte: Un-buffered device Burst: (a buffer-full of data) Fill the buffer of a slow device once Block: (multiple buffers) Fill the buffer of a fast Device several times DMAC gets more greedy for bus control Block finished? As long As Device Is Ready (filling its buffer) Only for a byte As long as needed to transfer the block (buffer full) Bars show duration of DMAC controlling the buses

© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Comparison between the three types of I/O TypeAdvantagesDisadvantages Polling -Fastest response to device request -Simplest hardware and software - Wasted processor resources (always waiting) Interrupts - More efficient use of processor time (Processor executes program- checks for interrupts only at the end of every instructions) - Delay in response time (interrupt latency) -Overhead due to interrupt processing, e.g. saving return address & registers, context switching - Increased cost and complexity of hardware and software DMA -Fastest data transfer rates (approaching those determined by memory access time) Address generation by fast DMAC hardware- not by processor software -Need a DMAC device -Highest cost and complexity in hardware and software