Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Serial Communications
Omid Fatemi
University of Tehran 1
Typical Interface Design
• Synchronous, Asynchronous
• RS-232 standard
• Hand shaking
University of Tehran 3
What is Serial Communications
University of Tehran 4
Serial Communication Types
• Asynchronous
• Synchronous
• Transfer:
– Simplex
– Half duplex
– Full duplex
University of Tehran 5
Transfer Types
University of Tehran 6
Asynchronous Data Framing
• Baud rate
• bps
University of Tehran 8
RS-232 Standard
• DTE
– data terminal equipment
– e.g. computer, terminal
• DCE
– data communication equipment
– connects DTE to communication lines
– e.g. modem
University of Tehran 10
DTE Connections
University of Tehran 11
Mechanical Characteristics
• 25-pin connector
– 9-pin connector is more commonly found in IBM-PC but it
covers signals for asynchronous serial communication
only
• Use male connector on DTE and female
connector on DCE
• Note: all signal names are viewed from DTE
University of Tehran 12
25-Pin RS232 Connector
Source: Duck, Bishop & Read, Data Communications for Engineers, Addison-Wesley
University of Tehran 13
9-Pin RS232 Connector
University of Tehran 14
Electrical Characteristics
• Single-ended
– one wire per signal, voltage levels are with respect to
system common (i.e. signal ground)
• Mark: –3V to –15V
– represent Logic 1, Idle State (OFF)
• Space: +3 to +15V
– represent Logic 0, Active State (ON)
• Usually swing between –12V to +12V
• Recommended maximum cable length is
15m, at 20kbps
University of Tehran 15
TTL to RS-232
University of Tehran 16
RS-232 Frame Format
Example
…
Start bit
0 b0 b1 bn p s1 s2
ASCII
Parity Stop bit
1111010000011
11 A
Idle
University of Tehran 17
RS232 Logic Waveform
University of Tehran 18
Function of Signals
University of Tehran 19
Function of Signals
University of Tehran 20
Flow Control
University of Tehran 21
Hardware Flow Control
• RTS/CTS
– the transmitting end activates RTS to inform the receiving
end that it has data to send
– if the receiving end is ready to receive, it activates CTS
– normally used between computer and modem
» computer is always ready to receive data but modem
is not, because terminal speed > link speed
University of Tehran 22
Software Flow Control
• Xon/Xoff
– when the buffer within the receiving end is nearly full,
Xoff is sent to the transmitting end to ask it to stop
– when data have been processed by the receiving end
and the buffer has space again, Xon is sent to the
transmitting end to notify it to resume
– advantage: only three wires are required (TD, RD and
GND)
– disadvantage: confusion arises when the transmitted
data (e.g. a graphics file) contains a byte equal to 13H
(Xoff)
University of Tehran 23
RS-232 (con)
Software Hardware
Handshaking
data Handshaking
Are you ready to
transmission RTS receive?
CTS
RTS
transmitter
receiver
CTS No
transmitter
receiver
x-off
x-on RTS
CTS Yes
TD
Send RD
data
character
transmission
University of Tehran 24
Null Modem Cables
University of Tehran 25
Null Modem Cables Examples
Source: Horowitz and Hill, The Art of Electronics, Cambridge University Press
University of Tehran 26
Other Standards
University of Tehran 27
8250/16450/16550 UART
University of Tehran 28
UART in PC
University of Tehran 29
Registers
University of Tehran 30
Registers
University of Tehran 31
Line Control
University of Tehran 32
Modem Registers
University of Tehran 33
Line Status
University of Tehran 34
Divisor Register
University of Tehran 35
Example
University of Tehran 36
Example 2
University of Tehran 37
Synchronous Protocols
University of Tehran 38
CRC
In SDLC:
G(X) = x**16 + x**12 + x**5 + 1
University of Tehran 39
8251 Block Diagram
University of Tehran 40
8251 Registers
University of Tehran 41
Mode Register
University of Tehran 42
Mode Instruction
(Asynchronous)
University of Tehran 43
Mode Instruction
(Synchronous)
University of Tehran 44
Command Register
University of Tehran 45
Status Register
University of Tehran 46
8251 Timing
University of Tehran 47
Summary
University of Tehran 48