Before performing CAN bus communication, it is important to ensure proper bus configuration, such as termination resistors. They are crucial components that affect bus communication. Below, we will analyze the effects of not using termination resistors solely from the perspective of signal amplitude and time constant, without considering signal integrity.
Termination Resistor Requirements
According to ISO11898-2, a 120Ω termination resistor must be connected at both ends of the bus, meaning a total of 60Ω of termination resistance is added to the bus. Intermediate nodes do not need termination resistors, as shown in Figure 1.
Figure 1: Termination Resistor
Effects of Not Using Termination Resistors
As shown in Figure 2, if we follow the ISO11898 standard and use CANScope for testing, adding a 60Ω termination resistor while transmitting and receiving data at a baud rate of 250Kbps allows the messages to be sent normally, and the associated waveforms also appear normal.
Figure 2: CANScope Transmission and Reception with Termination Resistor
If CANScope transmits and receives data without termination resistors at a baud rate of 250Kbps, as shown in Figure 3, the transmitted data contains frame ID errors, and the associated waveforms are also abnormal.
Figure 3: CANScope Transmission and Reception without Termination Resistor
For the message data, we can see from the associated waveform data that the rising edge is fine, but the falling edge is much slower compared to the waveform with termination resistors and has not reached the recessive state. Why is this the case? We will analyze it one by one.
1. Why does it affect the falling edge?
As we know, the CAN bus transmission method is differential transmission, and the bus level is determined by the CAN transceiver based on the differential voltage (CANH-CANL) between the CANH and CANL cables. There are only two possible signal levels transmitted on the bus: dominant level (logic 0) and recessive level (logic 1).
First, let’s look at the internal structure of the CAN transceiver, as shown in Figure 4:
Figure 4: Internal Structure of CAN Transceiver
When the bus level is dominant, the internal Q1 and Q2 of the transceiver are in the conducting state, creating a voltage difference between CANH and CANL. When the bus level is recessive, Q1 and Q2 are in the cutoff state, resulting in a passive state with a voltage difference of 0.
Therefore, when the recessive state changes to a dominant state (rising edge), it is mainly driven by the driving module in the transceiver. When the dominant state changes to a recessive state (falling edge), it is discharged through the entire bus and the termination resistor, making the termination resistor the main physical factor affecting the rate of the falling edge.
2. Why does the falling edge take so long to reach the recessive state?
As mentioned earlier, the rate of the falling edge is influenced by the termination resistor, which relates to the time constant τ. We know that the time constant can be determined by the capacitance (C) and load resistance (R), i.e., τ=RC. Therefore, when there is no termination resistor on the bus, the resistance between CANH and CANL is very large. For example, when measuring with CANScope without termination resistors, the measured resistance is about 91KΩ. Hence, according to the time constant formula, the τ value will be large, making it impossible to quickly dissipate the energy stored in the parasitic capacitance on the bus, resulting in a slow falling edge that does not reach the recessive state.
Figure 5: RC Circuit
3. Why do erroneous frames occur?
As shown in Figure 6, this is a screenshot from the oscilloscope corresponding to Figure 3. From the figure, when the cursor area ΔX is one bit, i.e., 4us, the differential signal voltage YB at cursor B is 3.341V, which is far above the upper limit for judging the recessive level of 0.5V and the lower limit for judging the dominant level of 0.9V in the CAN specification. Therefore, this bit is judged as a dominant bit, and since the time constant is much greater than the bit time at a baud rate of 250Kbps, more than 5 bits are judged as dominant bits, thus violating the filling rule in the CAN specification and resulting in frame ID filling errors.
Figure 6: Waveform Details at 250Kbps Baud Rate
To deepen our understanding of the causes of erroneous frames, let’s consider a counterexample where the bit time is much greater than the time constant without termination resistors. Using CANScope without termination resistors at a baud rate of 10Kbps, as shown in Figure 7, no erroneous frames are generated in the CANScope message list.
By observing the synchronized oscilloscope screenshot in Figure 8, when the cursor area ΔX is 45.6us, the differential signal voltage YB at cursor B is 0.4813V. Since the default sampling point of CANScope is 75% after the cursor area, this bit can be correctly judged as recessive, thus preventing the generation of erroneous frames.
Figure 7: Message Transmission at 10Kbps Baud Rate
Figure 8: Waveform Details at 10Kbps Baud Rate
Methods for Adding Termination Resistors
When using CANScope as a measurement device, in addition to adding termination resistors externally by the user, termination resistors can also be configured through software for the tested node or network. The method of addition will vary depending on different PORT head accessories.
When using standard accessories P8251T and P1040T, checking the option to enable termination resistors in Figure 9 will add a 120Ω termination resistor to the bus. When using the optional accessory StressZ, as shown in Figure 10, the corresponding termination resistor can be set as needed.
Figure 9: Termination Resistor Settings for Standard Accessories P8251T and P1040T
Figure 10: Termination Resistor Settings for Optional Accessory StressZ
Source: ZLG Zhiyuan Electronics
END
This Issue’s Discussion:
1. What is your salary level in your city? Is it sufficient?
2. Some people think that working with hardware or embedded systems in big cities like Beijing, Shanghai, and Guangzhou with a salary of 20K is not as good as living comfortably with 15K in second-tier cities. What do you think?
All participants will receive: 20 E-coins
Excellent answers will receive: 300 E-coins
Activity period: 2023/07/25 – 2023/08/31
Welcome to join the Engineer Workplace Group