I2C: The Kindergarten Classroom of Protocols

Have you ever found yourself daydreaming idly, “If only there was something out there that allowed me the luxury of having several ‘masters’ communicate to several ‘slaves’ on a single embedded device… BUT -- with only two wires?” If so, then prepare to have your dreams come true! What we are going to look at today is a protocol and bus all rolled together called I2C, or more formally, Inter-Integrated Circuit. It’s a handy toolset to understand and have at your disposal as it is utilized in a wide variety of embedded platforms, data acquisition systems, components and sensors. That’s also why we at NetBurner include I2C in most of our embedded Ethernet web servers (core modules) and serial to Ethernet servers, along with an easy to use API – so let us show you how to get the most out of that technology including a code example at the end of the article!

One of the toughest challenges faced in today’s evolving market is communicating with legacy I2C and serial devices. To satisfy this need, NetBurner has added I2C-to-Ethernet support to the SB70LC’s serial to Ethernet factory application.

For those new to NetBurner, we provide a single source of hardware, software, development tools and technical support for all your network-enabled embedded system needs. NetBurner is dedicated to supporting the product and service needs of our customers.

This article will demonstrate how to interface a NetBurner device to the Sparkfun TMP102 temperature sensor using the I2C communication bus. The temperature readings can be read through the serial port of the NetBurner device, and will also be visible on the device’s web page. The web page will use Ajax (a type of javascript) to continuously update the reading without reloading the web page.