This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

I/O InterfacingThree I/O strategiesSynchronizationTransfer RateComparison of transfer ratesLatencyComparison of LatencyPolled Waiting I/OInterrupt-Driven I/OResponding to InterruptsHardware Interrupt PinsI/O Interfacing•A lot of handshaking is required between the CPU and most I/O devices.•All I/O devices operate asynchronously with respect to the CPU. The events that determine when an input device has data available or when an output device needs data are independent of the CPU.Three I/O strategies •Must be capable of data rates fast enough to keep up with the demands of the device, but must not be allowed to transfer data faster than the device can process it.»Polled waiting loops»Interrupt-driven I/O»Direct memory Access (DMA)Synchronization•The CPU must have some way of checking the status of the device and waiting until it is ready to transferTransfer Rate•A measure of the number of bytes per second transferred between the CPU and an external device.•Maximum transfer rate – a measure of the bandwidth capability of a particular method of doing I/O.Comparison of transfer rates•Polled waiting loops provide data rates that are a bit slower, but still quite reasonable.•Interrupt-driven I/O requires overhead of saving and restoring the machine state (significantly degrades data rates unless more than one byte can be transferred per interrupt.•DMA has fastest transfer rates (additional hardward complexity needed.Latency•Measure of the delay from the instant that the device is ready until the time the first data byte is transferred. Latency is equivalent to the “response time”Comparison of Latency•Polled Waiting Loops – latency can be very high (the computer may not even be checking the device for new data when it arrives).•Interrupt-driven I/O – dramatically lower than polled, but still imposes a software overhead. •DMA – very low (lower than the others)Polled Waiting I/O•Use software to test the status of a device,before transferring each data byte.•Continuously checking the peripheral’s BUSY/READY flag•Ties up the CPU – no other tasks can be performed.Interrupt-Driven I/O•There are different types of interrupts–Hardware•Generated by the 8259 PIC – signals the CPU to suspend execution of the current program and process the interrupt (keyboard, serial port)•Occasionally, programs must disable hardware interrupts when performing sensitive operations on segment registers and the stack. Use CLI (Clear Interrupt flag) to disable interrupts and STI (Set interrupt flag) to enable interrupts.–Software •Not really an interrupt (INT)–Internal Interrupts•Divide by zero•TrapsResponding to Interrupts Normal ProcessingInterrupt OccursFinish Current InstructionNormal Processing ResumesPush flags, CS, and IP (EIP) onto stackPop flags, CS, and IP(EIP) from stackBranch to ISRExecute ISRHardware Interrupt Pins•NMI – non-maskable interrupt – it cannot be blocked (the CPU must respond) – reserved for critical system functions.•INTR – maskable via the IF


View Full Document

MSU ECE 3724 - IO Interfacing

Documents in this Course
Timers

Timers

38 pages

TEST 4

TEST 4

9 pages

Flags

Flags

6 pages

Timers

Timers

6 pages

Timers

Timers

54 pages

TEST2

TEST2

8 pages

Load more
Download IO Interfacing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view IO Interfacing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view IO Interfacing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?