USBlini EB - USB to LIN board
USB-LIN-Adapter board

USBlini EB board
€ 29,90
incl. 19% VAT excl. € 4 shipping
Order USBlini EB now!

Buy on Amazon.de!
(€ 29,90 incl. 19% VAT excl. shipping)
Worldwide shipping!
English, Deutsch, Nederlands,
Polski, Türkçe, Čeština

USBlini - USB to LIN Interface

USBlini is an interface to connect a LIN bus via USB to a host system. It provides easy access to LIN bus devices and can act as both master and slave. It features a logic analyzer function to sample the logic levels on the LIN RX line.

Contents

Software

A Python library is available for easy and rapid development on different operating systems.

Python library "pyUSBlini" (Windows, MacOS, Linux)

pyUSBlini is a Python library for the USBlini adapter which allows easy, platform-independent access to LIN devices.


Step-by-step tutorial: How-to use USBlini with Python on Windows 10.

Installation

The easiest way to install the library is using pip:
pip install git+https://github.com/EmbedME/pyUSBlini

Drivers

The library uses libusb. On Linux and MacOS X no kernel driver is needed. Please use following tool for Windows to install the "WinUSB" driver:
Windows driver installation for USBlini
Depending on the application, under Windows a libusb-1.0.dll is required. These can be found for various architectures on the libusb project homepage under "Download -> Windows Binaries". Please place the DLL in the application folder (e.g. in the "Scripts" folder for Anaconda Python).

Example

Request data for ID 0x10 via master write:
from usblini import USBlini
usblini = USBlini()
usblini.open()
data = usblini.master_write(0x10, USBlini.CHECKSUM_MODE_LIN2, [])
print(data) # print out response
usblini.close()

Simple graphic interface "USBliniGUI" (Windows, MacOS, Linux)

USBliniGUI
Based on the python library there is a simple graphic application: USBliniGUI.


How-to use USBlini with Python on Windows 10 and run USBliniGUI.py.

Logic analyzing with PulseView (Windows, MacOS, Linux)

USBlini with Pulseview
With the logic recording function, the logic level on the LIN RX line can be captured and then analyzed with PulseView.


Note: USBlini communication is not yet integrated in sigrok/Pulseview (interested? Please contact me!). The logic levels can be recorded e.g. with USBliniGUI, then opened and analyzed in PulseView.

Firmware

Source code and HEX file

The firmware of USBlini is available as precompiled HEX file and as C (XC8 compiler) source code.

Precompiled HEX and source code archive:
USBlini_firmware_v1.01.zip (2022-11-08) Increased receive timeout (intrabyte: 16 tbit, response: 50 tbit)

USBlini_firmware_v1.00.zip (2021-12-28) First public version

Firmware update via bootloader

Start the bootloader via software (e.g. start_bootloader.py). Use a bootloader application (en MPHidFlash) to load the new firmware into USBlini:
mphidflash -w USBlini_firmware_v1.01.hex -r

Hardware

Schematic - USBlini's circuit diagram

USBlini Schematic

Partlist - Build your own USBlini!

Here you find a list of all parts needed to build your own USBlini board.

PartnumberValue
C14,7u
C2, C3, C4220n / 50V
C51u / 50V
C6220p / 100V
D1BAT54S
IC1PIC16F1454
IC2MCP2003B
LED1red LED
R1, R2, R31k
X1USB-B
X22pol 2.54mm

Troubleshooting

Linux: "LIBUSB_ERROR_ACCESS" as non-root

Add udev rule to give permissions to all users.
sudo bash -c $'echo \'SUBSYSTEM=="usb", ATTRS{product}=="USBlini", MODE="0666"\' > /etc/udev/rules.d/50-USBlini.rules'
sudo udevadm control --reload-rules
Please tell me about your USBlini project!

USBlini talks to 8W1919616
   Retrieve status from LIN slave 8W1919616 (Audi A4 audio control panel).

Example Python script: 8W1919616.py

by Thomas Fischl (06/2022)

Other LIN interface projects/products

en PLIN-USB by PEAK-System
en LUC by ucandevices
en Kvaser Leaf Professional LIN