CAN is a multi-host local network serial communication protocol developed to solve the data exchange between many electronic control units in modern automobiles. Due to its high performance, high reliability and unique design, it has attracted more and more attention and is widely used in many fields.
The CAN bus application environment is complex and diverse, and various abnormal situations may occur. The following will analyze common CAN interface abnormal situations and solutions.
Common wiring errors for CAN transceivers include wiring errors in RXD and TXD connected to the CAN controller, and wiring errors in CAN_H and CAN_L connecting the CAN transceiver to the transceiver.
The TXD pin of the CAN transceiver is a data input pin and needs to be connected to the TXD output pin of the controller. The RXD pin of the CAN transceiver is a data output pin and needs to be connected to the RXD input pin of the controller. RS485 and RS232, which use Tx to represent transmission and Rx to represent reception, have different definitions. Engineers who are first exposed to CAN transceivers may connect TXD and RXD in reverse according to their habits, resulting in inability to communicate.
The CAN_H pin of the CAN transceiver needs to be connected to the CAN_H pin of other transceivers, and CAN_L needs to be connected to CAN_L. Reverse connection of CNA_H and CAN_L will cause communication abnormality.

For systems using multiple voltages, it may happen that the CAN transceiver power supply is 5V and the controller power supply voltage is 3.3V. Judging from the internal structure diagram of the TJA1050, the TXD and RXD pin output voltages are related to the VCC power supply voltage. .

The power supply voltage of the TJA1050 transceiver is generally 5V, so the voltage on the TXD and RXD pins is 5V. At this time, if the power supply voltage of the controller is 3.3V (for example, using STM32F407 as the controller), and the two chips with different power rails are directly connected at this time, it may be because the two chips have different judgment voltages for high and low levels, thus causing communication abnormalities.
Different voltages will also cause the 5V voltage to be input to the 3.3V pin to increase the 3.3V chip terminal voltage.
The terminal resistance of CAN communication is 120 ohms. During the process of high-speed CAN communication, inductance may occur, which affects the high and low voltage of CAN communication, making the system unable to distinguish dominant or invisible levels. Therefore, a terminal resistor is connected in parallel so that current can flow through the terminal resistor when the impedance is high, thus ensuring the normal operation of CAN communication.

When designing, we need to consider the bus rate of the CAN bus we want to access. The bus rate needs to be consistent to send and receive data normally.
Sometimes when we are testing, the communication is normal when the number of connected nodes is small, but when we try to connect more nodes, the CAN network crashes. When this happens, you can check the data waveform on the CAN bus to see if the waveform is deformed. Since the CAN controller has high requirements on control timing, the deformed waveform may cause the waveform timing received by the controller to be incorrect, causing the controller to fail. Decoding failure situation.
This situation is usually caused by insufficient interface protection of the CAN chip. In complex usage scenarios, strong electromagnetic and electrostatic interference often exist. If the protection capability of the CAN transceiver is not enough, it will be destroyed due to the influence of the external environment. In this case, we need to add a protection circuit or replace the chip with stronger protection capability.

The ECAN series of high-performance CAN protocol converters/conversion modules independently developed by Ebyte can realize bidirectional conversion between CAN and serial port RS232/RS485, TTL, USB, optical fiber, Wi-Fi and other different protocol data. It has the characteristics of small size and easy installation. It has extremely high cost performance in CAN-BUS product development and data analysis applications. It is a reliable assistant for engineering applications, project debugging and product development.