Giter VIP home page Giter VIP logo

mcba_usb's Introduction

Linux kernel driver for Microchip CAN BUS Analyzer Tool

The CAN BUS Analyzer Tool is a simple to use low cost CAN bus monitor which can be used to develop and debug a high speed CAN network. The tool supports CAN 2.0b and ISO11898-2 and a broad range of functions which allow it to be used across various market segments including automotive, industrial, medical and marine. The toolkit comes with all the hardware and software required to connect a CAN network to a PC. The Graphical User Interface makes it easy to quickly observe and interpret bus traffic.

Product site

Originally the tool is supported on Windows environment only. This project adds support for the tool to Linux Kernel (SocketCAN).

NOTE: Driver is a part of Linux Kernel starting from 4.12 version

Usage

Building and installing

git clone https://github.com/rkollataj/mcba_usb.git
cd mcba_usb
make
sudo make modules_install
sudo modprobe mcba_usb

Basic SocketCAN usage

To start SocketCAN interface:

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

To send CAN frame:

cansend can0 001#DEADBEEF
cansend can0 1000001#DEADBEEF

To dump CAN frames:

candump can0

Supported bus settings

The tool works internally with 40Mhz clock. Following bus speed are supported by default:

  • 20 Kbps
  • 33.3 Kbps
  • 50 Kbps
  • 80 Kbps
  • 83.3 Kbps
  • 100 Kbps
  • 125 Kbps
  • 150 Kbps
  • 175 Kbps
  • 200 Kbps
  • 225 Kbps
  • 250 Kbps
  • 275 Kbps
  • 300 Kbps
  • 500 Kbps
  • 625 Kbps
  • 800 Kbps
  • 1000 Kbps

Note: Bittiming parameters are hardcoded inside device. Only speed can be configured using iproute2 utils.

Termination

The tool supports build in termination. It can be controlled by sysfs. To read current termination status:

cat /sys/class/net/can0/termination

To enable termination:

echo 1 > /sys/class/net/can0/termination

To disable termination:

echo 0 > /sys/class/net/can0/termination

Termination values are stored in device's EEPROM (no need to set it again after device reconnection).

Known issues

Official Microchip CAN BUS Analyzer firmware v2.3 contains bugs:

  • Too low SPI sychro time (PIC_USB->PIC_CAN) causes CAN frame to be lost
  • Sending remote frames do not work

Above issues are fixed in: https://github.com/rkollataj/mcba_firmware

mcba_usb's People

Contributors

pragma1ce avatar rkollataj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.