Robocraze TIFC00385

Download PDF
Contents

Robocraze SmartElex 2 Channel CAN HAT User Manual

Model: TIFC00385

1. Introduction

The SmartElex 2 Channel CAN HAT is a high-performance dual-channel CAN bus HAT designed for Raspberry Pi. It facilitates reliable CAN communication with various devices such as Electronic Control Units (ECUs), motor controllers, sensors, and industrial equipment. This HAT integrates two MCP2515 CAN controllers and TJA1050 CAN transceivers, supporting data rates up to 1 Mbps for efficient message exchange. Key features include configurable 120Ω termination resistors, onboard LED indicators for status monitoring, extended temperature operation, and built-in ESD protection, ensuring robust performance in diverse environments. Its compact, stackable design makes it suitable for applications in automotive diagnostics, robotics control, and industrial automation.

2. Key Features

  • CAN Bus Interface Support: Enables reliable communication with ECUs, sensors, and industrial devices using stable CAN protocol connectivity.
  • Dual Channel Module Design: Equipped with two independent CAN channels for handling multiple communication lines simultaneously.
  • High Speed Data Transfer: Supports communication speeds up to 1 Mbps, ensuring fast and efficient message exchange.
  • Flexible Hardware Features: Includes configurable termination resistors and onboard indicators for easy setup and monitoring.
  • Durable Operation Build: Designed with ESD protection and extended temperature tolerance for consistent performance in demanding environments.

3. Package Contents

Please verify that all items are present in the package:

  • 1x SmartElex 2 Channel CAN HAT
SmartElex 2 Channel CAN HAT packaging boxes

Figure 3.1: Example of SmartElex product packaging. The package contains one SmartElex 2 Channel CAN HAT module.

4. Setup Guide

4.1. Hardware Installation

  1. Prepare Raspberry Pi: Ensure your Raspberry Pi is powered off and disconnected from any power source.
  2. Attach the HAT: Carefully align the 40-pin GPIO header of the SmartElex 2 Channel CAN HAT with the GPIO pins on your Raspberry Pi. Gently press down until the HAT is securely seated.
Top view of SmartElex 2 Channel CAN HAT with components

Figure 4.1: Top view of the SmartElex 2 Channel CAN HAT. This image highlights the two green terminal blocks for CAN0 and CAN1, the MCP2515 controllers, TJA1050 transceivers, and the 40-pin GPIO connector.

Angled view of SmartElex 2 Channel CAN HAT

Figure 4.2: Angled view of the SmartElex 2 Channel CAN HAT, showing its compact form factor and component layout from a different perspective.

4.2. Termination Resistor Configuration

The CAN bus requires 120Ω termination resistors at each end of the bus. The SmartElex CAN HAT provides configurable termination for each channel.

  • Locate the "120R" ON/OFF switches near each CAN terminal block (CAN0 and CAN1).
  • Set the switch to ON to enable the 120Ω termination resistor for that specific CAN channel.
  • Set the switch to OFF to disable the termination resistor.

Note: Ensure termination is correctly configured for your CAN network to prevent signal reflections.

4.3. CAN Bus Wiring

Connect your CAN devices to the green terminal blocks labeled CAN0 and CAN1. Each terminal block typically has CAN_H and CAN_L connections.

  • Connect the CAN High (CAN_H) wire from your CAN device to the CAN_H terminal on the HAT.
  • Connect the CAN Low (CAN_L) wire from your CAN device to the CAN_L terminal on the HAT.

4.4. Software Configuration (Raspberry Pi)

To enable the CAN HAT, you need to configure your Raspberry Pi's operating system.

  1. Enable SPI: The MCP2515 controllers communicate via SPI. Enable SPI using the Raspberry Pi configuration tool:
    sudo raspi-config
    Navigate to Interface Options > SPI and enable it.
  2. Edit /boot/config.txt: Add the following lines to the end of the file to enable the MCP2515 overlay for both channels. You may need to adjust the interrupt pins (int_pin) and oscillator frequency (oscillator) based on your specific HAT revision or Raspberry Pi model.
    sudo nano /boot/config.txt
    Add:
    dtparam=spi=on
    dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
    dtoverlay=mcp2515-can1,oscillator=16000000,interrupt=24
    (Note: Interrupt pins 25 and 24 are common for dual-channel HATs, but verify with HAT documentation if issues arise.)
  3. Reboot Raspberry Pi:
    sudo reboot

5. Operating Instructions

After successful hardware and software setup, you can interact with the CAN interfaces using the iproute2 utilities (ip link, candump, cansend).

5.1. Install CAN Utilities

If not already installed, install the can-utils package:

sudo apt update
sudo apt install can-utils

5.2. Bring Up CAN Interfaces

Configure and bring up the CAN interfaces (can0 and can1). Replace 500000 with your desired baud rate (e.g., 125000, 250000, 1000000).

sudo ip link set can0 up type can bitrate 500000
sudo ip link set can1 up type can bitrate 500000

To check the status of the interfaces:

ip -details link show can0
ip -details link show can1

5.3. Sending CAN Messages

To send a CAN message (e.g., ID 123 with data 11 22 33 44 to can0):

cansend can0 123#11223344

5.4. Receiving CAN Messages

To monitor all CAN messages on can0:

candump can0

To monitor messages on both channels simultaneously:

candump any

5.5. Bring Down CAN Interfaces

When finished, you can bring down the CAN interfaces:

sudo ip link set can0 down
sudo ip link set can1 down

6. Maintenance

  • Cleaning: Keep the HAT clean and free from dust. Use a soft, dry brush or compressed air to remove debris. Avoid using liquids or solvents.
  • Storage: Store the HAT in a cool, dry place away from direct sunlight and extreme temperatures. If not in use for extended periods, consider storing it in an anti-static bag.
  • Handling: Always handle the HAT by its edges to avoid touching components, especially when powered. Static electricity can damage electronic components.

7. Troubleshooting

  • HAT Not Detected:
    • Ensure the HAT is correctly seated on the Raspberry Pi's GPIO pins.
    • Verify that SPI is enabled in raspi-config.
    • Check the /boot/config.txt entries for typos and correct interrupt pins/oscillator frequency.
    • After reboot, check if can0 and can1 interfaces appear using ip link show.
  • CAN Communication Errors:
    • Verify CAN bus wiring (CAN_H to CAN_H, CAN_L to CAN_L).
    • Ensure correct termination resistors are enabled/disabled on the HAT and other devices on the bus. Only two terminators should be active on the entire bus.
    • Confirm that all devices on the CAN bus are operating at the same baud rate.
    • Check for power supply issues to the Raspberry Pi and CAN devices.
  • LED Indicators:
    • The HAT may have onboard LEDs (e.g., power, activity). Refer to the specific HAT's silkscreen for LED labels and their functions.

8. Specifications

BrandRobocraze
Model NumberTIFC00385
CAN Controllers2x Microchip MCP2515
CAN Transceivers2x NXP TJA1050
Number of CAN Channels2 (Dual Channel)
Data RateUp to 1 Mbps
Termination ResistorsConfigurable 120Ω (per channel)
InterfaceSPI (to Raspberry Pi)
ESD ProtectionBuilt-in
Dimensions (LxWxH)6.5 x 5.6 x 2.3 cm
Item Weight29 g
Country of OriginChina

9. Warranty and Support

For warranty information, technical support, or further inquiries regarding your SmartElex 2 Channel CAN HAT, please contact Robocraze directly.

You can visit the official Robocraze store or contact their customer service for assistance. Contact details are typically available on the product packaging or the official Robocraze website.

Robocraze Store: Visit Robocraze on Amazon

Ask a question about this manual

Ask about setup, troubleshooting, compatibility, parts, safety, or missing instructions. Manuals+ will review the question and use this page’s manual context to help answer it.

After a successful submission, we securely hash the supplied account or form email before sending it to Microsoft Advertising for conversion attribution. Privacy details.