Skip to content

ARENIBDelta/some_i2c_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Some I2C Examples

The goal of this project is to demonstrate the use of the I2C bus using various microcontrollers. Often the provided documentations are too short and the examples too stupid to be of any use.

Requirements

We need a master talking to a slave using the I2C bus, with the following constraints:

  • Being able to send and read multiple bytes with one transfer.
  • Neither the master nor the slave should crash or be stuck into a loop because there was an error on the bus. You should be able to power off any of the two systems and get it working when you power it back. Ideally, you should be able to detect a transfer error.
  • You should get the right packets at the right time (and not get an old packet which was stuck into a buffer).

Presented platforms

Stellaris Launchpad

TI's Stellaris Launchpad (EK-LM4F120XL, with LM4F120H5QR), using its DriverLib.

1 byte transfer

This example has a master sending a byte to a slave, and their reading one byte from it.

A version using interrupts and a version not using them are provided.

n byte transfer

This example has a master sending two integers and a char to a slave. The slave compute a simple math operation on the two integers. Then the master reads the result.

A version using interrupts is provided.

Non technical information

Author: Erwan Martin <public@fzwte.net>

ARENIB Delta

License: MIT unless noted otherwise

About

A few examples to use the I2C bus on some microcontrollers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages