DataComms

advertisement
DATA COMMUNICATIONS
•
•
•
•
•
•
•
Some organisations concerned with standards:
EIA - Electroonic Industries Association
(RS standards
including RS-232)
IEEE - Institute of Electrical and Electronic Engineers (IEEE
488-1978 parallel interface standard.)
CCITT - Consultive Committee in International Telegraphy - UN
body concerned with world communications standards.
ISO - International Standards Organisation
A communication standard is made up of several layers - (The
ISO proposes VII layers.) two of which are.
Physical Layer - Describing the design of the connectors and
the electrical characteristics of the hardware
Data Link Layer - Defines the protocol for data exchange
Data communication standards
•
•
•
•
•
•
•
•
•
•
•
•
Most data comms channels use serial pathways most common of
which are
1. CURRENT LOOP
2. RS232
Parallel channels include
3. Centronic interface
4. IEEE 488-1978
1. Current loop
Originally used for TTY (teletypewriter) equipment.
Logic 1 - Presence of current (20 mA or 60 mA as standard)
Logic 0 - Absence of current
Infrequently used today but it is still attractive as it can transmit at 9600
baud over cable lengths of 500m. Which is better than RS232. Fig.1.
shows a current loop interface for
full duplex communication
(simultaneous transmission and reception) between two TTL serial
ports.
+5 V
680
+5 V
4N 33
680

820

1W
Si
4N 33
T xD
I lo o p
74LS04
R xD
74LS04
U SAR T
U SAR T
-1 2 V
+5 V
+5 V
6 8 0
+1 2 V
6 8 0
R xD
T xD
74LS04
4N 33
I
4N 33
lo o p
1W
820

Si
4N 33
-1 2 V
O p to -is o la te d
U SAR T S
U p to 5 0 0 m a t 9 6 0 0 b a u d
Fig .1
Because the
current
transients can
couple noise
into adjacent
conductors,
sensitive lines
such as
telephone
cables should
not be routed
in the vicinity of
the current
loop.
CU R R E N T L O O P IN T E R F A C E - 2 0 m A o r 6 0 m A A S S T A N D A R D
The opto-isolators protect the USARTs from transients on the lines.
When the photo Darlington is ON the transmitter allows current to flow through the
loop and the receiver outputs a logic 1 via the 74LS04.
Note that the current loop power sources (+12 and -12 V) can be located at one
end of the cable. This is an advantage over some other schemes that require
power sources at both ends (receive and transmit) such as RS232.
RS232 Characteristics
•
•
•
•
EIA RS 232C (1969 and RS 232 D - 1986)
RS 232 used negative logic (true = Low).
An RS 232 driver must generate voltages of typically,
+5 to +15 V (logic LOW input)
(i.e. => logic 1 = negative = SPACE)
and
• (-5 to -15 V) (logic HIGH input)
(i.e. => logic 0 = positive =MARK)
• An RS232 receiver must present 3k to 7k load resistance, converting an
input of :
•
+3 to +25 V to logic LOW and
•
-3 to -25 V to logic HIGH
• As an example, the Intel 8051 micro controller is equipped with a full duplex
UART (Universal Asynchronous Receiver and Transmitter). This means
that it has the ability to receive and transmit at the same time. Serial
communication with the 8051 can be performed via Serial Communication
Chip (i.e. Maxim RS232 serial chip) on the RS232C line provided on the
micro controller.
• Communication equipment will be configured as DTE - Data terminal
equipment (i.e. Terminal) or as the DCE - Data communication equipment
(Modem)
RS232 – Characteristics continued
• **DTE - Data terminal equipment PC (i.e., male connector 9-pin)
•
DCE - Data communication equipment MPSU (i.e., female connector 9-pin)
• Serial data standards defined as RS-232C/D are as follows
•
•
Mode - single-ended
•
Max. number of drivers
1
•
Max. number of receivers
1
•
Max. cable length
15m
•
Max. data rates bits/s 20k
•
Transmit levels 5 V min 15 V max.
•
Receive sensitivity
3V
•
Load impedance
3k to 7k
•
Output current limit
500mA to Vcc or gnd
•
Driver Zout min (pwr off)
300
Following table shows all the important lines on the RS 232.
RS232 Handshake signals
Name
25pin
9-pin
DTEDCE**
Function as seen by DTE
Transmitted data
hand-shake
TD
2
3
data pair 1
RD
3
2
Received data
data pair 1
RTS
4
7
request to send
(=DTE ready)
handshake
Pair 1
CTS
5
8
clear to send
(=DCE ready)
handshake
Pair 1
DTR
20
4
data terminal ready
handshake
Pair 2
DSR
6
6
data set ready
handshake
Pair 2
DCD
8
1
data carrier detect
enable DTE input
RI
22
9
ring indicator
enable DTE input
FG
1
-
frame ground (chassis)
SG
7
5
signal ground
RS232 Connections, and wiring up serial devices
RS232 Pin Assignments (DB25 PC signal set)
•
•
•
•
•
•
•
•
•
•
Pin 1 Protective Ground
Pin 2 Transmit Data
Pin 3 Received Data
Pin 4 Request To Send
Pin 5 Clear To Send
Pin 6 Data Set Ready
Pin 7 Signal Ground
Pin 8 Received Line Signal Detector (Data Carrier Detect)
Pin 20 Data Terminal Ready
Pin 22 Ring Indicator
• The connector on the PC has male pins, therefore the mating
cable needs to terminate in a DB25/F (Female pin) connector.
RS232 Pin Assignments (DB9 PC signal set)
•
•
•
•
•
•
•
•
•
Pin 1 Received Line Signal Detector (Data Carrier Detect)
Pin 2 Received Data
Pin 3 Transmit Data
Pin 4 Data Terminal Ready
Pin 5 Signal Ground
Pin 6 Data Set Ready
Pin 7 Request To Send
Pin 8 Clear To Send
Pin 9 Ring Indicator
• The connector on the PC has male pins, therefore the mating
cable needs to terminate in a DB9/F (Female pin) connector.
Wiring up something nice and simple, for instance a plain old "dumb
terminal", is just a matter of connecting Tx, Rx and Ground, right?
Usually Not.
While the normal PC hardware might well run with just Tx, Rx and Ground
connected, most driver software will wait forever for one of the handshaking
lines to go to the correct level.
Depending on the signal state it might sometimes work, other times it might not.
The reliable solution is to loop back the handshake lines if they are not used.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
1.
TD and RD - Data transmit and receive lines.
2.
RTS and CTS Ready To Send : Out put by DTE to indicate that it is ready to send data
Clear To Send: Output by DCE to acknowledge RTS signal reception and
indicates that the DCE is ready to receive transmission.
3.
DTR, DSR, DCD Data Terminal Ready: Out put by DTE to indicate that it is ready to send data.
It can be used to switch a modem.
Data Set Ready: Output by DCE to acknowledge RTS signal reception and
indicates that the DCE is ready to receive transmission
Data Carrier Detect: Output by the DCE indicating that the modem has
detected a valid carrier. (i.e. a logic 1 signal)
4.
There are two grounds, Pin 1 = chassis, Pin 7 signal ground. (most machines
tie these together)
5.
The five signals (2 & 3) above that are not data are 'handshaking - type
control signals.
ST AR T
S e t D a ta T e rm in a l R e a d y
R e a d D a ta S e t R e a d y
No
Low ?
Yes
Set R eady T o Send
R e a d D a t a C a rrie r D e te c t
No
Low ?
Yes
R e a d C le a r T o
No
Low ?
T ra n sm it
Send
Connecting together two serial devices involves connecting the Rx of one
device to the Tx of the other, and vice versa. The diagram below indicates
how you would go about connecting two PC's together, without
handshaking.
Connecting two PCs together using RS232, without handshaking
When Handshaking is required, generally RTS of one device connects to
CTS of the other, and vice versa, and also DSR of one device connects to
DTR of the other device, and vice versa. The particular requirements for
different equipment may vary.
Connecting two PCs together using RS232, with handshaking
RS-232 Waveforms
• RS-232 communication is asynchronous. That is a clock signal is not sent
with the data. Each word is synchronized using it's start bit, and an internal
clock on each side, keeps tabs on the timing.
•
•
•
•
•
TTL/CMOS Serial Logic Waveform
The diagram above, shows the expected waveform from the UART when
using the common 8N1 format. 8N1 signifies 8 Data bits, No Parity and 1
Stop Bit.
The RS-232 line, when idle is in the Mark State (Logic 1).
A transmission starts with a start bit which is (Logic 0).
Then each bit is sent down the line, one at a time. The LSB (Least
Significant Bit) is sent first. A Stop Bit (Logic 1) is then appended to the
signal to make up the transmission.
The first step to connecting a device to the RS-232 port is to transform the
RS-232 levels into 0 and 5 Volts, AND, this is done by RS-232 Level
Converters.
the MAX-232. It includes a Charge Pump, which generates +10V and -10V
from a single 5v supply. This I.C. also includes two receivers and two
transmitters in the same package
Download