CANBed M4

Introduction


CAN Bus is a common industrial bus because of its long travel distance, medium communication speed and high reliability. It is commonly found on modern machine tools, such as an automotive diagnostic bus. This CANBed M4 is the latest board of the CANBed family, with the ATSAME51G19A mcu and MCP2542FD CAN transceiver to achieve the CAN-FD capability.

CANBed Family

VRESION CANBed V1 CANBed FD CANBed M0 CANBed M4
PICTURES
MCU Atmega32U4 Atmega32U4 ATSAMD21G18 ATSAME51G19A
CORE AVR 8 bit AVR 8 bit ARM Cortex M0+ 32bit ARM Cortex M4 32bit
PROTOCOL CAN2.0 CANFD & CAN2.0 CAN2.0 CANFD & CAN2.0
CLOCK 16MHz 16MHz 48MHz 120MHz
FLASH 32KB 32KB 256KB 512KB
RAM 2.5KB 2.5KB 32KB 192KB
PRICE $14.9 $17.9 $16.9 $19.9
LINK GET ONE NOW GET ONE NOW GET ONE NOW GET ONE NOW

CAN BUS PRODUCTS LIST OF LONGAN LABS


We have made a lot of can bus products, you can get more information through the following list, so as to choose a product suitable for you.

PRODUCT NAME LINK PRICE MCU CHIP PROTOCOL
Serial CAN Bus Module LINK $14.9 ATMEGA168PA MCP2515 CAN2.0
I2C CAN Bus Module LINK $14.9 ATMEGA168PA MCP2515 CAN2.0
OBD-II CAN Bus Dev Kit LINK $17.9 ATMEGA168PA MCP2515 CAN2.0
OBD-II CAN Bus GPS Dev Kit LINK $29.9 ATMEGA32U4 MCP2515 CAN2.0
OBD-II CAN Bus Basic Dev Kit LINK $19.9 ATMEGA32U4 MCP2515 CAN2.0
CAN-FD Shield LINK $8.9 NO MCU MCP2517FD CAN-FD
CAN Bus Shield LINK $5.9 NO MCU MCP2515 CAN2.0
CANBed LINK $19.9 ATMEGA32U4 MCP2515 CAN2.0
CANBed-FD LINK $19.9 ATMEGA32U4 MCP2517FD CAN-FD
CANBed M0 LINK $19.9 ATSAMD21 MCP2515 CAN2.0
CANBed M4 LINK $24.9 ATSAME51 - CAN-FD

Features


  • CAN-FD and CAN2.0
  • ATSAME51G19A 32bit Cortex M4 core
  • 512 KB flash, 192KB RAM
  • Industrial standard 9 pin sub-D connector or 4PIN Terminal Connector
  • OBD-II and CAN standard pinout selectable at sub-D connector
  • 2x4Pin Connector compatable with Grove system
  • Size: 56x41mm

Specifications


  • MCU: ATSAME51 32bit Cortex M4 core
  • Clock speed: 120MHz
  • Flash memory: 512KB
  • RAM: 192KB
  • EEPROM: No EEPROM
  • Input voltage: 7~28V
  • Output Current @ 5V: 1A
  • Input interface: Sub-D as well as Terminal

Hardware Overview


Part List

  • CANBed M4 PCBA
  • sub-D connector
  • 4PIN Terminal
  • 4PIN 2.0 Connector x 2
  • 9x2 2.54 Header x 1
  • 3x3 2.54 Header x 1

Pin out

1.9x2 IO Pin OUT:

The IO of Atsame51 is list out here.

2.ATSAME51G19A:

Cortex M4 core controller

2.Reset Button:

Reset the on-board Atmega chip.

3.Micro USB connector for programming

4. SPI Interface

5.CAN RX/TX Indicator

6.sub-D connector or Terminal for CAN Bus

D-Sub CANbus PinOut

pin# Signal names Signal Description
1 Reserved Upgrade Path
2 CAN_L Dominant Low
3 CAN_GND Ground
4 Reserved Upgrade Path
5 CAN_SHLD Shiled, Optional
6 GND Ground,Optional
7 CAN_H Dominant High
8 Reserved Upgrade Path
9 CAN_V+ Power, Optional

7.Switch for the 120Ω terminal resistor for CAN Bus

If you use this board on the end of the CAN bus, please put this switch to 120Ω. For more detail about the CAN bus protocol, please refer to the NI CAN Physical Layer and Termination Guide

8.Grove connector for UART

9.Grove connector for I2C

Arduino IDE Setup


First download the Arduino IDE from https://www.arduino.cc/en/Main/Software. Arduino IDE can be installed and run on Windows, Linux, and Mac OS X operating systems. Download the installer or zip file (Windows only) and install (if you have the zip file, extract it to your Windows computer’s hard drive) it on your operating system.

Once finished, start the Arduino IDE.

Copy and paste the link below into the Additional Boards Manager URLs option in the Arduino IDE preferences (File > Preferences).

https://raw.githubusercontent.com/Longan-Labs/LONGAN-SAME-TOOLS/master/package_longan_samd_index.json

Enter longan to install the latest Longan SAME board

Usage


Arduino Code


We provide an Arduino library for CANBed M4.

There're many examples for the library, which is consist of,

  • CAN_20_Send - How to send a frame to CAN Bus 2.0
  • CAN_20_Recv - How to recv a frame from CAN Bus 2.0
  • CAN_FD_Send - How to send a frame to CAN FD
  • CAN_FD_Send - How to recv a frame from CAN FD

FAQ


The RX/TX led light up and never turn off

  • Check if the baudrate of CAN Bus is setting correct
  • Try turning on/off the switch for the terminal resistor
  • Cehck if CANH and CANL is connected correct

How to find the tech support

Please feel free to contact joney.sui@longan-labs.cc if you need more help.

Schematic Online Viewer


Reference