Giter Site home page Giter Site logo

i2c-sniffer's Introduction

I2C sniffer project

  • Board: STM32F103C8T6 "Blue Pill"
  • Pins used:
    • PA9: TX (connect to serial RX)
    • PA10: RX (connect to serial TX)
    • PB8: SCL
    • PB9: SDA
  • Serial baud rate: 3 000 000 bits/s
  • Additional required hardware: FTDI232 (or similar) USB-to-Serial converter

Project Purpose

This project is built to connect to any I2C network and process any data sent through it in a transparent way. It's useful for debugging faulty networks.

Notes

  • This project was built in STM32CubeMX for the free STM32CubeIDE. If you load the project in STM32CubeMX, you can export it to use any other IDE of your choice.

  • This project sets the processor clock to 72 MHz, the highest one achievable, so that the I2C data can be processed as fast as possible.

  • The serial output contains colours. If your terminal doesn't support colours, you might see garbled characters.

  • UART is used to output the data. You can connect an FTDI232 USB-to-Serial converter to receive the information. Note that you have to use a converter that supports a baud rate of 3 Mbits/sec.

    The command I used to open the terminal on linux was:

    minicom -s -c on -b 3000000 -D /dev/ttyUSB0

    You can also use RealTerm on Windows.

  • The HAL driver is used, but all the necessary driver files are included in the Drivers folder.

Important files

  • Src/main.c: The source code of the project
  • i2c_sniffer.ioc: Open this file inside STM32CubeMX to edit the project.

Screenshot

I2C Sniffer serial output screenshot

Schematic

Project Schematic

Frequently Asked Questions

Q: Where can I buy the required board for this application?
A: The board needed is the small development board "Blue Pill" for an STM32F1 microcontroller. It costs about 2$ and can be found on common marketplaces like ebay or AliExpress (search for STM32F103C8T6). When getting started with these chips, you will also need an ST-Link device (~2$) available at the same sites, in order to program it.
Finally, an FTDI232 board (~2$) will be needed for serial communication with the Blue Pill.
In total, this sniffer should set you back by less than 6$, if you don't already have the required components.

i2c-sniffer's People

Contributors

deltaphi avatar kongr45gpen 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

Watchers

 avatar  avatar  avatar  avatar

i2c-sniffer's Issues

Version with lower baudrate

Could you possibly compile a version with a lower baudrate (no more than 128000)? My USB to serial adapter can't handle much more but I can't compile this code. The I²C-bus I am trying to monitor also runs at a leisurly ~40kHz, so the lower baudrate should not be a problem.

I would greatly appreciate it.

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.