Comparison between CAN bus and RS485

Source: Internet
Author: User

The overall solution of a recent project was designed as a distributed system, so it struggled with the CAN bus or RS485 communication. Therefore, I searched some documents about RS485 and CAN bus on the Internet. In addition to further understanding of RS485 communication characteristics, I also learned the characteristics of CAN bus and its comparison with RS485, which are summarized as follows:

 

Note: The following is a summary from the online search.

 

CAN bus features:

1. International Standard Industrial Field Bus with reliable transmission and high real-time performance;
2. long transmission distance (up to 10 km), fast transmission rate (up to 1 MHz bps );
3. A single bus can be connected to a maximum of 110 nodes, and the number of nodes can be easily expanded;
4. Multiple main structures, equal status of each node, convenient regional networking, High bus utilization;
5. high real-time performance, non-destructive bus arbitration technology, and non-delayed nodes with high priority;
6. the faulty CAN node will automatically close and cut off the connection with the bus without affecting the communication between the bus;
7. The message is a short frame structure and has a hardware CRC check. It has a low interference probability and extremely low data error rate;
8. The system automatically checks whether the message is successfully sent. The hardware can automatically resend the message, resulting in high transmission reliability;
9. The hardware message filtering function only receives necessary information, reduces the CPU burden and simplifies software preparation;
10. Common twisted pair wires, coaxial cables or optical fiber cables can be used as communication media;
11. The CAN bus system is simple in structure and cost-effective.

 

RS485 interface standard features:

(1) Electrical Properties of RS-485: The logic "1" is expressed by the voltage difference between two wires as + (2-6) V; the logic "0" is represented by the voltage difference between two wires-(2-6) v. The interface signal level is lower than the RS-232-C, it is not easy to damage the interface circuit chip, and the level is compatible with the TTL level, convenient and TTL circuit connection.
(2) The highest data transmission rate of the RS-485 is 10 Mbps
(3) RS-485 interface is a combination of balanced drive and differential receiver, the common mode dry performance is enhanced, that is, good noise resistance.
(4) The maximum transmission distance of the RS-485 interface is 4000 feet, in fact up to 3000 meters, in addition, RS-232-C interface on the bus can only connect to one transceiver, that is, single station capacity. While the RS-485 interface on the bus is allowed to connect up to 128 transceiver. That is, with multi-site capabilities, so that users can use a single RS-485 interface to easily establish a device network. But only one transmitter can be sent at any time on the RS-485 bus.
(5) because the RS-485 interface has good anti-noise ratio, long transmission distance and multi-station ability and so on, it becomes the first choice of serial interface.
(6) because of the half-duplex network composed of RS485 interfaces, generally only two connections are required, the RS485 interfaces are all transmitted by shielded twisted pair wires.

 

Comparison between CAN bus and RS485:

1. speed and distance: the distance between can and RS485 at a high speed of 1 Mbit/s is no more than 100 m, which is almost the same as that at high speed. However, at low speed, the distance between can and 5 kbit/s is up to 10 km, and the speed between 485 and 1219 can only reach about meters (No relay ). It can has absolute advantages in long-distance transmission.

2. Bus utilization: RS485 is a single master-slave structure, that is, one bus can only have one host, and communication is initiated by it. It has no command, and the following nodes cannot be sent, in addition, the host will only ask the next node after receiving a response. This is to prevent multiple nodes from sending data to the bus, resulting in data disorder. While the CAN-bus is a multi-master-slave structure, each node has a CAN controller. When multiple nodes are sent, they are automatically arbitrated with the ID number to be sent, so that the bus data is not bad, after a node is sent, the other node can detect that the bus is idle and send it immediately, saving the host's inquiry, improving the bus utilization and improving the speed. Therefore, systems with high real requirements such as automobiles use the CAN bus or other similar bus.

3. Error Detection mechanism. RS485 only specifies the physical layer without the data link layer. Therefore, it cannot identify errors unless there are some physical errors such as short circuits. This can easily cause a node to be damaged and send data to the bus (always sending 1). This will paralyze the entire bus. Therefore, once the RS485 node breaks down, the bus network will be suspended. The CAN bus has a CAN controller that can detect any errors on the bus. If the number of errors exceeds 128, it will be automatically locked. Protection bus. If other nodes are detected with errors or their own errors, an error frame is sent to the bus to prompt other nodes. This data is incorrect. Be careful. In this way, once a node CPU program runs, its controller automatically locks. Protection bus. Therefore, in networks with high security requirements, can is very powerful.

4. Price and training cost: the price of the CAN device is about twice the price of 485. As a result, 485 of communication is very convenient from the software. As long as you understand the serial communication, you can program it, however, you need the engineers at the bottom layer to understand the complex layers of the can, and you also need to understand the CAN protocol when writing PC software. Training costs are high.

5. the CAN bus connects Canh and canl at the two output ends of the CAN controller interface chip 82C250 to the physical bus, while the status of Canh can only be high or suspended, the canl end can only be in a low or floating state. This ensures that, as in a RS-485 network, when a system error occurs, when multiple nodes send data to the bus at the same time, the bus shows a short circuit, thus damaging some nodes. In addition, the CAN node automatically disables the output function in case of serious errors, so that the operations of other nodes on the bus are not affected, so as to ensure that the node does not appear in the network, the bus is in a "deadlock" state due to some node problems.

6. Can has a complete communication protocol, which can be implemented by the CAN controller chip and its interface chip, thus greatly reducing the difficulty of system development and shortening the development cycle, these are incomparable only to RS-485 with electrical protocols.

 

Features

RS-485

CAN-bus

Single point of cost

Low Cost

Slightly higher

System cost

High

Relatively low

Bus Utilization

Low

High

Network Features

Single-master Network

Multi-master Network

Data Transfer Rate

Low

High

Fault Tolerance Mechanism

None

Reliable error handling and error detection mechanisms

Communication failure rate

High

Extremely low

Impact of node errors

Paralyzing the entire network

No impact

Communication distance

& Lt; 1.5 km

Up to 10 km (5 Kbps)

Network debugging

Difficult

Very easy

Development difficulty

Standard Modbus protocol

Standard CAN-bus protocol

Post-maintenance costs

High

Low

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.