28-09-2016, 02:22 PM
1456597690-ELEG3924ch10.pdf (Size: 971.8 KB / Downloads: 52)
Serial communication v.s. parallel communication
– Computer transfer data in two ways: parallel, serial
– Parallel communication
• 8 or more parallel lines are used to transfer data
– E.g. connecting 8051 to LCD, data bus, connecting to hard drive
• More data can be transferred in unit period of time
• Usually used for short distance data transfer
– Long parallel wires function like antenna, and will leak signal during Tx
– The leaked signals will cause mutual interference for signals in wire (cross-talk)
– Serial communication
• Use 1 data line to transfer data
– Data is transmitted 1 bit a time
• Usually used for data transfer over longer distance
SERIAL COMMUNICATION: DUPLEX
• Simplex, Half-duplex, and full-duplex
– Simplex: communication can occur in only one direction (A B)
• E.g. pager, broadcast radio
– Half-duplex: communication can happen in both directions, but only one at a
time (A B, or B A, but not simultaneously)
• E.g. Police radio (walki-talki)
• Only 1 channel (data line) is enough
– Full-duplex: communication can happen in both directions simultaneously
• E.g. telephone
• Two channels (data lines) are required.
• Full-duplex = two simplex
SERIAL COMMUNICATION: ASYNCHRONOUS
• Asynchronous serial communication
– Data is transmitted in bursts without following a specific clock
• Data can be transmitted at any time.
• Synchronous transmission: data can only be transmitted at special instants
– When there is no data, channel remains constant to indicate “idle” (no information).
• e.g. some system use “high” voltage to indicate idle
• How does the receiver tell the difference between “idle” and “11111111”?
– Framing
• Data characters are placed between start and stop bits
• Start bit: 1 bit (e.g. low)
• Stop bit: 1 bit (e.g. high), or, 2 bits (e.g. high, low)
• E.g. 8-bit ASCII + 1 start bit + 1 stop bit = 10 bits/frame
SERIAL COMMUNICATION: TRANSFER RATE
• Transfer rate
– Bit rate
• Number of bits that can be transferred in unit time (1 second)
• Unit: bps (bit per second), Kbps (kilo-bit per second), Mbps (mega-bit per
second), Gbps (Giga-bit per second), Tbps (Terra-bits per second)
– Terminology conventions
• For storage space (RAM size, ROM size, disk size)
– 1 kilo = 2^10, 1 mega = 1^20, 1 giga = 1^30
• For data rate
– 1 kilo = 1,000, 1 mega = 1,000,000, 1 giga = 1,000,000,000
– Baud rate
• The number of symbols that can be transferred in unit time (1 second)
• For some systems, 1 symbol = 1 bit, for some other systems, 1 symbol
can be used to represent multiple bits (e.g. 1 symbol = 8 bits)
SERIAL COMMUNICATION: STANDARD
• Communication standard
– A set of rules that must be followed by communication devices
• To ensure that communication devices from different manufactures can
interoperate with each other
– Example rules:
• Which voltage used to represent „0‟, which voltage used to represent „1‟
• How many start bits, how many stop bits
• Which voltage(s) used for start bits, which voltage(s) used for stop bits
• How many bits in one frame (7 bits, 8 bits, 10 bits, …)
• The format of control signals, how many control pins
– Example standards
• RS232, IEEE 802.11 (WiFi), IEEE 802.16 (WiMax), WCDMA, ……
• RS232
– The most popular serial communication standard
– Developed by Electronics Industries Association (EIA) in the 1960s‟
– Still widely used today
7
SERIAL COMMUNICATION: RS232
• DTE v.s. DCE
– DTE: data terminal equipment (e.g. PC)
– DCE: data communication equipment (e.g. modem, switch, router, and other
communication device)
– DTE and DCE have different pin definitions
• RS232 connectors
– DB-25 25-pin connector
– DB-9 9-pin connector
– Pin definition for DTE
• We can either use all 9 pins, or just use
3 pins: TxD, RxD, GND
• TxD: transmit data
• RxD: receive data
• GND: signal ground
• The remaining pins are for more
sophisticated conrols
8
SERIAL COMMUNICA