I/O Synchronization and Interrupt Programming: A Comprehensive Guide, Slides of Microprocessor and Assembly Language Programming

slides of microprocessor book of chapter 8 and 9 and 10

Typology: Slides

2017/2018

Uploaded on 09/10/2018

junaidanwararain
junaidanwararain 🇵🇰

3 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
I/O Synchronization and
Interrupt programming
Engr. Zeba Idrees
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download I/O Synchronization and Interrupt Programming: A Comprehensive Guide and more Slides Microprocessor and Assembly Language Programming in PDF only on Docsity!

I/O Synchronization and

Interrupt programming

Engr. Zeba Idrees

Why Synchronization is Needed

 Wide variety of peripherals

 (^) Delivering different amounts of data  (^) At different speeds  (^) In different formats

 All slower than CPU

 To resolve this speed miss match, that put CPU to

wait, Synchronization is needed.

 Need I/O Modules to interact with CPU and Memory

 (^) Interface to CPU and Memory  (^) Interface to one or more peripherals

Generic Model of I/O Module

Address Lines Data Lines Control Lines I/O Module System Bus Links to Peripheral Devices

External Devices

 Human-readable

 (^) Screen, Printer, Keyboard

 Machine-readable

 (^) Monitoring and control  (^) Magnetic disks and Tape drives

 Communication

 (^) Modem  (^) Network Interface Card (NIC)

Typical I/O Device Data Rates

I/O Module Function

 (^) Control and timing  (^) To coordinate the flow of traffic between internal resources and external devices  (^) Processor communication  (^) Communication between processor and I/O module  (^) Device communication  (^) Communication between device and I/O module  (^) Data buffering  (^) Necessary because of different data rates of processor and peripheral  (^) Error detection  (^) Unintentional changes to the bit pattern are detected

Introduction to I/O Synchronization

 Microcontroller architecture to interface

peripherals (primary function is to handle data

either I/P or O/P)

 ADC for acquisition

 Communication interfaces data TX and Rx

Conti.

 Hardware Device States w.r.t operation

 (^) Active  (^) Either busy or ready  (^) Inactive (no I/o operation)  (^) Transition b/w these two states can be done by user application program.  (^) R-t0-B transition is either due to user task or an event.  (^) B-to R when event or task is completed.  (^) Ready to inactive: by user program or due to expiration of predefined inactivity time interval.

Conti.

 For proper working and efficient data handling

both H.W and S.W should work in

synchronization.

 If SW is faster it need to wait. In the absence of

sync SW might wait longer than needed. Extra

delay will occur.

 If HW is faster it generate data at rate that

cannot be processed not the SW.

Input Device Synchronization

 I/P device Case:

 (^) H.W = data producer  (^) S.W= data consumer(receive and process data)  (^) General process  (^) H.W has produced and software read it and allow the HW to start new production.

Output Device Synchronization

 O/P device Case:

 (^) S.W = data producer  (^) H.W= data consumer(receive and process data)  (^) General process  (^) If SW is faster it need to wait. In the absence of sync SW might wait longer than needed. Extra delay will occur.  (^) If HW is faster it need to wait for software.

Conti.

 Incase of I/P : delay and data loss

 Incase of O/P: only delay no data loss

Methods of I/O synchronization

 3 main Categories

 Blind cycle

 Poling based methods

 (^) Continuous poling or busy wait  (^) Periodic polling

 Interrupt driven methods

 (^) I/O synchronization using interrupt  (^) Direct Memory Access

Blind cycle

 (^) In an I/O operation there is a delay in HW responding to SW.  (^) If this delay is highly predictable  (^) Software can initiate a new request after fixed delay. This is what is done in blind cycle sync.  (^) Choice of fixed time interval  (^) Max possible time that is require by the HW to complete the operation.  (^) (Disadvantage)If mean time for the device HW to complete the operation is significantly smaller than maximum time, results in unnecessary delay and waste processor time.  (^) HW & SW operations performed sequentially so waste of resources  (^) (Advantage) Implementation simplicity