Search by Tags

How to use I2C library

 
Applicable for

Compare with Revision




Subscribe for this article updates

I2C Library provides easy access to I2C interface on Toradex module.

Use cases:

  • Digital to Analog converter
  • EEPROM
  • Real Time Clock
  • I/O expander
  • Touch screen LCD
  • Audio codec
  • and many more..

I2C Library

We provide free I2CLib including demo source code.

NOTE: Please use compatible I2C channel if you want to maintain compatibility between different Colibri modules.

Download project

Project Module compatibility Language Library Version
I2C PXA / Tegra C Toradex CE Library (Old)
I2C VFxx / iMX6 C Toradex CE Library (New)
I2C PXA / Tegra C# Toradex CE Library (Old)
I2C VFxx / iMX6 C# Toradex CE Library (New)

Demo application showing how to read time and date from the Real Time Clock

This application demonstrates the use of I2C library to read time, day of the week and date from the external Real Time Clock (available on Iris Carrier Board V1.1 , Colibri Evaluation Board V3.1 and Colibri Evaluation Board V3.2).

A schematic diagram of the setup can be seen here.

Demo application to show read and write operations on EEPROM

This demo explains how to use I2C library to perform read and write operations to an EEPROM chip. In this demo EEPROM 24C256 has been interfaced with Iris Carrier Board V1.1A.

The connections can be seen in the following schematic diagram.

NOTE: Pull-up resistors are already available on the Iris carrier board, so pull-up in the schematic of the EEPROM chip are not required, if used, will have no effect on performance.

Output of VC++ Demo

Output of VCSharp Demo