1.First acquaintance with CAN communication
Speaking of CAN communication, many people may be relatively unfamiliar, but in fact we have been dealing with it. With the popularization of family cars, we drive every brake, every time we step on the gas, and even every time we open the door, open the window, in fact, are the application of CAN communication.

2.CAN Basic Concepts
CAN, which stands for Controller Area Network, is an ISO standardized serial communication protocol that was developed by the German electrician Bosch in 1986 to meet the needs of "reducing the number of wiring harnesses" and "high-speed communication of large amounts of data over multiple LANs". In 1986, in order to meet the needs of "reducing the number of wiring harnesses" and "high-speed communication of large amounts of data over multiple LANs," the German electrician Bosch developed the CAN communication protocol for automobiles. Since then, CAN has been standardized by ISO11898 and ISO11519, and is now the standard protocol for automotive networks in Europe.
Now, the high performance and reliability of CAN has been recognized and widely used in industrial automation, ships, medical equipment, industrial equipment, etc. CAN bus protocol is built on the basis of OSI seven-layer reference model, but its model structure has only three layers, i.e., the physical layer, the data link layer, and the application layer, and the CAN bus is a serial data communication protocol whose communication interface integrates the physical layer and the application layer of the CAN protocol. CAN bus is a serial data communication protocol that integrates the physical layer and data link layer functions of CAN protocol in its communication interface, which can complete the framing processing of communication data, including bit padding, data block coding, CRC checksum and priority discrimination.
CAN bus has the following characteristics:
- Multi-master work, any one of the nodes on the network can take the initiative to send information to other nodes on the network at any time, without distinguishing between the master and the slave, the communication mode is flexible.
- Node information on the network will be divided into a variety of different priorities, which can meet different real-time requirements.
- Adopting non-destructive bit arbitration mechanism, when two nodes transmit information to the network at the same time, the node with low priority actively stops sending data, while the node with high priority continues to transmit unaffected.
- Data transmission is carried out by point-to-point, point-to-multipoint and global broadcast.
- Direct communication distance up to 10KM.
- Communication rate up to 1MB/S.
- The actual number of points can be up to 110.
- With a short frame structure, the effective number of bytes in each frame is 8.
- Each frame has CRC checksum and other error-checking mechanisms, and the data error rate is low.
- Communication media can be twisted pair, coaxial cable and optical fiber, generally using cheap twisted pair can be.
- The node has the function of automatically shutting down the bus in case of serious errors, switching the connection with the bus so that other operations on the bus are not affected,
3.CAN communication and RS-485 communication difference
RS-485 bus is also one of the bus protocols that are very widely used in industrial field nowadays, so we can combine RS-485 communication to better understand CAN communication, specifically in the following aspects:
Communication distance: the maximum transmission distance of RS-485 bus is 1.2KM, and the maximum transmission distance of CAN bus is 10KM.
Transmission rate: RS-485 bus transmission rate is 300-10M bps, CAN bus transmission rate is 5K-1M bps.
Network structure: RS-485 bus network constitutes a master-slave centralized control system, CAN bus can realize point-to-point, one-to-many and global broadcasting forms to send and receive data.
Network capacity: RS-485 bus network of a communication can be connected to a maximum of 255 nodes, CAN bus actual nodes up to 110 or more.
Communication mode: RS-485 bus network is difficult to realize real-time communication, CAN adopts non-destructive technology and combines with bit arbitration mechanism, which can greatly save the bus conflict ruling time.
Communication Reliability: RS-485 bus network has poor fault tolerance and fault detection ability, CAN bus has the function of automatic bus shutdown in case of serious error.




