e01a048.PDF
(
68 KB
)
Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
GENERAL
INTEREST
RS485 Meets CAN
two systems on one bus
By K. J. Thiesler
The new TTP/A (Time Triggered Protocol type A) field bus technology
embraces both RS485 and CAN and is now being introduced into auto-
motive and process control applications.
The TTP/A protocol allows a CAN bus device
and an RS485 transceiver to work together in
the same system. Originally, the CAN bus
was designed for use in automotive applica-
tions, while the RS485 bus was designed for
process control applications. In this article we
will show how to operate the two systems on
a single bus at data rates up to 1 Mbit/s.
CAN and RS485 use a practically identical
data transfer medium: both systems send
data differentially over twisted-pair cable.
The signal levels, however, are different, and
so communication errors will occur of the two
systems are connected directly.
edges with bus frequencies up to
12 Mbit/s. A disadvantage is that an
enable input is required to turn the
output driver on and off.
Figure 2
gives a comparison of
the absolute bus voltage levels. The
values shown are only indicative:
they will vary depending on how the
components on the bus are con-
nected. In contrast, the relative val-
ues shown in
Table 1
are the maxi-
mum and minimum values specified
for the transmission protocol to allow
all devices on the bus to communi-
cate with one another. The maxi-
mum length of the bus depends on
the transfer rate. The absolute maxi-
mum is 1200 m at a data rate of
93.7 kbit/s with at most 32 devices
on the bus. With the aid of repeaters
(signal amplifiers) four groups of 32
devices can be connected together.
Examples of RS485 interface devices
are the SN75176 from Texas Instru-
ments and the MAX485 from Maxim.
ENABLE
+5V
TxD
A
RxD
B
GND
010081 - 11
Figure 1. Internals of an RS485
transceiver.
RS485
The bus topology is strictly linear, and a ter-
mination resistor of around 120
level. A low level (logic 0) corre-
sponds to a positive differential sig-
nal (U
CAN H
> U
CAN L
) and uses the
dominant bus voltage level. A high
level (logic 1) corresponds to a small
differential signal (U
CAN H
≈
is required
at either end. An RS485 driver chip contains
two push-pull output stages that drive the
low and high signals onto the bus with low
output impedance. When transmitting, the
TxD output stage is enabled via its enable
input; in the quiescent condition the output
stage is switched to a high-impedance mode
to allow other devices on the bus to transmit.
Figure 1
shows the internals of an RS485
transceiver.
A digital signal at the input is converted
into a differential signal on the bus. A high
level (logic 1) corresponds to a positive differ-
ential signal (U
A
>U
B
), while a low level
(logic 0) corresponds to a negative differential
signal (U
A
<U
B
). In RS485, the two states use
the same voltage levels. This symmetrical fea-
ture enables the transmission of clean pulse
Ω
U
CAN L
),
using the recessive bus voltage
level.
Figure 3
shows the internals of
a CAN interface chip.
The dominant ‘L’ level can override
the recessive ‘H’ level without colli-
sion or interference. Hence no enable
signal is required. The rather higher
output impedance, however, limits
the maximum communication rate to
1 Mbit/s.
Physically, the CAN bus looks
exactly like the RS485 bus. It con-
sists of a twisted-pair cable that
must be terminated at both ends
with 120
CAN
The CAN bus was developed by
Bosch and Intel in 1981 for network-
ing electronic modules in cars. Since
then it has found use outside its orig-
inal domain and established itself in
consumer devices and in industrial
control. The communications proto-
col defines the CAN signal using a
‘dominant’ and a ‘recessive’ voltage
Ω
resistors to obtain a typ-
48
Elektor Electronics
10/2001
GENERAL
INTEREST
ical impedance of 120
.
The absolute and relative signal levels are
shown in
Figure 4
and
Table 2
. Here also it is
only the differential values that are important;
the absolute voltages are only indicative and
can vary depending on the devices connected
to the bus and its topology.
The physical length of the bus depends on
the special arbitration method of the CAN
bus, and the signal propagation delays limit
the possible length. At a communication rate
of 1 Mbit/s the maximum allowable length is
30 m, while at 62.5 kbit/s it is 1000 m.
Well-known CAN bus transceiver devices
include the SN75LBC031 from Texas Instru-
ments and the PCA82C250 from Philips.
Ω
U
abs
V
U
diff
V
5.0
1
0
Transmitter
Receiver
4.0
2.0
2.0
1
1
B
3.0
1.5
1.5
U
diff
2.0
1.0
A
1.0
0.5
0.2
-0.2
0
0
-0.5
-1.0
-1.5
-1.5
0
0
-2.0
-2.0
absolute level
relative level
010081 - 12
Figure 2. RS485 bus levels.
For operation, only differential values are relevant, and these are the same for all
devices. In contrast the absolute values play only a secondary role. Their values can
vary within broad limits depending on the device and load and even between devices of
the same type.
Interconnection
CAN and RS485 are rather similar. Differential
signalling is used in both systems. The sig-
nal levels, both absolute and differential, par-
tially overlap. The data transmission medium
is identical, with allowable impedance
between 100 Ω and 120 Ω. The RS485 driver
consists of two push-pull output stages. In
the CAN transmitter two open-collector tran-
sistors drive the signal onto the bus.
Because of the symmetry of the outputs,
an RS485 network can operate at a signifi-
cantly higher data rate than a CAN network.
In summary, the two standards only differ
significantly in the bus signal levels. A CAN
receiver can understand the levels of the
RS485 protocol without modification; how-
ever, in the opposite direction errors will
occur in the transmission. An RS485 receiver
will recognise correctly only the ‘L’ level of the
CAN transmitter. The CAN ‘H’ level, by con-
trast, is undefined in the RS485 system.
In order to get the RS485 receiver to under-
stand the CAN ‘H’ level, it must be offset neg-
atively by at least 0.25 V. This can be
achieved with a 470
Relative RS485 bus levels
U
DIFF
‘H’ level
‘L’ level
Receiver
0.2 to 2.0 V
–0.2 to –2.0 V
Transmitter
1.5 to 2.0 V
–1.5 to –2.0 V
+5V
CAN H
TxD
120
Ω
120
Ω
RxD
CAN L
typical impedance 120
GND
010081 - 13
Figure 3. Internals of a CAN transceiver.
U
abs
V
U
diff
V
5.0
dominant
0 level
recessive
1 level
pull-down resistor. In
order to make the signal levels once again
symmetrical about approximately 2.5 V, the
CAN ‘L’ level must be raised by the same
amount, by fitting the CAN ‘L’ wire with a
470 Ω pull-up resistor.
A difficulty is caused by the enable input,
which causes the RS485 interface to be dis-
abled during reception by switching off the
push-pull output stages. By changing the
input circuit to the RS485 interface device we
can put the output into a tristate condition,
effectively converting it into an open-collec-
tor output stage. The enable input serves as
the data input, and the TxD input is held low.
For a logic 1 the output turns on and drives
the logic 0 signal from the TxD input onto the
bus. For a logic 0, the output stage turns off
an the two outputs go to a high impedance
Ω
Transmitter
Receiver
4.0
2.0
2.0
0
0
3.0
CAN-H
1.5
1.5
U
diff
CAN-L
2.0
1.0
0.9
1.0
0.5
0.5
1
0.050
0
0
1
-0.5
-0.5
-1.0
absolute level
relative level
010081 - 14
Figure 4. Relative and absolute bus levels.
Relative CAN bus levels
U
DIFF
recessive ‘H’ level
dominant ‘L’ level
Receiver
0 to 0.50 V
0.90 to 2.00 V
Transmitter
0.05 to –0.50 V
1.50 to 2.00 V
10/2001
Elektor Electronics
49
GENERAL
INTEREST
state. Compared to the original communica-
tions protocol, the outputs are now inverted.
If we exchange the A and B outputs, the
inversion is undone.
Figure 5
shows the full
circuit of how the buses are linked.
+5V
+
470
Ω
B
RxD
B
CAN H
RxD
RS-458
CAN
120
Ω
120
Ω
In Summary
With two added resistors and the modified
input circuit to the RS485 driver IC the prob-
lem is solved. We no longer have dominant
and recessive signals. This unified field bus
system might be called ‘biased CAN’. Baud
rates of 1 Mbit/s present no problems.
Despite the increased load due to the cou-
pling resistors the signal edges do not suffer.
Without the external pull-up and pull-
down resistors the network has an imped-
ance of 60 Ω, and with the resistors an
impedance of 48
TxD
TxD
A
CAN L
A
470
Ω
ENABLE
010081 - 15
Figure 5. ‘Biased CAN’ field bus with tristate control of RS485 output stage.
470
resistors can be clearly seen
on the voltage difference between
the two lines, which is around –0.3 V.
Otherwise the two lines would be
Ω
affected by both the recessive CAN
‘H’ level and the (disabled) RS485
high level.
Ω
. The effect of the two
(010081-1)
50
Elektor Electronics
10/2001
Plik z chomika:
gasma
Inne pliki z tego folderu:
bge.jpg
(26 KB)
detail1.htm
(5 KB)
detail2.htm
(4 KB)
detail3.htm
(4 KB)
detail4.htm
(6 KB)
Inne foldery tego chomika:
1974
1975
1976
1977
1978
Zgłoś jeśli
naruszono regulamin