Code Monkey home page Code Monkey logo

i2c-tool's Introduction

I2C-tool

This github project contains two Arduino sketches aiming at testing I2C communication.

Introduction

The first sketch I2C-tool is the key one. It is an ESP8266 firmware implementing an I2C slave with spy, loop-back and configurable clock stretch injector.

The second sketch I2Ctest8266 is a test sketch. It tests the I2C master implementation (a bit bang driver) of ESP8266. It uses the I2C-tool for loopback.

Test setup

The two sketches each run on an ESP8266 using the following setup.

testsetup

Sketch I2Ctest8266.ino runs on ESP8266 number 1, mastering I2C transactions to ESP8266 number 2. ESP8266 number 2 runs the I2C-tool.ino looping back messages send by ESP8266 number 1.

The goal is to test the ESP8266 I2C driver (core_esp8266_si2c.c) which comes with Arduino setup for ESP8266. Since the ESP8266 does not have a working I2C hardware peripheral, the I2C driver is completely written in software (a so-called "bit bang" driver).

Wiring

The actual wiring is simple: connect the two ground pins GND (black), connect the two clock pins (SCL) D1 (green), and connect the two data (SDA) pins D2 (blue).

wiring

Wire both ESP8266's with USB to a PC. Load one with I2C-tool, flash it, run it, and monitor the serial output, it shows the loop-back traffic. Load the other with the I2Ctest8266, flash it, run it, and monitor the serial output, it shows the test results.

Details

The "user manual" of the I2C-tool is the readme associated with that sketch.

The readme of the I2Ctest8266 explains what is tested and the problems found in the bit bang driver.

i2c-tool's People

Contributors

maarten-pennings avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.