Briefing- I2C
INTER INTEGRATED CONTROLLER
Developed by Philips SC (low cost, simple interface, easy to use, used for simple interconnect).
Used to send data between microcontrollers and peripherals like EEPROM, RTC, Sensors, SD Card, LCD, RFID card module, consumer electronics.
It is a serial communication protocol.
Maximum speed is 5Mbps.
How I2C come into existence?
It is a simple bus having 2 wires for data communication.
SCL- Clock Signal Line (serial clock used for all data communication)
SDA- Data Signal Line (serial data)
(by default initially both should be high as it is pull-up connected to Vcc)
It is Half Duplex (either master or slave can send data at the same time through SDA Line). Either read or write operation possible via bus at a single time.
Master- The one which initializes a transfer, greater clock signal, terminate the transfer. (Slave cannot do these things)
(Master or slave can put the data on SDA line)
It is normally used for short distance communication means communication within same circuit board.
It supports multi master means here every device can access the I2C bus at a given time with arbitration process (it decides which devices act as master in multi master system). Slave takes instruction from master. Adding a new slave is easy. Add slave device without adding a new slave select line unlike SPI. It is the advantage.
I2C is slower than SPI (i.e. could be around 5Mbps, 10Mbps).
I2C uses a pull-up resistor.
It is preferable where large amounts of high speed data is not transferred.
It has the extra START and STOP bits. (whereas SPI don't have)
Note: R-pullup = 1.8kohm/4.7kohm/10kohm generally used.
Note: By default, it will be there. But if R-pullup resistor is not there, then?
- SDA and SCL lines will always be low (0v). I2C bus won't work (because master can't generate I2C start condition & address can't be transferred).
- R-pullup - pull the lines to 5V (high) and ensure I2C is always in known state.
- When the pull up resistor is not there-
- A slave if get switched on then also it will be forming a closed path and brings to grounded. (it should toggle between 1/0)
- So, when slave is attached = SCL and SDA is grounded (0 always)
- and when slave is removed = Since SCL is grounded and SDA will be floating values or undefined value
- When it is connected with pull-up resistor-
- At idle condition- when slave is not been connected then also both will be active high due to pull-up resistor connected.
- When bus is in idle condition (no slave is used), the Rp makes sure that the lines to high state (and not floating condition if external devices are disconnected or high 'z' is introduced).
- It present as undefined state at input.




.jpg)

Comments
Post a Comment