Skip to content

OSTLCLab/SmartFactory_I2cCommunication

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartFactory_I2cCommunication

The i2c interface is a serial data bus to connect low speed devices. The data is transmitted via two wires, one being the clock line and the other being the data line. The i2c interface is based on the master-slave principle, whereby the master can push and pull messages to the slave. It is also possible to have more than one master in a system. The slave is identified by its address. Is a microcontroller as slave needed the address can be freely defined, if no other slave has this address. In the SmartFactory project, data is exchanged between the SorticRobot and the SorticRobot CommunicationHub via the i2c interface. Predefined structs are sent and received byte by byte. This enables a simple data exchange amongst linked systems.

Table of contents

Tools and technologies

The source code is implemented in the programming language C++. In the following, the tools for editing the project are listed.

Visual Studio Code

The development environment used is Visual Studio Code with the PlatformIO extension. The development environment can be downloaded open sourced. For an installation guide look here.

Doxygen

Doxygen was used for documenting the source code. For using Doxygen in Visual Studio code, the Doxygen Documentation Generator extension is available.

I2C

The binary signals for the i2c communication are generated by pull-up resistors. The clock line gives a time-delayed periodic square wave signal, which defines the clock of the transmission. The data bits are transmitted by a time-delayed aperiodic square-wave signal on the data line. For a more detailed explanation here.

i2c [Image: Circuit Base: I2C COMMUNICATION PROTOCOLL]

Hardware

Logic Level converter

A logic level converter is used to transform the different voltages of the binary signals. An explanation of the Logic Level converter can be found here.

converter [Image: Adafruit: LOGIC LEVEL CONVERTER

Software

I2C

The i2c interface was implemented with preprocessor instructions for handling as master or slave in the same interface. By uncommenting "#define MASTER" the slave version can be used.

// UNCOMMIT IF SLAVE

#define MASTER 

UML

The figure below shows the data model in UML notation.

Click on the image to open doxygen-documentation.

Includes

The figure below shows the include graph

Click on the image to open doxygen-documentation.

ToDo's

All the ToDo's are documented in the source code with Doxygen.

Contributors

Changelog

V 1.0 - Release SA HS20 - Philip Zellweger

License

MIT License

Links to SmartFactory

Packages

No packages published

Languages

  • C++ 100.0%