chuong 5 - giao tiep so

Download Chuong 5 - Giao Tiep So

Post on 12-Jul-2015

75 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

HOC VIN CNG NGH BU CHINH VIN THNG

CHNG 5:

GIAO TIP S

GIANG VIN: IN THOAI/EMAIL: B MN: HOC KY/NM BIN SOAN:

THS. PHAM TH DUY 0903661501 DUYPT@PTITHCM.EDU.VN IU KHIN VA X LY TIN HIU 02/2010

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NINI DUNG CHNG 55.1 Giao tip song song 5.1.1 Nguyn l 5.1.2 Cng lp trnh c 5.1.3 Centronics Port 5.1.4 Dual ported Ram 5.1.5 PCMCIA 5.1.6 Giao tip iu khin hin th LED, LCD 5.1.7 Encoder 5.1.8 Giao tip cng sut cao 5.2 Giao tip ni tip 5.2.1 Khi nim 5.2.2 Chun RS-232c/V24 5.2.3 Cng RS-232 5.2.4 Hayes Modemswww.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 2

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI

5.1 GIAO TIP SONG SONG5.1.1 Nguyn l 5.1.2 Cng lp trnh c 5.1.3 Centronics Port 5.1.4 Dual ported Ram 5.1.5 PCMCIA 5.1.6 Giao tip iu khin hin th LED, LCD 5.1.7 Encoder 5.1.8 Giao tip cng sut cao

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 3

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI

5.1.1 Nguyn lD QG OC

Cng m 3 trang thai

Cng cai

Hinh 5.1: Cac thanh phn tao nn cac cng vao ra song song c ban. - m cho phep -> vao = ra; khng cho phep ra high Z, Cai cho phep -> vao = ra; khng cho phep ra gi nguyn trang thai cu.www.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 4

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cac vi mach vao ra c ban.74LS244D0 Q0 D0

74LS373D Q G Q0

. . .D7

. . .

. . .Q7

. . .

OCGwww.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

OCTrang: 5

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NIKt ni cng ra c ban trong h thng vi x lyA19 A18 : A0 D7 D6 D5 D4 D3 D2 D1 D0 D0 D1 D2 D3 D4 74LS373 D5 D6 D7 LE Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 OE

8088 Minimum Mode

IOR IOW

A A A A A A A A A A A A A A A A IOW 1111119876543210 543210

: mov al, 55H mov dx, F000H out dx, al :Trang: 6

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NIKt ni cng vao c ban trong h thng vi x lyA19 A18 : A0 D7 D6 D5 D4 D3 D2 A0 A1 A2 A3 A4 A5 A6 A7 E IOR IOW B0 B1 B2 B3 B4 B6 B7 DIR 5V

74LS245 B5

8088 Minimum Mode

D1 D0

A A A A A A A A A A A A A A A A IOR 1111119876543210 543210

: mov dx, F000H in al, dx :Trang: 7

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NICu truc mt cng vao ra s kt hp

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 8

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cu truc mt cng vao ra s co bt tay

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 9

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI 5.1.2 Cng vao ra song song lp trnh c

Thit k co cc tin hiu bt tay vi thit b ngoai vi. Co th lp trnh thanh cng vao hoac cng ra Co th lp trnh trnh hoat ng nhiu ch khc nhau.

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 10

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI S khi b vao ra lp trnh 8255.Bus ni iu khin Nhom A m Bus D0 D7 d liu Nhom A Cng A PA0 PA7

Nhom A Cng C (cao)

PC0 PC3

RD WR A0 A1 Reset CS

Logic iu khin oc ghi

iu khin Nhom B

Nhom B Cng C (thp)

PC4 PC7

Nhom B Cng B

PB0 PB7

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 11

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NITin hiu iu khin cac ch hoat ng cua 8255

CS A0 A1 RD WR

Ch hoat ng

10 0 0 0 0 0 0 0

X0 0 0 0 1 1 1 1

X0 0 1 1 0 0 1 1

X0 1 0 1 0 1 1 0

X1 0 1 0 1 0 0 1

Khng chon machoc PA Ghi PA oc PB Ghi PB oc PC Ghi PC Ghi t iu khin CmTrang: 12

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI T iu khin cua 82550 x x x C2 C1 C0 S/R

Hinh 5.8: T iu khin lp xoa bit cng C cua 8255.

1 MA1 MA0 A CH MB B CL Hinh 5.9: T iu khin chon ch cua 8255.

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 13

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NIKt ni bt tay 8255 ch 1D0 D7 PA0 PA7 INTEA PC7 OBFA PC6 ACKA PA0 PA7 STBA PC4 IBFA PC5 INTEA D0 D7

WR INTA PC3 INTEB

RD

INTA PC3 STBB IBFB OBFB ACKB PC2 INTEA PC1

PC2 PC1

INTB PC0 RD PB0 PB7 PB0 PB7 PC0

INTB

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 14

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cac tin hiu bt tay cng truyn ch 1 OBF (Output Buffer Full): ngo ra tc ng mc thp khi b m ngo ra y. Ni ti STB cua cng nhn, cht d liu vao cng nhn. ACK (acknowledge): ngo vao, mc thp bo cng truyn bit cng nhn a nhn xong d liu, luc nay cng truyn co th truyn tip mt d liu khc. INTR (interrupt): ngo ra tc ng mc cao thng bo mt byte CPU ghi ti cng truyn a c truyn xong ti thit b. Tin hiu nay co th s dung yu cu ngt CPU ghi ti mt d liu khc. INTE (Interrupt Enable): la c cho phep ngt truyn bn trong 8255, no co th lp xo bng bit PC5 cho cng A va PC6 cho cng B (khi truyn). Khi INTE b xo, yu cu se khng c gi ti CPU khi 8255 truyn xong mt d liu.www.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 15

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI inh thi cac tin hiu iu khin cho PA ch 1WR OBFINTR ACK

Data Out

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 16

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NICac tin hiu bt tay cng nhn d liu trong ch 1 STB (Strobe): ngo vao, khi tc ng d liu trn cc ng ni ti cng vao se c cht vao b m ngo vao cng. Tin hiu nay c cp t OBF cua cng truyn. IBF (Input Buffer Full): ngo ra tc ng mc cao thng bo d liu a c cht vao b m nhn, tin hiu nay chi c xo khi CPU oc d liu. INTR (Interrupt Request): la tin hiu yu cu ngt, thng bo cho CPU bit a co mt d liu sn sang CPU oc, tin hiu nay chi c xo khi CPU thc hin mt chu ky oc keo tin hiu RD cua no xung mc thp. INTE (Interrupt Enable):c cho phep ngt trong 8255 c lp xo thng qua vic lp xo bit PC4.www.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 17

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI inh thi cac tin hiu bt tay ngo vao ch 1.Data IN

STB

IBF INTR RDwww.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 18

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Kt ni truyn d liu ch 2 cua 8255D0 D7 PA0 PA7 INTEA PC7 WR RD PC6 OBFA ACKA STBA IBFA PA0 PA7 INTEA PC4 PC5 RD WR D0 D7

INTEB

PC2 PC1

STBB IBFB

OBFB ACKB

PC1 PC2

INTEA

INTA

PC3 GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

PC3

INTA

www.ptit.edu.vn

Trang: 19

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI inh thi tin hiu bt tay trong ch 2.WR OBF INTR ACK STB

IBF

Data RD

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 20

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI5.1.3 Cng vao ra song song LPT (Centronics Port)

Tin thn do hang Centronics pht trin nm 1970, chun ho thanh IEEE 1284 hay LPT. Co 3 chun: SPP - standard parallel port: 5-150KBps, mt chiu cho d liu, nhn 4 bit mt ln. EPP - enhanced parallel port: hai chiu nhanh hn SPP ECP - Extended capabilities port: hai chiu chim 1 knh DMA.www.ptit.edu.vn GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU Trang: 21

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NICng SPP

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 22

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cac tin hiu trn cng may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 23

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cac tin hiu trn cng may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 24

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Kt ni cac tin hiu vi may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 25

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Cac tin hiu bt tay trn cng may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 26

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI ia chi cng may in trn may tinh

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 27

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Kt ni cac thanh ghi ti cng may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 28

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Thanh ghi d liu cng may in

www.ptit.edu.vn

GIANG VIN: THS. PHAM TH DUY B MN: IU KHIN VA X LY TIN HIU

Trang: 29

BAI GIANG MN

THIT BI NGOAI VI VA KY THUT GHEP NI Thanh ghi trang thai cng may in

www.ptit.edu.vn