Sei sulla pagina 1di 5

ARTICLE

DELIVERING ROBUST COMMUNICATIONS

CAN vs. RS-485: Why CAN Is on the Move


By Robert Gee, Executive Business Manager, Core Products Group, Maxim Integrated

Both RS-485 and controller area network (CAN) interface handle all of the complex systems within an automobile. Back in
protocols have been around since the mid-1980s, when they the ‘90s, many auto manufacturers started transitioning from
were introduced as communication standards. RS-485 was an mechanically controlled automatic transmission shift points to
evolutionary step from previous transceiver (physical layer) electronically controlled shift points based off of data collected
standards like RS-423, RS-422, and RS-232. RS-485 enabled by speed, throttle position, and barometric sensors and fed to
systems to have multiple master nodes in a single system. the microcontroller. Today, there are more than 100 sensors and
Around the same time as these commonly used interfaces microcontrollers per vehicle, with many of them talking CAN.
were being used in applications such as computer keyboards Even the full electric vehicle Tesla S has 65 microcontrollers2.
and mice, printers, and industrial automation equipment, the In the industrial market, CAN adoption is also increasing.
CANbus interface was being developed as an automotive Industrial CAN applications have a wide reach and are used
communication platform (by Robert Bosch GmbH) to reduce anywhere from commercial drones to elevator lift controls to
cost in automobile manufacturing. It was considered an commercial-grade lawn mowers. IC suppliers are recognizing
alternative to the conventional, large multi-wire looms needed this and developing products to address the ever-increasing
in automobiles, simplifying cabling and taking advantage of need for CAN outside of the automotive market. Other
multi-node buses. In fact, when it was first introduced on a contributors to the rising use of CAN in the industrial space
BMW 850 in 1986, the automotive CAN interface saved over could be the theory that many automotive engineers have
2km of cabling! On top of that, the number of connectors was moved over to the industrial segment, bringing with them the
significantly reduced and the estimated weight savings in cable expertise of CAN and its unique benefits. There’s certainly
and connector alone was 50kg1. RS-485 was defined for the credence to this theory, especially given that the job markets in
industrial market, while CAN was primarily developed for the Detroit and other automotive mainstays were weak due to US
automotive/vehicle/transportation segment. Since its release, recessions during the early 1990s and early 2000s. Another
the CANbus interface has slowly been adopted to applications reason for CAN adoption in the industrial market is due to its
outside of the automotive and aerospace industries. inherent fault tolerance and the way it handles frame messages
Due to its robustness in harsh electrical environments, fault on a multi-node bus.
protection capabilities, and unique message handling, CANbus To explain the advantages of CAN over RS-485, it is best to go
is being adopted into many applications where it has never over the similarities and differences between the two standards,
been used. Current market trends show an ever-increasing the ISO-11898-2 and TIA/EIA-485, respectively. Both standards
adoption of CANbus, even replacing the RS-485 in traditional define the electrical components of the transceivers and are
industrial applications. According to available market reports, represented in the diagram (Figure 1) below for the transmit
CANbus usage is growing at a high single-digit rate, which is side.
exceptional for the interface market. Although reports do not
split out the industrial and automotive markets, many agree Both protocols feature differential outputs. The RS-485 output
that industrial markets make up around 20-30% of the total is a classical differential signal where one signal is the inverted,
market units. Growth within the automotive industry can or mirror, version of the other. Output A is the non-inverting line
be attributed to the increase of electronics used in vehicles and output B is the inverting line. The differential range from
today. Modern automobiles have complex microprocessing +1.5V to +5V is a ‘1’ or mark and -1.5V to -5V is a ‘0’ or space.
systems used for functions like back-up cameras, self-parking, The area between -1.5V and +1.5V is undefined. It's good to
infotainment, blind spot awareness, and more. The emergence note that when RS-485 is not driven, it is in a high impedance
of these automotive sub-systems stems from the increasing state. For CAN, the output differential is slightly different where
number of in-vehicle sensors and microcontrollers needed to the two outputs, CANH and CANL data lines, are a reflection

www.maximintegrated.com/CAN 1
RS-485 DRIVER CAN DRIVER
B - INVERTING CANH
0.8V to 2.2V 2.75V to 4.5V

2V to 3V

A - NON-INVERTING -0.8V to -2.2V 0.5V to 2.25V


CANL
DOMINANT RECESSIVE

OUTPUT DIFFERENTIAL OUTPUT DIFFERENTIAL


+5V +3V
VALID DOMINANT
+1.5V +1.5V
0V UNDEFINED
UNDEFINED
-1.5V
+12mV
VALID
RECESSIVE
-5V
-120mV

Figure 1. Comparison of Output Differentials for RS-485 and CAN Drivers

of each other as depicted and represent opposite logic. In the and +3V, while the recessive mode is in between -120mV and
dominant state (a zero bit, used to determine message priority), +500mV. When the bus is idle or when it's not loaded, the
CANH-CANL are defined to be logic ‘0’ when the voltage across transceiver is in a recessive state where CANH and CANL must
them is between +1.5V and +3V. In the recessive state (a 1-bit be between 2V and 3V. Both RS-485 and CAN have room for
and the state of the idle bus), the driver is defined to be logic margin in applications where the signal can be attenuated by
‘1’ when differential voltage is between -120mV and +12mV, or the quality (shielded or unshielded) or length of the cables,
when it is near zero. For the receiver side, the RS-485 standard which may affect the capacitance of the overall system. See
defines the input differential to be in between ±200mV to +5V. Figure 2 for a comparison of receiver input differentials for
For CAN, the input differential signal is between +900mV RS-485 and CAN receivers.

CAN RECEIVER RS-485 DRIVER


CANH
B - INVERTING

A - NON-INVERTING
CANL
DOMINANT RECESSIVE

RECEIVER DIFFERENTIAL RECEIVER DIFFERENTIAL


+3V
DOMINANT VALID
+900mV +200mV
0V UNDEFINED
+500mV
-200mV
RECESSIVE VALID
-120mV

RS-485 DRIVER CAN RECEIVER


CANH
B - INVERTING

A - NON-INVERTING
CANL
DOMINANT RECESSIVE

RECEIVER DIFFERENTIAL RECEIVER DIFFERENTIAL


+3V
VALID DOMINANT
+200mV +900mV
0V UNDEFINED UNDEFINED
-200mV +500mV
VALID RECESSIVE
-120mV

Figure 2. Comparison of Receiver Input Differentials for RS-485 and CAN Receivers

www.maximintegrated.com/CAN 2
Additionally, both standards have termination resistors of the protect the devices from accidental shorts between a local
same 120-Ω value at the ends of the network, to match the power supply and the data lines of the transceivers. Maxim ICs
characteristic impedance of the transmission line and avoid provide industry- leading fault protection levels of ±80V with
reflection. Other specifications, such as data rate and the even some extra margin before breakdown of the protection,
number of nodes, are helpful references as opposed to strict and this level of protection is present whether the transceiver is
parameters. Plenty of RS-485 and CAN transceivers exceed the powered or un-powered.
standard in terms of bandwidth and the allowable number of One of the major reasons for industrial applications to design
nodes, in order to meet the demands of the market. RS-485, in CAN versus RS-485 transceivers is how messages are
such as the MAX22500E from Maxim, has reached speeds of handled on the bus. In a RS-485 system with many nodes
100 Mbps. Even though the new CAN-FD standard, ISO 11898- communicating to the microprocessor, there may be instances
2:2016, defines certain timing characteristics at 2Mbps and where there are several messages sent out from multiple nodes
5Mbps, the standard does not cap the data rate at 5Mbps. CAN onto a bus simultaneously that may result in a collision of
transceivers will exceed the standard in the same way as RS-485 messages, otherwise known as contention. When this happens,
transceivers. The common-mode range (CMR) is -7V to +12V the bus state could possibly be invalid or indeterminate, causing
for RS-485 and -2V to +7V for CAN. Many applications need data errors. Furthermore, contention could damage or degrade
a wider CMR performance from both of these interface types. the signal performance when multiple RS-485 transceivers
This is due to the fact that they are mainly used for multiple node on the bus are in one state and one single transceiver is in the
buses that may use differently sourced power transformers, or opposite state. In such a condition, the lone RS-485 would
because the cabling is in close proximity to equipment with large cause significant current draw that would likely cause thermal
enough fields that can affect the grounding between systems. shutdown of the IC or permanent damage to the system This is
Given the many different harsh industrial applications, high where CANbus has a big advantage over the RS-485 protocol.
CMR is often needed beyond the standard levels of just -7V to With CANbus, there is a way to resolve multiple messages
+12V. To address this problem, there are new RS-485 and CAN on the line by way of ranking each message. Prior to bringing
transceivers that have a wide common-mode range of ±25V. the system up, different faults are assigned different priorities
The diagram below shows a fluctuating common mode range by the system engineer. Earlier, it was mentioned that CAN
of a RS-485 transceiver. Despite the common-mode voltage had a dominant and recessive state. During contention, the
signal going up and down, as long as the common-mode voltage message with the most consecutive dominant state ‘wins’ and
(VCM) is within the proper range, the differential bus signal is not will continue to transmit, while other nodes with lower priority
affected and the receiver is able to accurately receive the signal will see the dominant bit and stop transmission. This method
without degradation. The diagram in Figure 3 shows a varying is called arbitration, where the messages are prioritized and
common-mode range within the range for RS-485. received in an order of status. A node that loses arbitration will
Another feature common in both CAN and RS-485 transceivers resend its message. This continues for all nodes until there is
is fault protection. Fault-protected devices have an internal one node left transmitting. Here, in Figure 4, is a closer look at
overvoltage circuit on the driver output and receiver inputs to the format of the CAN message data frame; the diagram and
table below show where arbitration happens.

V CC
V CM=(V A+V B)/2
DE V CC RE

V Y
Rt
DI D R RO

12 A
Rt
RO R D DI

8
B

RE GND
±7 GROUND GND DE

4 DIFFERENCE

t
COMMON MODE
-4 VOLTAGE

-8

Figure 3. Common-mode Range (CMR) of an RS-485 Transceiver

www.maximintegrated.com/CAN 3
COMPLETE CAN FRAME
ARBITRATION FIELD CONTROL DATA CRC FIELD END OF FRAME

ACKNOW. DELIMITER
START OF FRAME

ACKNOW. SLOT BIT


11 4 8 15

CRC DELIMITER
REQU. REMOTE
ID EXT. BIT
RESERVED

CRC10
CRC14

CRC12
CRC13

CRC11

CRC0
CRC4
CRC8
CRC9

CRC6

CRC2
CRC7

CRC5

CRC3

EOF0
EOF4
EOF6

EOF2
EOF5

EOF3
CRC1

EOF1
ID10

DB0

IFS0
DB4
DB6
DL0

DB2
DB7

DB5

IFS2
DB3
DL2
DL3

DB1

IFS1
ID0
ID4
ID8

DL1
ID9

ID6

ID2
ID7

ID5

ID3

ID1
DATA
0000000 1 0 1 000000 00 1 0 000 000 0 1 0000 1 1 0000000 1 0 1 1 1 1 1 1 1 1 1 1 1
CAN
HI
CAN
LO

Figure 4. CAN Message Data-Frame Format

Field Name Bit Description Identifier Bits (Arbitration Files)


Length Start 10 9 8 7 6 5 4 3 2 1 0
SOF 1 Start of frame Bit
Identifier 11/29; Represents the message Node 1 0 0 0 0 0 0 0 0 0 1 1 1
(green) 12/32 priority (11 or 29 bits for
Node 3 0 0 0 0 0 0 0 0 1 Stop
standard CAN and extended
Transmitting
CAN; 12 or 32 bits for CAN-FD)
RTR (blue) 1 Remote transmission request Table 2. Node 3 Loses Arbitration to Node 1 at Bit 3

IDE 1 Identifier extension bit


In addition to arbitration, the data link layer (layer 2 of the OSI
r0 1 Reserved bit for future protocol model) also contributes to the robustness of the overall CAN
expansion
system. In this layer, the frame message is repeatedly checked
DLC (yellow) 4/8/9 Code for number of data bytes for accuracy and errors. If a message is received with errors, an
(4-bit for standard CAN; 8 or 9 error frame is sent out. The error frame consists of two different
bits for CAN-FD) fields: the error flag and the error delimiter. From a message-
Data Field 0–64 Data to be transmitted level perspective, the cyclic redundancy check (CRC) safeguards
(red) (0–8 (0–8 bytes for standard CAN; the information in the frame by adding redundant check bits at
bytes); 0–64 bytes for CAN-FD) the end of transmission, which are then checked on the
0–512 receiving side. If they do not match, then a CRC error has
(0–64
occurred. The other message check is the frame check, which
bytes)
verifies the structure by checking the bit fields against the fixed
CRC 15 Cyclic redundancy check format and frame size of SOF, EOF, ACK, and CRC delimiter bits.
CRC Delimiter 1 Assigned recessive (1) From a bit-level perspective, there are three checks for errors:
ACK slot 1 Dominant bit if error-free acknowledgement, bit monitoring, and bit stuffing.
message; Acknowledgement errors are detected when the transmitter
recessive to discard errant does not read a dominant ACK bit (0). This indicates a
message transmission error detected by the recipients, which means
ACK Delimiter 1 Acknowledgement delimiter either the ACK was corrupted or there were no receivers. Bit
monitoring checks the bus level for each node for sent and
EOF 7 End of frame
received bits. Bit stuffing is a method that “stuffs” or inserts an
Table 1. CAN Message Data-Frame Format extra opposite bit when five of the same bits occur in succession.
The opposite bit helps to differentiate error frames and EOF
Arbitration is resolved during transmission of the identifier bits. On the receiving side, the extra bit is removed. If the sixth
field, an example of which is shown in Table 2. Even with the bit is the same as the previous five, then an error is detected by
new CAN-FD standard, the arbitration phase is limited to 1 all CAN nodes and error frames are sent out. The original
Mbps, depending on network topology. But the data-field phase message will need to be retransmitted and pass through
is only limited by the transceiver characteristics, which means arbitration if there is contention on the line.
it can go much faster.

www.maximintegrated.com/CAN 4
With CAN features such as arbitration, error-message
checking, improved bandwidth, and a larger data field, it is
easy to understand the appeal of CANbus in the industrial
market. CAN is suitable for applications that require robust
communications and reliability in harsh environments. CAN
systems are able to prioritize the importance of frame messages
and treat critical ones appropriately. Many different systems
can be exposed to either electrically noisy sources or a local
service personnel that may accidentally short to local supply
rails. Maxim CAN transceivers are known for their robust serial
interface, with class-leading ESD performance and high level of
fault protection.

Notes:
1. http://canbuskits.com/what.php
2. https://teslatap.com/undocumented/model-s-processors-count/

Maxim Integrated
160 Rio Robles
San Jose, CA 95134 USA
408-601-1000
Maxim Integrated and the Maxim logo are registered trademarks of Maxim Integrated
5 Corporation. All other trademarks are the property of their respective owners. www.maximintegrated.com/CAN

Potrebbero piacerti anche