CAN Bus

The CAN bus signal of NRU-50 is directly from the Jetson Xavier NX module with an additional isolated transceiver. The CAN bus of Jetson Xavier NX is from Bosch Time-Triggered Controller Area Network (M_TTCAN) controller version 3.2.0. It supports CAN 2.0.

System Node

Execute the following script before using the CAN bus on NRU-50. Please double confirm the CAN Bus configuration with other connected CAN devices, especially:

  • Bitrate

  • Payload bit rate

  • Bus error reporting

Initialization Script

modprobe can
modprobe can-raw
modprobe mttcan

sudo ip link set can0 up type can bitrate 500000

If you have initially the CAN bus successfully, you will see can0 in the result of ifconfig, e.g.,

can0: flags=193<UP,RUNNING,NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 1118  bytes 8944 (8.9 KB)
        RX errors 1117  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 64

Then you can access the CAN Bus on panel via can0

Pin Definition

Pin

Definition

1

GND

2

Reserved

3

CAN_H

4

Reserved

5

CAN_L

6

Reserved

7

Reserved

8

Reserved

9

Reserved

120 Ohm Termination

Make sure you have enabled the 120 Ohm terminationarrow-up-right of the two ends of your CAN Bus. NRU-50 have an on-board termination which can be controlled via GPIO.

You may enable and disable it by the following commands.

Loopback Test

  • Initialize CAN bus in loopback mode by the following commands.

  • Open a terminal to send random CAN bus data

  • Open another terminal to receive CAN bus data

RS232 to CAN Bus Test via UT-2505

One of the common tools to test RS-232 to CAN Bus communication is UT-2505arrow-up-right from CONSTEEL Electronics. A quick memo for testing is as follows.

0. Prerequisites

  • Please remember to install minicom for further COM port testing.

1. Test RS232 to CAN

Open two terminals: one for receiving CAN data, one for sending data via RS232.

Receiving Terminal

Type the following command to open candump to show any incoming CAN bus data.

Sending Terminal

Type the following command to open minicom to send data via COM.

Type any characters in minicom, and you will see the result in receiving terminal, e.g.,

2. Test CAN to RS232

Open two terminals: one for sending CAN data, one for receiving data via RS-232.

Receiving Terminal

Type the following command to open minicom to show any incoming data via RS-232.

Sending Terminal

Type the following command to use cangen to generate random CAN bus data.

Then you will see random generated CAN data shown in minicom, e.g.,

Last updated