Professional Documents
Culture Documents
Objectives
To understand how a differential interface works. To investigate
the RS422/RS485 data interface methods, identify their maximum
communication distance.
18
Figure 2.1. Signal in communication line, connected to the asymmetric
interface
19
Figure 2.2. Signal in communication line, connected to the differential
interface
magnetic field
straight cable
a
induced current
b
twisted pair cable
20
tance R, indicating resistive line impedance, the distributed capac-
ity C and conductivity G, indicating the line losses. These elements
depend on the length and therefore are marked by the nominal value
of the element per unit length, i.e.: nH/m pF/m Ω/m and S/m.
C G
R/2 L/2 L/2 R/2
C G
21
jZ L R
Z . (2.1)
(2.1)
jZC G
hereωZisisthe
Here theangular
angularfrequency.
frequency.
Wecancansee
see that jZ Lresistance
R
We that thethe Zline
line fullfull
resistance depends
. depends on frequen-
on the the frequency.
(2.1) At hig
10At
cy. Khz) thefrequencies
higher resistance of(greater jZ
the coil, C G
compared
than 10 KHz)tothe theresistance
wire resistance
of the r, is growin
the line also
coil, compared increases due to parasitic
R, is growing rapidly. The also
capacitance. it is per- growing mo
here Z istothetheangular
wire resistance
frequency.
conductance
meability G.line
therefore, when the to frequencies are high, r Itand is G can At
be ig
We of
canthesee also
that theincreases
line fulldue parasitic
resistance capacitance.
depends on the frequency. hig
line
also impedance
growing more can be calculated
rapidly compared by the
to following
the expression:
conductance G. There-
10 Khz) the resistance of the coil, compared to the wire resistance r, is growin
fore,
the when the frequencies
line also increases due are high, LR and Gcapacitance.
to parasitic can be ignored.
it isThen
also growing m
the transmission line impedanceZ AD can be. calculated by the following (2.2)
conductance G. therefore, when the C frequencies are high, r and G can be ig
expression:
line impedance can be calculated by the following expression:
L
Z AD . (2.2)
(2.2)
C
22
rs485
rs422
Y A
di d
di d
Z de
re
A
rO r
rO r
B
B
b
a
Figure 2.6. RS422 (a) and RS485 (b) transmitter / receiver schemes
Here:
D – driver;
R – receiver;
DI – driver input;
RO – receiver output;
DE – driver enable;
RE – receiver enable;
A – direct differential input / output;
B – reversal of differential input / output;
Y – direct differential output (RS422);
Z – reversal of differential output (RS422).
Additional control is needed for the transmitter / receiver when
using RS485 interface. When data is being transmitted, the receiver
must be switched off and when data is being received, the transmit-
ter should be powered off. Signals RE and DE are used for this. You
can connect the signals DE and RE and control the transmitter-re-
ceiver with a single signal.
RS422 and RS485 bus schemes are shown in Figure 2.7a and
2.7b. When using RS422, a single transmitter can be connected to
10 receivers. RS485 interface can be realized between 32 receivers
and transmitters in half-duplex mode. Resistors are connected at the
line ends for better performance (Rt = 100 ... 120 Ω).
23
It should be noted that the RS422 and RS485 standards do not
normalize information frame format and exchange protocol. The
most commonly used frame format is as in RS232 standard (the start
bit, data bits, parity bit (if needed) and stop bit). Most of the exchange
protocol is based on “master-slave” basis. One of the bus devices is
“master” and the others are “slaves”, which have different logical ad-
dresses. One of the most popular protocols is Modbus RTU.
rs485
A A
rt rt
B B
r r
d d
a
rs422
d rt
r r r
b
24
Table 2.1. The main parameters of RS422 and RS485 interfaces
Standard interface parameters RS422 RS485
Maximum number of transmitters /
1/10 32/32
receivers
Maximum cable length (link distance) 1200 m 1200 m
The maximum data exchange rate 10 Mb/s 10 Mb/s
Transmitter logic “1” level +2...+10 V +1,5...+6 V
Transmitter logic “0” level –2...–10 V –1,5...–6 V
Receiver input voltage range –7...+7 V –7...+12V
Receiver insensitivity range ±200 mV ±200 mV
25
converter u1 converter u2
5 10
T-/R-
T-/R-
8
8
4 9
T+/R+
T+/R+
rs232
rs232
7
7
3 8 1 2 3 4 5 6 7 8 9 10
GND
GND
dB9F
dB9F
6
6
2 7 1 2 3 4 5 6 7 8 9 10 X1
R-
R-
5
5
1 6
rs422/rs485
rs422/rs485
R+
R+
4
4
4 9 3
3
3
1 2 3 X2
2
2
~220V
~220V
1
1
QF1
~230V
50hz
26
Table 2.2. RS422 mode settings for the micro switches
Switch 1 Switch 2 Switch 3
S1.1 Off S2.1 Off S3.1 Off
S1.2 Off S2.2 On S3.2 On
S1.3 Off S2.3 Off S3.3 Off
S1.4 On S2.4 On S3.4 On
S2.5 On S3.5 Off
S2.6 Off S3.6 On
S2.7 Off S3.7 Off
S2.8 On S3.8 On
converter u1 converter u2
T-/R-
T-/R-
8
rs232
T+/R+
T+/R+
rs232
7
GND
GND
dB9F
dB9F
6
6
R-
R-
5
5
rs422/rs485
R+
R+
rs422/rs485
4
4
3
3
2
2
~220V
~220V
1
Turn the switch QF1. The PWR LED should ignite at both con-
verters.
27
All data transmissions will be carried out by using the
HyperTerminal program. It can be activated by following these
steps: Start→Accessories→Communications→HyperTerminal.
28
Figure 2.12. Additional information window
29
Figure 2.14. Port selection window
Click the OK button. The program will enter the setup screen
where you must select a transfer speed of 9600 bps and disconnect
the flow control Flow Control function.
30
Click the OK button. The light-emitting diodes DCD, DTR,
RTS and CTS must ignite and the main HyperTerminal program
window becomes the COM1 port monitoring window.
Re-activate the HyperTerminal program and repeat all the con-
figuration steps, but instead of selecting COM1 port, select COM2
port. Both port terminals on the computer screen can be positioned
as shown in Figure 2.16.
31
Figure 2.17. Receive File window
32
Table 2.3. RS422 interface data transfer results
Transmission Actual transfer
File size Transfer time
rate speed
1200 b/s
9600 b/s
38400 b/s
57600 b/s
33
T-/R-
T-/R-
8
rs232
T+/R+
T+/R+
rs232
7
GND
GND
dB9F
dB9F
6
6
R-
R-
5
5
rs422/rs485
R+
R+
rs422/rs485
4
4
3
3
2
2
~220V
~220V
1
1
Figure 2.19. RS485 interface converter connection scheme
34
converter u1
Orange with a white stripe
sound card
T-/R-
line in
Blue with a white stripe
T+/R+
rs232
7
Green
GND
dB9F
6
R-
5
rs422/rs485
R+
4
3
2
~220V
35
Figure 2.21. CoolEdit 2000 signal parameter window
converter u1 converter u2
T-/R-
T-/R-
8
rs232
T+/R+
T+/R+
communication
rs232
line equivalent
GND
GND
dB9F
dB9F
6
6
R-
R-
5
5
rs422/rs485
R+
R+
rs422/rs485
4
4
3
3
2
2
~220V
~220V
1
Green
36
Connect the sound card cable to terminal block X2. Green wire
must be connected to terminal 3, the orange with a white stripe to ter-
minal 1, and blue with a white stripe to terminal 2. When sending data
from COM1 to COM2, record the signals with CoolEdit 2000 program.
Set the data transfer rate to 9600 bps and the communication distance to
200 m, 800 m and 1600 m. Save results for the laboratory work report.
37
Literature
RS485, specifications and in depth tutorial [interactive], [watched
2011 06 02]. Access through the internet: <http://www.lammert-
bies.nl /comm/info/RS-485.html>.
EIA422 Bus Interface Description, RS422 [interactive], [watched
2011 06 02]. Access through the internet: <http://www.interface
bus.com/Design_Connector_RS422.html>.
38