Apex Orin NX CAN Interface#

Hardware Specification#

Isolated CAN DB9 Pin Definition:

Pin

Signal

2

CAN_L

3

CAN_GND

7

CAN_H

Item

Specification

Isolate Voltage

3000V

Isolate Pin

CAN_H, CAN_L, CAN_GND

Relationship between Functions and Device Nodes#

Function

Description

Device Node

CAN_A

Orin NX CAN0

can0

CAN_B

Expanded CAN

can1

Usage#

  • Use connector 1, connect to PC.

  • Use connector 2, connect to female-female cross connector 3.

  • Use connector 3, connect to the DB9 CAN want to use.

CAN Configuration#

Preparation#

PC

#Install
sudo apt-get install can-utils -y
 
#After connecting the USB to CAN (PCAN) device to a PC, execute the command and the output result will be the name of the CAN interface.
ls /sys/class/net/ | grep -E 'can[0-9]+' | sort -V | tail -n 1
 
#Configuration
sudo ip link set can0 up type can bitrate 500000 sjw 4

Receive-Send test#

The device sends data and the PC receives it.

Device

#Execute command to send data.
sudo cansend can0 123#abcdabcd

PC

#Execute command to receive data.
sudo candump can0
#If the following message is printed, it indicates that the data has been successfully sent from the device side.
can0  123   [4]  AB CD AB CD

PC sends data and the device receives it.

PC

#Execute command to send data.
sudo cansend can0 123#abcdabcd

Device

#Execute command to receive data.
sudo candump can0
#If the following message is printed, it indicates that the data has been successfully sent from the PC side.
can0  123   [4]  AB CD AB CD

Troubleshooting#

When you are unable to receive data, experiencing packet loss, or communication interruptions, you can use the following command to view the status information of can0.

ip -d -s link show can0
# Check if 1 is the same as the previously set value.
# Check if 2 and 3 are both 0.
# If 1, 2, and 3 are all fine, check the hardware connection.
# If there are issues and you cannot identify the problem, please contact technical support for further investigation.

Reference#

https://www.kernel.org/doc/html/latest/networking/can.html

linux-can/can-utils

隔离CAN说明#

Although the CAN bus uses a differential method to transmit signals, it seems that it does not need to judge the signal relative to a certain reference point. The system only needs to detect the potential difference between the two lines. But the designer should also consider the common-mode voltage tolerance range of the CAN interface module. Only when this condition is met can the entire network work normally. When the common-mode voltage of the network line exceeds this range, it will affect the stability and reliability of the communication, and even damage the interface. The use of isolation technology can well solve the problem of common mode noise, so the use of TD CAN series CAN isolation transceivers to build bus hardware ports can well isolate the ground loop of each node on the bus and reduce the ground loop between nodes. circuit current, thereby reducing common-mode interference. However, for severe interference and harsh electrical environments, it is still recommended that designers use shielded twisted-pair cables to connect the bus reference grounds of each communication node on the bus through the shielding layer to reduce common-mode conduction and radiation interference and improve system communication reliability. .