chipKIT Tutorial 6: Inter-Integrated Circuit (I2C) communication

I2C or IIC (Inter-Integrated Circuit) is a simple bidirectional serial interface, which requires only 2 signal lines for data transfer. It was originally developed by Philips in 1980′s to provide easy on-board communications between a CPU and various peripheral chips in a TV set. Today, it is widely used in varieties of embedded systems to connect many low speed peripherals, such as external EEPROMs, sensors, LCD drivers, port expanders, real-time clocks, etc, to the host microcontroller. In this tutorial, we will explore the chipKIT Wire Library for establishing an I2C communication link between the chipKIT Uno32 board and two I2C sensors. The Uno32 board receives the sensor outputs through the I2C link and displays the results on the serial monitor window on the computer screen. – See more at: http://embedded-lab.com/blog/?p=8232#sthash.9WEDvhyg.dpuf

TheoryAn I2C bus consists of two signal lines called SDA (data) and SCL (clock). Just line Arduino Uno, the chipKIT Uno32 board offers the SDA and SCL connections via analogue input pins A4 and A5 respectively. Each device connected to the I2C bus is software addressable by an unique 7-bit address. Multiple I2C devices can be connected to the same I2C bus as long as they have different addresses. A simple Master and Slave relationship exist at all times between the communicating devices. The Master device initiates a data transfer, generates clock signals and terminates the transfer. Any device addressed by the Master at any time is considered a slave.

Inter-Integrated Circuit (I2C) communication

Both SDA and SCL are open-drain lines, and therefore, require two pull-up resistors during operation. A more detail look of the I2C Bus protocol and how the exchange of information takes place between Master and Slave has been discussed in one of my previous tutorials, Inter-Integrated Communication in PIC MCU. So I am not going to repeat that here again.

 


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top