{"id":5754,"date":"2019-03-30T12:50:56","date_gmt":"2019-03-30T16:50:56","guid":{"rendered":"https:\/\/dronebotworkshop.com\/?p=5754"},"modified":"2023-04-11T17:56:32","modified_gmt":"2023-04-11T21:56:32","slug":"i2c-arduino-arduino","status":"publish","type":"post","link":"https:\/\/dronebotworkshop.com\/i2c-arduino-arduino\/","title":{"rendered":"I2C Communications Part 1 – Arduino to Arduino"},"content":{"rendered":"\n

\"Download \"Parts<\/a> \"View<\/a> \"Download<\/a><\/p>\n

Introduction<\/span><\/h2>\n

I2C communications have become the de facto method of communicating between microcontrollers, microcomputers and a variety of integrated circuits and sensors. It has been around since 1982 and was originally developed for use in television receivers.<\/span><\/p>\n

<\/div>\n

Although we have used many I2C sensors and displays in previous articles we have not actually looked into how I2C works and how it can be used to communicate between microcontrollers.<\/span><\/p>\n

Today we will correct that and learn more about I2C. We\u2019ll also see how it can be used to exchange information between two Arduinos and how it can be used to allows one Arduino to control another one.<\/span><\/p>\n

\"I2C<\/p>\n

This will be the first of four articles on I2C. In future articles we will see how we can build our own I2C devices, how to interface a Raspberry Pi and an Arduino using I2C and how to do some advanced I2C configurations, including using multiple masters on one I2C bus.<\/span><\/p>\n

Let\u2019s get started!<\/span><\/p>\n

I2C Communications<\/span><\/h2>\n

I2C is a serial protocol used on a low-speed 2-wire interface. It was originally developed by Phillips in 1982 to allow integrated circuits within television receivers to communicate with one another.<\/span><\/p>\n

Times have changed, Phillips is now NXP and I2C has become a communication standard that is supported by virtually every major semiconductor manufacturer.<\/span><\/p>\n

I2C is an abbreviation for \u201cInter-Integrated Circuit\u201d. It is also called \u201cIIC\u201d or \u2018I squared C\u201d. <\/span><\/p>\n

Uses and Limitations<\/span><\/h3>\n

I2C is used with microcontrollers like the Arduino and with microcomputers like the Raspberry Pi. Many displays and sensors interface to their host controller using I2C.<\/span><\/p>\n

I2C does have several limitations however. It is not particularly fast, although for most of its intended uses it is plenty fast enough. <\/span><\/p>\n

I2C can only be used over short distances, after all, it was originally meant to communicate between integrated circuits on the same printed circuit board. The maximum distance of reliable transmission decreases as the speed increases, at the slowest speed (100 Kbaud or a clock rate of 100 KHz) the maximum distance is about a metre.<\/span><\/p>\n

I2C Speeds<\/span><\/h3>\n

The original I2C bus had a maximum speed of 100 KHz. Most common applications still use this speed, as it is quite sufficient for transferring data from sensors and to simple displays.<\/span><\/p>\n

I2C and has some higher speed modes. Not all I2C devices support these modes:<\/span><\/p>\n