What happens to two nodes with the same ID segment in a CAN-bus network?

In principle, two nodes do not allow the same ID segment in a CAN-bus network, but what if the two node IDs are the same? Senior obsessive-compulsive patients want to find out!

Before the experiment, we must first have a clear understanding of the structure and arbitration principles of CAN messages.

CAN message structure

The most widely used CAN-bus network standard is the V2.0 version, which is divided into two parts, A and B. The main difference is the ID code length in the arbitration area. Among them CAN2.0A (standard frame) is 11-bit ID, and CAN2.0B (extended frame) is 29-bit ID. Table 1 below shows the CAN message structure:

Table 1 CAN message structure

Arbitration principle

The arbitration of the CAN bus is based on the "line and principle", as shown in Figure 1. When a transceiver simultaneously emits a different level signal, the recessive level is always covered by the dominant level. When the CAN controller sends a message, it will monitor whether the bus status is consistent with the level sent by itself. If the inconsistency occurs in the ID segment, arbitration will occur. If it occurs in other areas, the corresponding error will be triggered.

Figure 1 line "and" schematic

The following points into the focus, what if the two node ID segments are the same? We started the experiment with two CAN cards and one CANScope. The CAN card simulates the CAN standard node to send and receive messages, and the CANScope performs communication monitoring, as shown in Figure 2. (Note: CAN card is USB to CAN tool, CANScope is CAN bus analyzer, the product is detailed in Zhiyuan Electronic official website)

Figure 2 Experimental platform construction

Experiment 1: ID segments are the same but the data is different

A CAN card is used to transmit a CAN frame with an ID of 000H data of 01020304050607H, and another CAN card is used to transmit a CAN frame with an ID of 000H and data of 02020304050607H. The data monitored by CANScope is shown in Figure 3. It can be observed that there are a large number of data field fill errors.

Figure 3 data field fill error

Why is this so? We first obtain the waveforms corresponding to the two CAN cards to send the message, as shown in Figure 4. Because the two-pin message is the same as the standard data frame, and each frame contains 8 bytes of data, the waveform corresponding to the two frames of messages is identical in the ID segment, RTR, IDE, R0, and DLC segments. Therefore, the arbitration function is invalid, and both nodes think that they have obtained the priority and continue to send data.

Figure 4 message corresponding waveform comparison

Now we focus on the data segment, the first byte data is the same, both are 00H; the second byte data is different, respectively 01H, 02H. The logic at the arrow mark in Figure 5 shows that the corresponding bits of the two are 0 and 1, respectively. Earlier we mentioned that the CAN node will detect whether the bus level is consistent with the level sent by itself when sending a message. If the inconsistency occurs in the non-arbitration area, the corresponding error is triggered, so if the two frames are simultaneously sent to the bus. A bit transmission error will occur. Because the bit transmission error causes the node to send 6 dominant bits that violate the fill rule (active error destroys the frame data), a data field fill error occurs, as shown in Figure 3.

Figure 5 data field conflict

Experiment 2: IDs have the same data

At the same time, two CAN cards are used to transmit CAN frames with ID 000H data of 01020304050607H, and CANScope performs communication monitoring. First, we do not check the "Bus Answer" option to make CANScope work in listen-only mode. The experimental results are shown in Figure 6. The response delimiter format error occurs.

Figure 6 response delimiter format error

Why is this error happening? The node that sent the message will send two recessive bits in the ACK segment. If the dominant level is received during the first bit, the frame is considered to be received correctly. Since both nodes consider themselves to obtain the arbitration right when the arbitration segment is the same, they wait for the response in the ACK segment, but there are only two nodes in the network, so the response cannot be received in the ACK segment, and the response delimiter error occurs. Simply put, this situation is similar to the fact that only one node in the bus will not be able to send data. Figure 7 is a waveform comparison when there is an ACK segment response.

Figure 7 ACK response

We tick the bus response and start the experiment again (there is equivalent to 3 nodes in the bus) . At this time, as shown in FIG. 8, the bus data is transmitted and received normally.

Figure 8 Start bus response

to sum up

When two nodes simultaneously send packets with different IDs and different data, a data field filling error will occur; when two nodes simultaneously send messages with the same ID and the same data, if other nodes respond, no error occurs, if no other nodes A response error occurs in response. Therefore, we should avoid the same situation when the ID segment is the same when designing the CAN bus.

Wired Hifi Earphones

Wired Hifi Earphones is special for audiophile,with hybrid technology speaker,bring you very good experiences when enjoy your musics. Hifi sound is very special sound as other earphones

We believe that our Hifi earphones will be more popular all over the world.

wired hifi earphones, wired headset with hifi sound quality,wired Hifi headphones, Wired Hifi earbuds, 3.5mm gold plated plug earphones

Dongguang Vowsound Electronics Co., Ltd. , https://www.vowsound.com