Code Monkey home page Code Monkey logo

i2c-analyzer's Introduction

Saleae I2C Analyzer

Saleae I2C Analyzer

Getting Started

The following documentation describes how to build this analyzer locally. For more detailed information about the Analyzer SDK, debugging, CI builds, and more, check out the readme in the Sample Analyzer repository.

https://github.com/saleae/SampleAnalyzer

MacOS

Dependencies:

  • XCode with command line tools
  • CMake 3.13+
  • git

Install command line tools after XCode is installed:

xcode-select --install

Then open XCode, open Preferences from the main menu, go to locations, and select the only option under 'Command line tools'.

Install CMake on MacOS:

  1. Download the binary distribution for MacOS, cmake-*-Darwin-x86_64.dmg
  2. Install the usual way by dragging into applications.
  3. Open a terminal and run the following:
/Applications/CMake.app/Contents/bin/cmake-gui --install

Note: Errors may occur if older versions of CMake are installed.

Build the analyzer:

mkdir build
cd build
cmake ..
cmake --build .

Ubuntu 18.04+

Dependencies:

  • CMake 3.13+
  • gcc 4.8+
  • git

Misc dependencies:

sudo apt-get install build-essential

Build the analyzer:

mkdir build
cd build
cmake ..
cmake --build .

Windows

Dependencies:

  • Visual Studio 2019
  • CMake 3.13+
  • git

Visual Studio 2019

Note - newer and older versions of Visual Studio are likely to work.

Setup options:

  • Workloads > Desktop & Mobile > "Desktop development with C++"

Note - if CMake has any problems with the MSVC compiler, it's likely a component is missing.

CMake

Download and install the latest CMake release here. https://cmake.org/download/

git

Download and install git here. https://git-scm.com/

Build the analyzer:

mkdir build
cd build
cmake .. -A x64

Then, open the newly created solution file located here: build\i2c_analyzer.sln

Optionally, build from the command line without opening Visual Studio:

cmake --build .

The built analyzer DLLs will be located here:

build\Analyzers\Debug

build\Analyzers\Release

For debug and release builds, respectively.

Output Frame Format

Frame Type: "address"

Property Type Description
address bytes The 7 bit I2C address
read bool True for read operations, false for write operations
ack bool True when the address was ACKed, false when NAKed
error str (optional) Present if an there was a problem reading the I2C data

I2C address byte

Frame Type: "data"

Property Type Description
data bytes 8 bit data word
ack bool True when the data byte was ACKed, false when NAKed
error str (optional) Present if an there was a problem reading the I2C data

I2C data byte

Frame Type: "start"

Property Type Description

I2C start condition

Frame Type: "stop"

Property Type Description

I2C stop condition

i2c-analyzer's People

Contributors

huffman avatar marcus10110 avatar ranihorev avatar schmicro avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

i2c-analyzer's Issues

Failed to Load Custom Analyzer

When building the analyzer, I do get an Analyzer.Dll in the bin directory.
When specifying that directory as source for custom analyzer in Logic 2.414 I do get during restart the error message:

Failed to load custom analyzer: Loaded library does not have required functions.

Is this analyzer code not up to date and using the latest SDK?
Or any other Idea what could be wrong?

Just to be sure: I also tried renaming everything in a way, that this does not conflict with existing I2C analyzer.

False Start/Stop bits

When an I2C device has SDA & SCL falling at the same time or SDA Rising and SCL falling at the same time it often results in recording false Start/Stop conditions.

image

I2C Analyzer does not differentiate between read and write

If I'm looking on the outcome of I2C Analyzer only, I do not understand how to differentiate between read and write transactions. The tooltip showed above SDA has way more informative format: W[Address] write_data R read_data. Unfortunately, I did not find a way to export it.

frame is ommitted from export file if it's a address, with ACK, with no data

Looks like if the analyzer sees an Address byte, followed by a ACK, then followed by a stop condition, the GenerateExportFile will not export it.

The issue can be seen here:

if( ( frame.mFlags & I2C_FLAG_ACK ) == 0 )

The export format tries to reformat the data so there is one row per data byte, with the address byte placed in an address column.

The analyzer should detect this case, and ensure a line is written with a blank data field if there are no data bytes included in the transaction.

Consider adding support for simultaneous SDA/SCL transitions

Currently, the I2C analyzer will interpret START and STOP conditions based on the order of the SDA/SCL transitions it is given. For example, a high-to-low transition on the SDA line while the SCL is high would be defined a START condition without any wiggle room. Therefore, our analyzer is unfortunately not suited to decode data when the transitions occur at the same time.

On a discussion thread here, a popular I2C part is mentioned (LIS3DH) that transitions SDA/SCL at nearly the same time (within ns). We should look into adding support for this in the analyzer.

See discussion thread here for more info:
https://discuss.saleae.com/t/i2c-repeated-start/941/9

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.