How to package CAN Communication data
This article mainly explains "how to package CAN communication data". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to package CAN communication data.
Basic introduction of CAN Communication
In the current automobile industry, for the requirements of safety, comfort, convenience, low pollution and low cost, a variety of electronic control systems have been developed. Due to the different data types and reliability requirements used in the communication between these systems, there are many cases composed of multiple buses, and the number of wire harnesses increases. In order to meet the needs of "reducing the number of wire harness" and "high-speed communication of a large amount of data through multiple LAN", the German electrical company Bosch developed the CAN communication protocol for automobile in 1986. Since then, CAN has been standardized through 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 has been widely used in industrial automation, shipping, medical equipment, industrial equipment and so on.
Therefore, it can be seen that CAN communication is a wide and reliable way of communication in application scenarios.
CAN communication protocol has the following characteristics:
1: multi-master control. When the bus is idle, all units can send messages, and when more than two units start sending messages at the same time, the priority is determined according to the identifier (ID, non-address). When more than two units start sending messages at the same time, each bit of the message ID is compared one by one. The unit that wins the arbitration (with the highest priority) can continue to send messages, while the unit that loses the arbitration immediately stops sending and receives.
2: the flexibility of the system. The units connected to the bus have no similar "address" information, so when adding units to the bus, the software, hardware and application layers of other connected units do not need to be changed.
3: high speed and long distance. Highest 1Mbps (distance