
P&I-Ch2: Protocols 1
ch. 2 giao thøc ghÐp nèi
(Interfacing Protocols)
Bao gåm:
- Giao thøc ghÐp nèi
- §Æc ®iÓm lËp tr×nh I/O

P&I-Ch2: Protocols 2
2.1. Interface Protocols:
•K/n: Lµ c¸c qui ®Þnh:
–Signals
–Data format
–Rate
–Error detection & correction
–Command & Response set
–Scenario (kÞch b¶n)
ISO 7 layer Model (Ref. Computer networks)
Cã thÓ ph©n chia thµnh 2 nhãm chÝnh:
•Transport-Oriented Protocols (1..4) (!!!)
–PhysicAL (wire, cable, connector, port), DataLink (CRC,
CS, Token), NetWork (Comm. 2 networks ), Transport
(Err-protected raw infor),
•Application-Oriented Protocols (5..7) :
–Session (Opening, End), Presentation (Common
Language) vµ Application (Read/Write, Start/Stop,
FileTransfer)

P&I-Ch2: Protocols 3
2.1. Interface Protocols: 2.1.1. Signals:
Khi thiÕt kÕ, x©y dùng ghÐp nèi m¸y tÝnh, cÇn chó ý
®Æc biÖt tíi tÝn hiÖu theo c¸c yªu cÇu:
•H¬n 1 thiÕt bÞ? => bus/m¹ng hay kh«ng ? => dïng bit
(tr−êng) ®Þa chØ.
•NÕu dïng bus => Standard bus hay kh«ng?
IDE vμLPT-mode 0 cables lμbus? t¹i sao?
•Data: Xa /gÇn, nhanh/chËm => Serial vs Parallel
•Xa: Daisy chain cho t/h hoÆc nguån cÊp...
•C¸c tÝn hiÖu ®iÒu khiÓn vµ tr¹ng th¸i:
•Control signals
•Status signals
•Handshaking signals - bắt tay

P&I-Ch2: Protocols 4
• Daisy chain:
–Nối các thiết bịcó khoảng cách từvài đến vài
chục m, đầu ra của port (module) thứn nối với
đầu vào của n+1
– Dùng cho tín hiệu (// & nt), nguồn cung cấp,
handshake...

P&I-Ch2: Protocols 5
2.1. Interface Protocols: 2.1.1. Signals:
•VÝ dô 1: PC-LPT handshaking:
PC
LPT port
Line Printer
SLCT SLTC_in
H×nh 2.1.a. LPT handshake
Signal