USB-CAN adapter (SYS TEC USB-CANmodul1) / Habr

USB-CAN adapter (SYS TEC USB-CANmodul1) / Habr

As you know, there are no computers with CAN interfaces in general sale. But all desktop computers and LapTop(s) have USB. In this regard, all kinds of USB-CAN adapters are needed to debug equipment with CAN. One of these is a German gadget SYS TEC USB-CANmodul1

A little Theory about the CAN interface

CAN is a two-wire differential serial half-duplex interface for transferring binary data between electronic PCBs. One shielded twisted pair of wires is most often used as a cable: CAN_L, CAN_H.

A CAN power line at a minimum bit rate of 10 kbit/s can reach as much as 5 km. At the maximum bit rate of 1 Mbit/s – 40 meters.

The main advantage of the CAN interface is the resolution of collisions without loss of bit rate. If two nodes start transmitting packets, then the device with the lower ID will continue transmitting.

CAN defines two OSI-7 level modules: physical and channel. That is, CAN also defines the binary structure of the package in the cable. The CAN packet includes such variables as packet ID, 8 bytes of data, packet length, 15-bit checksum, ACK confirmation bits.

At the application level, J1939, CanOpen, UDS and other protocols usually do.

The CAN interface is implemented in hardware in many microcontrollers as a digital electrical circuit inside the SoC. These are microcontrollers from STm, Artery, etc.

I have personally seen the CAN interface used in cars, RFID readers for miners, trucks, buses, nano satellites CubeSat(s) and space probes.

Hardware part

There is a USB-CAN adapter. It is called SYS TEC USB-CANmodul1. This is a product of the German company SYS TEC electronic. This is how it looks in nature.

SYS TEC USB-CANmodul1 in kind

The product is quite expensive around 39597 RUR. Here is the pinout of the main CAN connector.

Pinout of the DB-9 plug connector in the photo:

If you analyze the heat, you can understand that inside the black plastic sarcophagus there should be approximately such an electronic filling:

When nothing is transmitted, the CAN-L CAN-Н wires have a voltage of 2.1…2.24V. As a result, the voltage difference is zero.

What do you need from the documentation?

No

Name of the document

Version

Number of pages

1

USB-CAN module

2.06

147

What is needed from the equipment?

No

Equipment

Appointment

1

SYS TEC USB-CANmodul1

USB-CAN adapter

2

USB-USB micro cable

Cable to connect PC and USB-CAN adapter

What is needed from the software?

No

Name of the program

Appointment

1

CANinterpreter Lite for USB-CANmodul

CAN packet viewer

2

SO-387_V6.08r1.exe

Driver

3

Tera Term

To connect to the UART-CLI on the MCU

If you stick it straight out of the box into a NetTop PC, the Windows 10 operating system will not recognize it.

In this regard, it is necessary to obtain administrator rights and install the driver and the CANinterpreter utility from the vendor. Without this software, the SYS TEC USB-CANmodul1 adapter can only be scrapped.

By default, CANinterpreter is installed here
C:\Program Files (x86)\SYSTEC-electronic\CANinterpreter
C:\Program Files (x86)\SYSTEC-electronic\USB-CANmodul Utility Disk

When the driver is installed in the device manager, the adapter will appear like this

Before working directly with the USB-CAN adapter, it should be initialized. Initialization consists of selecting an instance and assigning a bitrate to it.

The CANinterpreter utility scans raw CAN bus traffic. Shows both CAN packets received from the street and CAN packets sent by itself. You can analyze the communication session. CAN packets are poured from top to bottom. This species can be called waterfall.

waterfall

However, to save monitor space, you can also view in the CANinterpreter program histogram by package ID

ID counter

Most likely, you are developing firmware for an electronic PCB with CAN and a microcontroller. To capture CAN packets on the MCU side, you need a technology like UART-CLI.

The plus is that in UART-CLI you can manually ask the microcontroller to issue a specific CAN packet. Like this.

cs 2 0x55 0x55AA01

On the microcontroller side, the UART-CLI clearly shows how CAN packets arrive from the utility. CANinterpreter.

You can also see how the microcontroller sends packets with ID: 0x7FF to the CAN bus

Here, CAN packets with ID: 0x7FF are received by the CANinterpreter utility on the host PC.

CAN bus works.

When a packet is running in the CAN bus, the green LED (traffic) flashes 2 times. If you disconnect the CAN bus from the adapter, the red LED (state) will blink with a frequency of 1Hz.

Project ideas with a USB-CAN adapter

1-You can engage in reverse engineering of CAN bus traffic of the car. Try to find some meaningful signals in the traffic in response to external stimuli. For example, pressing the gas or brake pedal, turning the steering wheel, etc. Then sell this data to car sharing offices and taxi fleets.

2–On-board equipment can be debugged via CAN. You can command electronic boards inside the units: update firmware, read diagnostics, prescribe configs.

3- You can make a text messenger.

Results

We learned how to use the SYS TEC USB-CANmodul1 device and the software for it.

Dictionary

acronym

transcript

CAN

controller area network

USB

Universal Serial Bus

PC

personal computer

MAC

medium access control

SoC

System on a chip

urls

https://www.systec-electronic.com/en/products/interfaces-gateways-amp-controls/sysworxx-usb-can-module1

https://teratermproject.github.io/index-en.html

Related posts