CAN Bus
Hardware
One CAN FD bus is integrated into AutomatePro with a max data rate of 8 Mbps. A 120 ohm termination resistor should be placed between CAN_H and CAN_L at both ends of the CAN network.
Connector Pinout
- Connector
- Development Breakout Board


CAN Specifications
| Parameter | Value |
|---|---|
| Transceiver | TCAN3413DDFR |
| CAN FD | Yes |
| Max data rate | 8 Mbps |
| Integrated 120 ohm termination resistor | No |
| CAN H and L input protection | < ±58V |
Software
To use the network, configure the interface properties. For instance, to set the network interface with a bus bit rate of 500 kbps, use the following command:
sudo ip link set can0 up type can bitrate 500000 berr-reporting on
Install CAN utilities for testing:
sudo apt-get install can-utils
This command transfers a packet to can0 with CAN ID 123 and data 'abcdabcd':
cansend can0 123#abcdabcd
This command receives packets from any CAN node connected to the bus:
candump -x any
For more information about the use of cansend, enter this command:
cansend --help
You can use other tools, such as cangen, for different filtering options.
C++ and Python examples can be found here.
ROS API
The IO controller firmware bridges CAN frames through ROS topics when the firmware-side CAN configuration is enabled.
| Topic | Type | Direction | Description |
|---|---|---|---|
/io/can/rx | automatepro_interfaces/msg/CAN | Published | CAN frames received by the IO controller. |
/io/can/tx | automatepro_interfaces/msg/CAN | Subscribed | CAN frames requested for transmission by the IO controller. |
Troubleshooting
Loopback test
You can perform a loopback test to determine whether the controller is working.
Ensure the CAN drivers are loaded. To check whether the drivers are loaded, use the following command:
lsmod | grep mttcan
If the drivers are not loaded, enter this command:
sudo modprobe mttcan
To perform a loopback test, run the following commands:
sudo ip link set can0 type can bitrate 500000 loopback on
sudo ip link set can0 up
candump can0 &
cansend can0 123#abcdabcd
If the loopback test is successful, the last command displays this:
can0 123 [4] AB CD AB CD
can0 123 [4] AB CD AB CD
Other Methods
Additional debugging techniques to consider:
-
If a loopback test shows that the controller is working correctly and you still cannot send or receive packets, try reconnecting the transceiver and confirm that the connections are correct.
-
Check if the
mttcandriver is loaded. -
Connect an oscilloscope to analyze the bus signal integrity and verify proper operation.
-
If the device logs a
No buffer space availablemessage during send, enter this command to use the polling mechanism:cangen -L 8 can0 -p 1000