You are on page 1of 1

Arduino playground - I2C

1 1

Arduino: Playground
view history edit print login register The playground is a publicly-editable wiki about Arduino. Deutsch English Espaol Franais Italiano Portugus

search

I2C / TWI (Two-Wire Interface)


Arduino
I2C / TWI Arduino Diecimila Pinout: Arduino analog input 4 = I2C SDA Arduino analog input 5 = I2C SCL Example (From Keith's Electronics Blog - Arduino I2C Expansion I/O) #include <Wire.h> void setup() { // ... Wire.begin(); // ... } // include Wire library for I2C

Manuals and Curriculum Board Setup and Configuration Development Tools Interfacing With Hardware Output Input Storage Communication General Interfacing with Software Code Library and Tutorials Suggestions & Bugs Electronics Technique Sources for Electronic Parts Related Hardware and Initiatives Arduino People/Groups & Sites Exhibition

// start Wire library as I2C-Bus Master

Wire.begin() initializes the Wire library as an I2C master and reconfigures analog pins 4 and 5 as I2C pins. Wire.begin(address) initializes the Wire library with the Arduino functioning as a slave at address address. Wire library Wire library will enable ATMEL internal Pullup's. So using additional pullup's with a short bus may not be required, for example interface only a single nearby EEPROM.

I2C
Philips Semiconductors (now NXP Semiconductors) developed a simple bidirectional 2-wire bus for efficient interIC control. This bus is called the Inter-IC or I2C-bus. Only two bus lines are required: a serial data line (SDA) and a serial clock line (SCL). Serial, 8-bit oriented, bidirectional data transfers can be made at up to 100 kbit/s in the Standard-mode, up to 400 kbit/s in the Fast-mode, up to 1 Mbit/s in the Fast-mode Plus (Fm+), or up to 3.4 Mbit/s in the High-speed mode. (Description from NXP I2C-bus specification and user manual v3)

TWI (Two-Wire Interface)


TWI is ATMEL's own implementation of a compatible Philips I2C protocol often called "2-wire Serial Interface".

System Management Bus (SMBus)


Project Ideas Languages The System Management Bus (SMBus) is a two-wire interface through which various system component chips can communicate with each other and with the rest of the system. It is based on the principles of operation of I2C. (Description from System Management Bus (SMBus) Specification)

PARTICIPATE create an account suggestions formatting suggestions all recent changes PmWiki WikiSandBox training Basic Editing Cookbook (addons) Documentation Index

DataSheet
NXP I2C-bus specification and user manual v3 Philips I2C-Bus Specification v2.1 System Management Bus (SMBus) Specification ATMEL ATmega168 DataSheet (Arduino Diecimila) - Look at 21. 2-wire Serial Interface

Playground Links
Interfacing an I2C EEPROM

Links
edit SideBar

Keith's Electronics Blog - Arduino I2C Expansion I/O: detailed tutorial on getting I2C working. Arduino and the Two-Wire Interface (TWI/I2C) interfacing with a LIS3LV02DQ accelerometer. I2C for X9241 Digital Potentiometer - Interfacing with the X9241 Digital Potentiometer I2C for RTC DS1307 Real Time Clock - Interfacing with the DS1307 date/time keeping clock - Great for logging events.

Share |

file://J:\Arduino\Html\Arduino playground - I2C.htm

25/6/2012

You might also like