Skip to main content

I2C Bus, Interface and Protocol which is Used inside the RTL-SDR

I2C is a serial protocol for two-wire interface to connect low-speed devices like microcontrollers, EEPROMs, A/D and D/A converters, I/O interfaces and other similar peripherals in embedded systems. It was invented by Philips and now it is used by almost all major IC manufacturers. Each I2C slave device needs an address.



The I2C bus is popular because it is simple to use, there can be more than one master, only upper bus speed is defined and only two wires with pull-up resistors are needed to connect an almost unlimited number of I2C devices. I2C can use even slower microcontrollers with general-purpose I/O pins since they only need to generate correct Start and Stop conditions in addition to functions for reading and writing a byte.
Each slave device has a unique address. Transfer from and to a master device is serial and it is split into 8-bit packets. All these simple requirements make it very simple to implement I2C interface even with cheap microcontrollers that have no special I2C hardware controller. You only need 2 free I/O pins and few simple i2C routines to send and receive commands.
The initial I2C specifications defined a maximum clock frequency of 100 kHz. This was later increased to 400 kHz as Fast mode. There is also a High-speed mode which can go up to 3.4 MHz and there is also a 5 MHz ultra-fast mode.

I2C Interface

I2C uses only two wires: SCL (serial clock) and SDA (serial data). Both need to be pulled up with a resistor to +Vdd. There are also I2C level shifters which can be used to connect to two I2C buses with different voltages.

I2C Addresses

Basic I2C communication is using transfers of 8 bits or bytes. Each I2C slave device has a 7-bit address that needs to be unique on the bus. Some devices have fixed I2C address while others have few address lines which determine lower bits of the I2C address. This makes it very easy to have all I2C devices on the bus with a unique I2C address. There are also devices which have the 10-bit address as allowed by the specification.
The 7-bit address represents bits 7 to 1 while bit 0 is used to signal reading from or writing to the device. If bit 0 (in the address byte) is set to 1 then the master device will read from the slave I2C device.
The master device needs no address since it generates the clock (via SCL) and addresses individual I2C slave devices.

I2C Protocol



In normal state both lines (SCL and SDA) are high. The communication is initiated by the master device. It generates the Start condition (S) followed by the address of the slave device (B1). If the bit 0 of the address byte was set to 0 the master device will write to the slave device (B2). Otherwise, the next byte will be read from the slave device. Once all bytes are read or written (Bn) the master device generates Stop condition (P). This signals to other devices on the bus that the communication has ended and another device may use the bus.
Most I2C devices support repeated start condition. This means that before the communication ends with a stop condition, the master device can repeat the start condition with address byte and change the mode from writing to reading.

Conclusion

The I2C bus is used by many integrated circuits and is simple to implement. Any microcontroller can communicate with I2C devices even if it has no special I2C interface. I2C specifications are flexible – I2C bus can communicate with slow devices and can also use high-speed modes to transfer large amounts of data. Because of many advantages, the I2C bus will remain as one of the most popular serial interfaces to connect integrated circuits on the board.

Comments

Popular posts from this blog

Application Engineer- Prototyping at Siemens India

  Hello, Dear Readers, Siemens India has a vacancy for the Application Engineer role. Siemens EDA is a global technology leader in Electronic Design Automation software. Our software tools enable companies around the world to develop highly innovative electronic products faster and more cost-effectively. Our customers use our tools to push the boundaries of technology and physics to deliver better products in the increasingly complex world of chip, board, and system design. This role is based in Bengaluru. But you’ll also get to visit other locations in India and globe, so you’ll need to go where this job takes you. In return, you’ll get the chance to work with teams impacting entire cities, countries, and the shape of things to come We make real what matters! This is your role: Deploy Siemens EDA ProFPGA prototyping software and hardware solutions at customers and guide the customers to successful design bring-up Work closely with R&D to solve problems, review product spe...

Tutorial on EasyEDA desktop software for PCB and schematic design

In this article, I am going to write a tutorial on how to use EasyEDA desktop application for creating a schematic and for PCB design. One of best advantage of this software is that you can create design offline and can automatically synchronize your design with your online EasyEDA account.  It can be used for circuits simulation, PCB deign and electronics circuits design. You can download EasyEDA desktop application by clicking on following link and it will work on windows 7 or its greater version. They are also releasing soon offline application OSX and Linux users. So keep visiting their website for more information.                                                    https://easyeda.com/page/download So let’s start and see how to design a schematic and PCB using EasyEDA offline desktop application. So first of all lets see how to create a schema...

CMOS OPAMP Design Using LTspice

  Hello Dear Reader, Here in this post, I will give an idea about how CMOS OPAMP designing using 180nm technology node and using LTspice. from that opamp I have design switched capacitor integrator. Design Specifications: Here Design specification may be changed according to the application here my target is to design an active lowpass filter so I have chosen an opamp integrator so in the below I have explained how to design an opamp as well as an integrator in a 180nm technology node in LTspice. So let's start design First, we need a technology parameter file so that the file we can insert in the LTspice, in my example it is 180nm so mostly it is available from the  http://ptm.asu.edu/latest.html  and you make one text file using notepad or whatever is fit on your own. Then go to the LTspice and new schematic and then you see .op on the right most upper side click on it and give your text file path after .include  as shown in the below images.  Now first of all...