SavvyCAN-Hardware-Manual-20240103
SavvyCAN-Hardware-Manual-20240103
SavvyCAN-Hardware-Manual-20240103
0 To CAN FD Converter
Data Field Up to 12M Max
1
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Document Catalogue
Document Catalogue .......................................................................................................................................... 2
1Introduction ..........................................................................................................................................................3
1.1 Product Series .................................................................................................................................3
1.2 Product Features ............................................................................................................................3
2Hardware Description ....................................................................................................................................... 3
2.1 SavvyCAN-FD-X2 .................................................................................................................................3
Specification ......................................................................................................................................... 4
Pins Out Description ......................................................................................................................... 5
LED Indication ......................................................................................................................................6
2.2 SAVVYCAN-FD-C ................................................................................................................................ 6
Specification ......................................................................................................................................... 7
Pins Out Description ......................................................................................................................... 8
LED Indication ......................................................................................................................................9
2.3 SavvyCAN-FD-mPCI ........................................................................................................................... 9
Specification .......................................................................................................................................10
Pins Out Description .......................................................................................................................11
LED Indication ................................................................................................................................... 12
Design Reference .............................................................................................................................13
3 Connection .................................................................................................................................................. 15
3.1 Enable/Disable Build In 120Ω Term Resistor ........................................................................... 15
3.2 SavvyCAN-FD-X2/SAVVYCAN-FD-C Connection ................................................................ 16
3.3 SavvyCAN-FD-mPCI Connection Figure ...................................................................................17
4 Software Description ................................................................................................................................17
4.3 CAN-UTILS/C/Python For Linux ................................................................................................... 17
4.3.1 Linux Support List ................................................................................................................. 17
4.3.2 Hardware Connection ......................................................................................................... 19
4.3.3 CAN-UTILS DEMO ................................................................................................................20
4.3.4 C Demo .....................................................................................................................................22
4.3.5 Python3 Demo ....................................................................................................................... 22
4.3.6 Software Description ............................................................................................................23
2
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
1Introduction
Product Name CAN Version Bitrate Isolation Max Rate Interface Time
Stamp
SavvyCAN-FD-X2 CAN2.0A/B 12Mbit/s 2500V 15000fps/s USB 1us
CANFD 1.0 2*DSUB 9PIN
SavvyCAN-FD-mPCI CAN2.0A/B 12Mbit/s 2500V 15000fps/s MINIPCIE 1us
CANFD 1.0 (USB Bus)
SavvyCAN-FD-C CAN2.0A/B 12Mbit/s 2500V 15000fps/s 1.5M USB 1us
CANFD 1.0 Cable
1*D-Sub 9PIN
The new CAN FD standard (CAN with Flexible Data rate) is primarily characterized by higher
bandwidth for data transfer.
The maximum of 64 data bytes per CAN FD frame (instead of 8 so far) can be transmitted
with bit rates up to 12 Mbit/s.
2Hardware Description
2.1 SavvyCAN-FD-X2
The SavvyCAN-FD-X2 is a plug and play high speed USB2.0 to CANFD adapter enables the
connection of dual channel CANFD networks to a computer via USB. Each CAN FD channel is
3
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Specification
Connector
CANFD Dual Channel 9PIN D-SUB Connectors
USB USB plug type A(Computer)
USB plug type B(Devcie)
CAN Features
Protocols CAN 2.0A (standard format)
CAN 2.0B (extended format)
CAN FD ISO 11898-1:2015
CAN FD non-ISO
CAN bit rates 25 kbit/s up to 1 Mbit/s
CANFD bit rates 25 kbit/s up to 12Mbit/s
USB ESD IEC 61000-4-2 Level 4
+25 kV (contact discharge)
+30 kV (air-gap discharge)
4
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
5
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
LED Indication
When plug SavvyCAN-FD-X2 device to Computer All lights are flashing for one second.
Then TERM LED And LINK LED turns to be green.
2.2 SAVVYCAN-FD-C
The SAVVYCAN-FD-C is a plug and play high speed USB2.0 to CANFD converter comes with
1.2m high quality Cable enables the connection of one channel CANFD networks to a
computer via USB. CANFD is isolated protection against USB 2500V.
6
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Specification
Connector
CANFD 9PIN D-SUB Connectors
USB Cable 1.2M High Quality USB Cable with type A
CAN Features
Protocols CAN 2.0A (standard format)
CAN 2.0B (extended format)
CAN FD ISO 11898-1:2015
CAN FD non-ISO
CAN bit rates 25 kbit/s up to 1 Mbit/s
CANFD bit rates 25 kbit/s up to 12Mbit/s
USB ESD IEC 61000-4-2 Level 4
+25 kV (contact discharge)
+30 kV (air-gap discharge)
Galvanic isolation Signal &Power Separately Isolated by 2500
Volts against USB
7
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
1 NC
2 CAN-L
3 GND
4 NC
5 NC
6 NC
7 CAN-H
8 NC
9 NC
8
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
LED Indication
2.3 SavvyCAN-FD-mPCI
The PU2CANFD-MPCIE is a plug and play high speed USB2.0 to CANFD CAN Card.
CAN FD each channel is separately isolated against USB with a maximum of 2500V.
9
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Specification
Connector
Dual Channel CANFD 2X3PIN 1mm Connector
Others
Temperature -40°~ 85°
10
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
11
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
LED Indication
Description Indication
B CAN0 120Ω Term On, CAN0 Term Enable; Off, CAN0 Term Disable
C CAN1 120Ω Term On, CAN1 Term Enable; Off, CAN1 Term Disable
12
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Design Reference
Vendor:HDGC1002WR-S-3P
Design End
Vendor:HDGC1002H-5P
13
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
MINIPCIE Connector
Vendor:Lotes,AAA-PCI-049-K01
14
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
3 Connection
15
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Notes:
Note: Remove jumper When build in 120Ω Note: Add jumper When build in 120Ω
termination resistor Enable. termination resistor Disable.
16
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
4 Software Description
SavvyCAN-FD-X2 device can run properly without any additional driver request on all Linux
system as below.
17
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Ubuntu:
Cosmic 18.10
Disco 19.04
Eoan 19.10
Groovy 20.10
Hirsute 21.04
Tumbleweed
Debian:
Wheezy 7.11
Jessie 8.11
Stretch 9.9
Buster 10
Bullseye 11
18
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Connect device to your Linux computer As below picture and follow chapter 2.2 to activated
120Ω resistor by hardware, use the 2pcs db9 to termination board we provide and put on
jumper in red circle.
19
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Prepare
Type command ifconfig -a to check ‘can0’ and ‘can1’device is available in system, if you can
not find the command ifconfig, use command sudo apt-get install net-tools
Note:
This tool is a very easy way to test SavvyCAN-FD-X2 module communication. There is only a
simple use instruction. For more details, please refer to can-utils user manual and source
code. https://github.com/linux-can/can-utils/
Send/Receive
Initialize CAN port, Open two termination command for can0 and can1.
sudo ip link set can0 down
sudo ip link set can0 up type can bitrate 50000 dbitrate 2000000 fd on
20
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
21
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
4.3.4 C Demo
(1) Check the Python version of your Raspbian. Python 3.7.3 default in
2019-09-26-Raspbian.img. Our Demo can run on any Python3 version.
python3 -V
(2) If you can’t find the Python3 in system. Install the Python3
sudo apt-get install python3-pip
22
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
Now with previous demo’s code to show you how to program socket can in Raspbian with C
and Python . The socket can is an implementation of CAN protocols(Controller Area Network)
for Linux. CAN is a networking technology which has widespread use in automation,
embedded devices, and automotive fields. While there have been other CAN
implementations for Linux based on character devices, Socket CAN uses the Berkeley socket
API, the Linux network stack and implements the CAN device drivers as network interfaces.
The CAN socket API has been designed as similar as possible to the TCP/IP protocols to
allow programmers, familiar with network programming, to easily learn how to use CAN
sockets. For more Socket CAN detail please refer to below link:
https://www.kernel.org/doc/Documentation/networking/can.txt
https://elinux.org/CAN_Bus
Programming in C
(1): Create the socket, If an error occurs then the return result is -1.
(2): Locate the interface to “can0” or other name you wish to use. The name will show when
you execute “./ifconfig –a”.
23
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
(4): Disable sender’s filtering rules,this program only send message do not receive packets.
(6): Send message to the can bus.You can use the return value of write() to check whether all
data has been sent successfully .
24
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
(4):Define receive filter rules,we can set more than one filters rule.
Programming in Python
Import
import os
The OS module in Python provides a way of using operating system dependent functionality.
The functions that the OS module provides allows you to interface with the underlying
operating system that Python is running on – be that Windows, Mac or Linux. We usually use
os.system() function to execute a shell command to set CAN.
import can
The python-can library provides Controller Area Network support for Python, providing
common abstractions to different hardware devices, and a suite of utilities for sending and
receiving messages on a CAN bus.
For more information about python-can, please to below link:
25
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
https://python-can.readthedocs.io/en/stable/index.html
ifconfig
If you are use Ubuntu system, It may can’t use the ‘ifconfig‘ command. Please install the net
tools.
sudo apt install net-tools
Error Frame
You may receive some error frame marked in red when you use the USB2CANX2-FD module.
They will tell you what problem does the USB2CANX2-FD module meet on your CAN Bus.
Some people would say why didn’t they meet the error frame with other tool or USB to CAN
module before. The truth is that most of the tool filter out the error frame to avoid
controversy and support. They just show nothing when there are some error on the CAN Bus.
We want to show the all raw data to help you to analyze your CAN BUS. Some error can
be ignored, but some error maybe the hidden danger for your CAN BUS.
26
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
https://github.com/linux-can/can-utils/blob/master/include/linux/can/error.h
Now we take a simple case to show you how to analyze the error frame ID. I made the
incorrect connection between the USB2CAN module and the CAN Bus, to see what happens.
As Above, We received error frame Id: 0x20000024 and 2 set of 8 byte Frame Data:
data[0]=0x00, data[1]=0x0C,data[3] to data[7] are all 0x00 .
data[0]=0x00, data[1]=0x30,data[3] to data[7] are all 0x00 .
27
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
So the USB2CANX2-FD meet two problem ‘received no ACK on transmission’ and ‘controller
problems’.
For problem ‘received no ACK on transmission’ may case by the not CAN-BUS or other
module on the CAN BUS are only listen mode(No ACK).
Summing up the above, the error frame tell us, USB2CAN module can’t get ACK from CAN
BUS and can’t send data to the CAN Bus. So the CAN Bus may not inexistence or the
connection error.
28
High Speed USB2.0 To CAN FD Converter
Data Field Up to 12M Max
5 SavvyCAN Software
https://docs.pibiger-tech.com/home/savvycan-series/savvycan-fd
29