In this wide world we need to communicate with everybody to satisfy our needs likewise machines also need to interface with each other to give us the best possible result. If we need to communicate we need some language which should be known to each other likewise machine also need some protocol to interact with other machine here we see one protocol named I2C which is used to communicate with any another machine.
I2C is abbreviated as Inter-IC or Inter Integrated Circuit which was developed by Philips Semiconductors now it has been called as NXP semiconductors. I2C protocol is based on the serial communication which means it transfers only one bit at a time.
It consists of two signal wires namely SCL (Serial Clock) and SDA (Serial Data).I2C needs only these two signal wires which will connect up to 128 devices. It supports Multi-Master devices. All data transfers are byte oriented transfer which sends 8 bit at a time. It has a wide range of bus speeds in which Standard bus mode is 100 Kbps while Fast mode is 400 Kbps.
In this I2C, SCL signal wire transfer the clock signal while SDA signal wire transfer the data which is bidirectional. It does not need separate chip select line while address of slave which is to be interact with master is send through the SDA line of master. All devices signal each other by pulling down SCL and SDA. For this purpose we add Pull-up resistor in the SDA and SCL lines. For 100 kbps we use 2K resistors while for 400Kbps we use 10K resistor.
Role of Master: Initiating and terminating the bus transaction and generating all clock pulses.
Role of Slave: Listens for the address from the master and responds according to the master commands.
I2C Protocol Waveform,
- Before Start both lines are pulled high by external resistors.
- For Start condition, Clock lines become high while data line drops.
- After Start condition, data transfers most significant bit (MSB) first while least significant (LSB) bit at the last.
- Every 8th bit is Acknowledgement (ACK) bit, which tells the status whether all bits are received otherwise if it sends the NACK means that some peripheral missing or confusing or busy.
- For Stop condition, both SCL and SCK become high.
Note: I2C devices need a common ground to communicate. The Arduino Gnd pin must be connected to ground on each I2C device.
For more information please visit: www.tenettech.com
For technical query please send an e-mail: info@tenettech.com