Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
learn:fundamentals:communication-protocols:i2c:start [2016/07/11 20:38] – created Sam K | learn:fundamentals:communication-protocols:i2c:start [2021/10/14 00:11] (current) – Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== I²C ====== | ====== I²C ====== | ||
- | Inter-integrated-circuit, | + | Inter-integrated-circuit, |
I²C with its 7 or 10-bit addressing scheme offers the advantage of placing numerous devices on the single data and clock lines. A lone master is then able to start a communication session with a device by issuing a start condition and then submitting the address, as well as an indicator if it wants to read from or write to the device, on the SDA line to all of the listening devices. If the device that the host board is calling is on the line (pun intended), that device will respond with an acknowledge (ACK) bit leaving it to listen for the next command while the rest of the devices wait for another start condition before listening for their address again. | I²C with its 7 or 10-bit addressing scheme offers the advantage of placing numerous devices on the single data and clock lines. A lone master is then able to start a communication session with a device by issuing a start condition and then submitting the address, as well as an indicator if it wants to read from or write to the device, on the SDA line to all of the listening devices. If the device that the host board is calling is on the line (pun intended), that device will respond with an acknowledge (ACK) bit leaving it to listen for the next command while the rest of the devices wait for another start condition before listening for their address again. | ||
Line 53: | Line 53: | ||
* When the Serial Clock line reaches a high voltage level (after any clock stretching has been completed), the SDA line is then read by the receiving device to collect the data bit, as shown by each of the green bars. | * When the Serial Clock line reaches a high voltage level (after any clock stretching has been completed), the SDA line is then read by the receiving device to collect the data bit, as shown by each of the green bars. | ||
* This process of SCL transistions and data bits being placed and read continues until a stop bit, indicated by the SDA being pulled high by the pull-up resistors while the SCL line is high, occurs. | * This process of SCL transistions and data bits being placed and read continues until a stop bit, indicated by the SDA being pulled high by the pull-up resistors while the SCL line is high, occurs. | ||
- | |||
- | ==== Example Code ==== | ||
- | Demonstration code that uses the default I²C port on Digilent chipKIT boards is provided below. It uses the Wire.h library that comes with MPIDE and showcases Digilent' | ||
- | |||
- | (2/11/2015 - to be provided in the near future) | ||
- | ----- | ||
- | |||
- | ===== Hardware Compatibility ===== | ||
- | |||
===== More Information ===== | ===== More Information ===== | ||
Although this communication style is inherently not as fast as [[pmod: | Although this communication style is inherently not as fast as [[pmod: | ||
- | |||
- | Here is the list of Pmods that use the I²C interface | ||
- | |||
- | ^ I²C Interface | ||
- | ^ Pmod Name ^ Fastest Speed Supported | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||
- | | [[pmod: | ||