•e · figure 3.3 ' the output device sets a flag when it has finished outputting the last...

16
an~ CPU woutj tkrov94 1140Porfs I - A 1 00ASVCY Ejpcs actsiC I/o transfer ! /O5truc+vreS cornmvvticafe with o f daka Cf n UM tiC I Alpk&nuwter rC J Covt+roQ C •e Rl' , s+afvs a(4ervah*vcs DeVice, iv\Ab cd l polII , tondificK-ntranscer -t C~rcct Mc*O a ~cce5S D 1 /0pr o3cgwcwcec L -V~- J i h4urv0 s pcriQherads fc4vlte S SOM . e.XC l k4K U ~ lK 0(0 . "Trop Jicez beJeep MPU ateve Ce \' .e ~\alhc)Sli kih )

Upload: lykhuong

Post on 11-Oct-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

an~ CPU woutj

tkr ov94

1140 Por f s

I-A 100A SVC Y

Ejpcs

actsiC I/o transfer

! /O 5 truc+vre S

corn mvvticafe with

o f d aka

Cf n U M t iC I A l pk&nuwter rC

J Covt+ro Q

C •e Rl' , s+afvs

a (4ervah*vcs

DeVi ce, i v\Ab cd l

polII ,

tondi ficK-n transcer

-tC~ rcc t Mc* O

a~ cc e5SD

1 /0 pro3cgwcwcec

L-V~-

J

ih4urv0 s

pcri Qherads

fc4vlteS S O M . e.X Cl

k4KU

~l K 0(0."Trop

J ice z

be Jeep

MPU

ateveCe

\' .e

~\alhc)Sli kih )

Page 2: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

1/ 0 +o "hewwt"t -t rq%S~e.r

-through processor

Ofrec t I l o +o

Vheb%1oy y trc(,

r

froya m*ed

(o

i,%*-rrup& aril

s/o

ohA

Page 3: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

deli?

La~eKC~N..--

A

A%-,5

R 5 ~Kjin .ers we are

ahd

I aa re.t cct

6dt wtd

p riot i

eu;ld itviceS

Kteds

SevriCe.

s -t kt -t i wet b e f wcui

E w kc.ii

gj ujk t are the a ;K ~'"1P°KeK+S °I ( kv" j ?

d i 9 i }j 1&0C.0O~, kokawa41- delm s

o s o f +-w4we d e , '

+nt~~~ d e 'vi ceo vt'Pu } "

y

5'~ s}ewi / u~

J, N 4 f

#

~L C i.

a w Q rs~ `"0t Jl a}e

vt o f a SkeJ SiMP ( t -t o

a l s o

E va I v cat+ e pvod vcf

~Vartfi}ive perforjvtaKce paraItefcr 5

W e C a" rvttc AUre ova avr -'re

E,4gdacd b~ S fe M

kavtvOer

w ke„ tkc 1:10 devC ce

Servt CL i %

t'

q

v ,~,, /ee

a`~pdd M

(h; h'a+ed .

Page 4: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

DA T 6 ,rOU pU# or tbandwid+h

U prioriI

<i _e b +eS pe_ ,r second

that cam be proce5Seo

bj tkc s

fl cJha+ Siwu+s -eke t34 JwcJ+A

-}n5

ASS

(D 1lO jf%jire ccvf~ be. '6100

d z

coVAPuw Sof~~AA-f

b aoi call je4crw%ihes tke oYder of Sexvt •c°

ujke-K two of wore Yegve5~s `Lr f-

lM&L simuttccMeoU5ly-

(§) W

care tke issues +kQ+

~+

iS the wiwxiYAuw, Jat4 V 10 14J

(-AK C e f 1 pry or i f~

k, h

r~ori

Yc~'r~s+sk°) ld

a~F

5

.~e a I~ow Ld

o Su spend a low pYiors ,t

r t.qvest -t"4 i s currentl~ r~ein~ Pr°ces$e~

C2.

~I-vj

riori

to prevCKE wane Poll

eNGeA

w i Ak,, e s {-

S° f two

J s ka~d w aA9

pY~O~~

5

Page 5: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

s ffw

I/o s~KChroti; zc~~a~

~QW

l -1/0 d e vi cco

sf-a4e-5

O =DLC.

® A C Ti ve

IUfion)

( ai sa6(ea fiw .ciive)

*,v

u sua1( t o'91eo 6etww

1 1a a ev' ceo are vsva ttw

SkoIer tkan

Is d f fwcAe e_xe cu h'ci,

S~ V,CtiroKizafaM

coiN be in owe o

tGrce

.1/o d Cc-UV

2

ShS tol1"5 sO wkei

i puf c ,sce

htw i^p df

cteo4LS

plate ah2

h tal j 4 a

a vct i t 0.6 o

# ready c i+q

pro c.e* of

k

wcue E s of f u/

wA;ji kq car eac ~ 0 the r

~„

c. wtahKCv such tk4 J

property trc

p j - J .

Page 6: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

Figure 3.2The software must wait for the input device to be ready.

E) A}r raW S

.6) T iw-.L cov s f +wa4l-

V

g A Vq

Ye-S,

YescKE -)It evfKk

e

•b *'.1 cof I/o

0..C) VaKfa9PO of

j- /0 Pao fer

Zfo

u S O C4 uu by fFercc

ame Ivs ~~,~vf o i

a ton

Time

cPv 6oOkof

6 v F

l J sysk->,-~ -

confi~avJV

.

Page 7: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

Figure 3 .3 'The output device sets aflag when it has finishedoutputting the last data .

Output device

Software

Figure 3 .4

The software must wait for the output device to finish the previous operation .

a cdken o(tpOE

6x-

e .

T /o 3oun

vn 6 a f f{rcd

dexice 1 -5 d owa

^new da °'

Time

Output device completesoutput operation

Causes gadfly loopto complete

-I , f i $ r c4d~

s ` vs i(c, is

se f when ovfput

r G~~

CLCCC/

MO'G.dada

S 0 f~Woh4

rnu5L c\eart..IaI

Page 8: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

1oye cef (S

,3 kev

cpU i hi fi afed

y

tit av% s cc y

L3 aiv j c- 1/0 -' r ows ;c -r

w1 eckar-iswt5

1 /o i K ;ROf Cd

iPtkrruPf5

) M 1t

five +"echanisMs *a s he4 MPL/ (0 1/

o IiI;Kd c~cte

-

socfwdtt¢ s ;+K~t

wa~f-s

Qwkouht

of 'ti,sg

d

w~(t

CIO M p(e~e

CAf4tr tkaf

Sa flwaAL Ioa/)

s f-~ k s 6,,a r fikq

-to

-„> N'a S f'a f v S ih cd re/)orfrcd `Q--t'

--> J k e re 1-/o s p e e d5,46r&

9- 13rcIicfa-dl'

-f-A-4 { t h eCAS -f-kf,rr J d ht sI-Q /(/ S .

15

a

r

r~ (u 4 ~'C /i

S / i7/> /e

Cc n Gf

~'t z~:~

.rld

a /a

Page 9: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

0

G~bc

s o F+wutte

dew u s J 7 ,

S ~ vQ{~oks ' ,

sof fwa7;C

o r w4ens 1 .5 fe.

f~3 a ,,i

C ruci afl

pe rio J1 po~%~D

C kuSe

i.r fcrru1) / u/hc-q %f Aao T ew dgfa -

vSeS kahdwa a to cause spec(a.V

5 40 me -torte 5 w e cA n fi 9 ire tIN2 kaI dwmQ

iwter -t a ft1veSf ih+errvpfs opt 0

perioJec-

baPi5

1,l

e x e Cd l ' 0+4

v ses

pert 4041 ;

ckeck tit-

10

S I a+v s

s~fva ~oK 5 f ILd re y

v.' CC Jae5

re~vCS~s

to+raKs~cY v°1+°1 °I1 ~CC ~ I~

/1(14 ~ ~JH

are- 'IM,)°( l4A

~

i-e ihpuf device wi!(

u,clock

i h (ecru p f t o

w A-C~ k? - Gr/ e-

/a /en r;

Page 10: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

r

Next instructiom

(a) Programmed lio

Next in,(tUCtiuu

lbi Intcrrupt-dri%cn iio)

Figure 1.19 Three Techniques for Input of a Block of Data

'PU -4 uo

-4 DMAsomething

Do somethingelse

else

Next instruction

(c) Direct memory access

Page 11: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

I al92.hVn

4 !ID ("In

aqCPor"

d'~no~s

od+noW-1-Dj$101ua~~p~!+ro))F

AWdkd

ti40A3~vH~'~ sSnfb{Saatu!~tou s

aaa~.~

Wo9.rozImo-A9 :)'4'b &t AA03a)~~~pMJ(9IV4t C

Ptio»s.A-ad

"o o) pd wDo~a}U!ad

satppj

s,

fara~'.I_

T.,

-af"o-A

.9S,U%i0-i-4'

V,LVQIUUd

OD

Ual(V)20

-^od

km)0m

sWDO I

ua~4.4apnaroy o-o;n d4P°° ~.

a)f~a}u +

rn-} o s-0

pannbai d,LyQ

00

-.L?IOd ino me G

mo asindi-mndwoaoiaiyN

uMOb+.P%'b~°)J&121Poh:bi,Adoiddbs!64If.vno 3alZ)RZo

Y'w! 19

Page 12: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

Figure 3.6 A simpleA/D interface .

/Vofe

MicrocomputerPulse out

Input data PORT

GO

DATA available

-T t51 5

CahSijered

7GO

ADC In

DATA

cam-"'

av%ato

s 1 . 3 hj ((5,4 = h L 6 V)

A n A D C

co hve. ~+s

iv14O ~~ +

1o (M9

015 e

~~So ~ Co4 r

(~sOi{ c a+Q

'

avai(a 61e

~ h ~,;,~Q+Q

c.Qhversio~

5 µ S

I a. ~-Y

be c av 5 e -fi here

U

~ cnVersi0V1 I S C o ryl

to b e

b 1~K~

135 'Y\ o f\ O C

fih~

-~+f~'~q'`F

Page 13: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

ckecksSod+w°v`R" s b ~

~ '~ n

dev i ce

`aa Ps ~~ a C K

a•" ~

ev ~ cea~S tom°' (

YesRead (Input)

Data

Return

k rn ~s ~~~(~ t oQ P

~s~ arcced-tk~ d a~a

-t y aNs ~vr~c ~~~~~ ~ ev~ •c e

Page 14: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

VI lifer 13-MJ

Write DataBegin Output Proces

4

CRetum)

Output

Write DataBegin Output Proces

I

(etv!)

tower I%- k)

a (O IAIS c c f U k r -t o

Kwow exac+(' wkeh

-tke ou I-pu+ kao 6cevi

C40 1" pie kd

~kecnCC bed+AjeF~ poI(be

We cq~ c o~s~der a

y 5}e "l

9- fo II1„~ 4

C11-

C k ap_

t

w1, 5 -

r

Page 15: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

rigure 3.9 Twosoftware flowcharts formultiple gadfly outputs .

~~ -F4re& OLIf fdlS

glLfc_ S 4-x71. fed Tove1kea-

O%vAj w i ll o peraAe.

cov%Cvrr"'f

s,uw1 p 41Q„S

C P, prirt4e.r k1i(( be_ Yead?

MS afer ujri4e Jak O P ex

aJt

ini Jt'a11~ reudI .

e_xeco-h'an *MQ_ i s n e5li9ible ~ o

c o rrl f dtt9.,J t d

1 wt, s a F Pr'r` 4V'

20 Ar5suMR- 3 primers

CS) Prssuwtt sQffwaA~

Gadfly before output

C

Gadfly after output

A-14 ve- t k e_ s d f ¢wa/Le

(,JQ1+5 for tyre oufpuf

O V,P r ; ri her '(

t d PI'vti 5

becore s~anfir~~, i- he

a UIpU f vv,

pri rt}er -

'--e

three ov) puF

qv

doer Formfd

i

S 1~5 - f imeS S I acvcr

Page 16: •e · Figure 3.3 ' The output device sets a flag when it has finished outputting the last data. Output device Software Figure 3.4 The software must wait for the output device to

.5(M e f 6 I ( -rke rw

Sere Ce

Agure 3.10A software flowchart formultiple gadfly inputsand outputs .

'f d

d a~a

ova

ci xtd Priors 41

*C) rnpve

Zoo cinrv i ca

rtq,Vt rca

Busy

Busy

;h

1 / Q 8 W+ Ce

sleIVer.ce

Ready

aK J

\ Input/Output /Data 2

. •

..Device n

Input/OutputData n

I

Oilier functions

Ready

~ u c inter C acrd in0.~e

9, IA PU

s a PVS~ -calej

pet for w,

Tra„ c qtr o 4re or 4 S

Y- b b2c 1 16 -ate C CKIVo 11EJ do+~ trakSie~

U

Vkavrd S"A K%x

6r e- CoMIerVx 6%5+VC

t e ~~r~~+J