Introduction

This is an information page about i2c communication between devices.

In the purpose of testing the i2c communication, in this page Arduino Uno master and PIC16f877a slave functions are provided. You can easily understand and apply them to your project with some modifications according to your software requirements.

** FOR RASPBERRY PI USERS: Python code for Raspberry PI as i2c master is uploaded. Here, it should be noted that smbus2 library is used, please first download and install this library to your single board computers. By using this code, you can read and write multiple data via i2c protocol with devices that supports pure i2c (Arduino, PIC etc). The following challenges are solved by using the code with smbus2 library.

The challenge of using raspbery pi to communicate via i2c is that the python uses the smbus protocol, which uses different data package in multiple data transmission than pure i2c. More information about conflict in between smbus and i2c protocol in multiple data transfer can be seen below;

However, if the data transfer is not multiple (single byte read or write), there is no conflict between protocols, thus the modification is not needed in software. More information about data package in reading and writing single byte can be seen below;

Real Time Demo Experience

Project Groups have opportunity to enroll for demonstration of i2c system in the laboratory. Also, it is possible for gorups to use i2c test board for debugging purposes with appointment. For more information about i2c test board, please click here to see the document.

Project groups should arrange an appointment with sending a message to mertcan.kocak@ikc.edu.tr. At least 51% of group members must attend to the demonstration. (If project group consists of 4 students, 3 students must attend).

Notes and recommendations about i2c communication

*This page will be updated with the new works. Also, it is possible for you to contribute us to develop a better algorithms by means of i2c communication.

Additional document about Fuzzy Control with Matlab is here.