CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

This article first introduced the CAN bus arbitration, followed by the introduction of the CAN bus arbitration diagram, and finally elaborated the CAN bus bit arbitration technology and advantages and disadvantages, specifically follow the Xiaobian together to find out about it.

CAN bus arbitration

The CAN bus uses a communication mode called carrier monitoring, multi-master control/collision avoidance (CSMA/CA). This bus arbitration method allows each bus on the bus to have control over the bus and send data out. If two or more devices are required to transmit data at the same time, a bus collision occurs. The CAN bus can detect these conflicts in real time and arbitrate them, so that data with high priority is not damaged. Transmission.

When the bus is idle, it is recessive, and any node can send a dominant level to the bus as the start of the frame. If two or more are sent at the same time, competition will occur. The CAN bus solution to the competition is similar to the Ethernet CSMA/CD (Carrier Sense MulTIple Access with Collislon DetecTIon) method, as shown in Figure 1. In addition, the CAN bus was improved and the bus was accessed using CSMA/CA (Carrier Sense Mul- TIple Access with Collision Avoidance) to arbitrate identifiers bit by bit. While sending the level to the bus, each node also reads the level on the bus and compares it with the level sent by itself. If the same level continues to send the next bit, it stops sending and exits the bus competition. The remaining nodes continue the above process until there is only one node left to send the level on the bus, the bus contention is over, and the node with the higher priority gains control of the bus.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

Figure 1 CSMA/CD bus access process used by Ethernet

The CAN bus transmits data in units of packets. The priority of the messages is combined in the 44-bit identifier (identifier 29 bits of the extended frame). The node with the identifier with the smallest binary number has the highest priority. This kind of priority cannot be arbitrarily changed once it is determined at the time of system design. Conflicts caused by bus reads are mainly resolved by these bits of arbitration. The reason why the CAN bus does not use Ethernet delay to avoid conflicts is mainly to ensure that nodes with higher priorities can be transmitted in real time and that CSMA/CA can effectively avoid collisions.

As shown in FIG. 2 , the 10th, 9th, and 8th bits of the identifiers of node A and node B have the same level, so the information heard by the two nodes is the same as the information they send out. The 7th node B sends a "1", but the message received from the node is "0", indicating that a higher priority node occupies the bus to send messages. Node B will exit sending in a listen-only mode without sending data; node A successfully sends an arbitration bit to gain control of the bus and then sends all messages. The signal in the bus is continuously followed by the message that is finally issued by the control of the bus. In this example, the message of node A will be tracked. The advantage of this non-destructive bit arbitration method is that before the network finally determines which node is to be transmitted, the initial part of the message has already been transmitted in the network, so there is no delay in the data transmission of the node with high priority. In the process of sending data to a node that gains control of the bus, other nodes become receiving nodes of the message and do not send the message until the bus is free again.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

Figure 2 CAN bus node access bus process

Figure 3 shows the level logic of nodes on the CAN bus. The level of the nodes on the bus is relative to the bus level. Only when the voltages of the three nodes are equal to 1 (recessive level) will the bus be able to Stay in ycc (recessive level) state. As soon as there is 1 node switching to the 0 state (dominant level), the bus is forced to the dominant state (0). This arbitration method of avoiding bus conflicts enables messages with high priority to occupy bus transmissions without delay.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

Fig. 3 Level logic of node on CAN bus

CAN bus arbitration diagram

CAN is a multi-host mode. All nodes can send data. When sending, the identifier is the identifier of the local machine. The sending data is group sending mode, broadcasting mode, and specific data. All CAN nodes can be obtained at the same time, but each can The CAN node can set the CAN identifier filter, can set only receive the data of the required nodes, and then set the hardware to complete the screening. This is better than the master-slave transmission bus transmission mode of the 485 single host, and differential signaling is used physically.

Because of the characteristics of the CAN transceiver, suitable for multi-host transmission, can multiple hosts send data at the same time? Yes, because the CAN bus is equivalent to a "line-sum" structure. The explicit (logic 0) and recessive (logical 1) encounters become dominant (logic 0), just as the Sun Wukong said. The male and female met the male and they would not work. In fact, it is the logic operation: 0&0=0, 0&1=0, which is dominant. All CAN nodes are equivalent to one AND gate, active low (logic 0), low one, all low.

The schematic diagram of bus arbitration (standard frame format) is as follows:

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

Therefore, the identifier is prioritized, because the high bit is first and the low bit is low. The smaller the numerical value of the CAN identifier is, the higher the priority is.

CAN bus bit arbitration technology

As long as the bus is free, any unit can start sending messages.

To process the data in real time, the data must be transmitted quickly, which requires a high speed of the physical transmission path of the data. When several stations need to send data at the same time, it requires fast bus allocation.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

If two or more units start transmitting messages at the same time, there will be a bus access violation. This conflict can be resolved by bitwise arbitration using the identifier.

The CAN bus transmits data in units of packets. The priority of the messages is combined in the 11-bit identifier. The identifier with the lowest binary number has the highest priority. Once such a priority has been established at the time of system design, it cannot be changed. Conflicts in bus reads can be resolved by bit arbitration.

The arbitration mechanism ensures that neither information nor time will be lost. When a data frame with the same identifier and a remote frame are initialized at the same time, the data frame takes precedence over the remote frame.

The CAN bus uses non-return-to-zero (NRZ) encoding, and all nodes are connected to the bus in a "wire-sum" manner. If there is a node that transmits logical 0 to the bus, the bus assumes a logical 0 state regardless of how many nodes are sending a logical one. All nodes of the CAN network may try to send at the same time, but its simple arbitration rules ensure that only one node controls the bus and sends information. The low effective output state (0) plays a decisive role.

During arbitration, each transmitter compares the level of the transmitted bit with the monitored bus level. If the levels are the same, this unit can continue to send. If a "recessive" level (logic 1) is sent and a "dominant" level is detected (logic 0), the unit loses arbitration and must exit the transmission state.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

All identifiers have the same two bits 01. When the third bit is compared, the packet of station 1 is discarded because its 3rd bit is high and the 3rd bit of the other two stations is low. The 4th, 5th, and 6th bits of the station 2 and station 3 messages are the same. Up to the 7th station, the message of the station 3 is lost.

The advantages and disadvantages of CAN bus bit arbitration technology

advantage

Before the network finally determines which station's message is transmitted, the initial part of the message is already transmitted on the network.

All stations that do not have the right to read the bus become the receiving station with the highest priority message and will not send the message until the bus is free again.

CAN has higher efficiency because the bus is only used by stations that request the bus to be pending. These requests are processed in order according to the importance of the message in the entire system.

Shortcomings

Because the CAN bus uses a fixed priority, when all nodes send data randomly to the bus, a node with a low priority has a greater probability of failure than a node with a high priority.

Each time a node with a lower priority fails in the bus competition, resulting in one of its data being unable to send out, or sending the data with a greater delay.

CAN bus arbitration diagram_CAN bus bit arbitration technology and advantages and disadvantages

Ring And Fork Type Insulated Terminals

Ring And Fork Type Insulated Terminals,High quality insulated terminal,copper tube terminal

Taixing Longyi Terminals Co.,Ltd. , https://www.lycopperlugs.com