CAN bus characteristics:
1, international standard industrial field bus, reliable transmission and high real-time performance;
2. Long transmission distance (farthest 10Km) and fast transmission rate (highest1MHz bps);
3. A single bus can connect up to 1 10 nodes, and the number of nodes can be easily expanded;
4. Multi-master structure, with equal status of each node, convenient for regional networking and high bus utilization rate;
5. High real-time, lossless bus arbitration technology, high priority nodes without delay;
6. The failed CAN node will automatically shut down and cut off the connection with the bus, which will not affect the communication of the bus;
7. The message has short frame structure and hardware CRC check, so the interference probability is small and the data error rate is extremely low;
8. Automatically detect whether the message is sent successfully, and can be automatically forwarded by hardware, with high transmission reliability;
9. Hardware message filtering function, which only receives necessary information, reduces the burden on cpu and simplifies software programming;
10, and the communication medium can be ordinary twisted pair, coaxial cable or optical fiber;
1 1, CAN bus system has simple structure and high cost performance.
RS485 interface standard features:
Electrical characteristics of (1) RS-485: The logic "1" is expressed as+(2-6) V by the voltage difference between two wires; The logic "0" is represented by the voltage difference between the two lines being-(2-6) V. The interface signal level is lower than that of RS-232-C, so it is not easy to damage the chip of the interface circuit, and this level is compatible with TTL level and can be easily connected with TTL circuit.
(2) The highest data transmission rate of RS-485 is 10Mbps.
(3) RS-485 interface is a combination of balanced driver and differential receiver, which enhances the anti-interference ability, that is, it has good anti-noise interference ability.
(4) The standard value of the maximum transmission distance of RS-485 interface is 4000 feet, which can actually reach 3000 meters. In addition, the RS-232-C interface can only connect 1 transceivers on the bus, that is, single station capability. The RS-485 interface allows up to 128 transceivers to be connected on the bus. That is, it has multi-station capability, so that users can easily establish equipment networks using a single RS-485 interface. However, only one transmitter can transmit on the RS-485 bus at any time.
(5) RS-485 interface has good noise immunity, long transmission distance and multi-station capability, so it is the preferred serial interface.
(6) Because the half-duplex network composed of RS485 interfaces generally only needs two wires, all RS485 interfaces are transmitted by shielded twisted pair.
Comparison between CAN bus and RS485;
1, speed and distance: The transmission distance of CAN and RS485 at 1Mbit/S is less than 100M, which is similar at high speed. However, at low speed, the distance CAN reach 10KM when CAN is 5Kbit/S, and even at low speed of 485, it can only reach about 12 19m (without relay). It CAN be seen that CAN has absolute advantages in long-distance transmission.
2. Bus utilization: RS485 is a single master-slave structure, that is, there can only be one host on a bus, and communication is initiated by it. It doesn't give an order, so the nodes below can't send it, and must reply immediately after sending it. After receiving the reply, the host will ask the next node to avoid data confusion caused by multiple nodes sending data to the bus. CAN bus is a multi-master-slave structure, and each node has a CAN controller. When multiple nodes send, the ID number is used for automatic arbitration, so that the bus data can be confused. Moreover, when one node finishes sending, the other node can detect that the bus is idle and send it immediately, which saves the inquiry of the host, improves the bus utilization rate and enhances the rapidity. Therefore, in systems with high reliability requirements such as automobiles, CAN bus or other similar buses are used.
3. Error detection mechanism: RS485 only specifies the physical layer, and there is no data link layer, so unless there are some physical errors such as short circuit, the error cannot be identified. This can easily cause a node to be destroyed and desperately send data to the bus (always 1), thus causing the whole bus to be paralyzed. So once RS485 breaks a node, the bus network hangs. CAN bus has a CAN controller, which can detect any bus error. If its own error exceeds 128, it will be locked automatically. Protection bus. If other nodes' errors or their own errors are detected, an error frame will be sent to the bus to remind other nodes that the data is wrong. Everybody be careful. In this way, once the CPU program of a node of CAN bus deviates, its controller automatically locks. Protection bus. Therefore, in the network with high security requirements, CAN is very powerful.
4. Price and training fee: The price of CAN equipment is about twice that of 485. Therefore, 485 communication is very convenient in software. As long as you know serial communication, you CAN program, while CAN requires the bottom engineers to know the complex layer of CAN, and writing the upper computer software also needs to know the protocol of CAN. It can be said that the training cost is very high.
5. The CAN bus is connected to the physical bus through two output terminals CANH and CANL of the CAN controller interface chip 82C250, and the state of the CANH terminal can only be high or floating, and the state of the CANL terminal can only be low or floating. This ensures that there will be no phenomenon. In the RS-485 network, when a system error occurs and multiple nodes send data to the bus at the same time, the bus will be short-circuited and some nodes will be damaged. Moreover, the CAN node has the function of automatically turning off the output when serious errors occur, so that the operation of other nodes on the bus is not affected, thus ensuring that the bus will not be in a "deadlock" state because of problems of individual nodes in the network.
6.CAN has a perfect communication protocol, which can be realized by CAN controller chip and its interface chip, greatly reducing the development difficulty of the system and shortening the development cycle, which is incomparable to RS-485 with only electrical protocol.