Back in olden days, parallel buses were used to link electronic building blocks. Today serial buses have largely replaced them. There are numerous components for many applications that have standard serial interfaces, and this trend makes serial technology a good choice for design engineers. Because there are fewer signal lines, serial bus electronics take up less board space. With fewer pins per device and lower power requirements, the cost is less as well. As for quality, a great plus factor is that the differential signal transmission used in serial schemes translates into better noise immunity.
The migration from parallel to serial data transmission has been problematic in one respect: In serial distribution troubleshooting and design prototyping there is a bit of a learning curve. The multiple wires in parallel transmission enable an orderly display of logic activity. When several channels are multiplexed into a two-wire circuit, a certain amount of background information is necessary about the various serial protocols if one is to make sense of the rapid flux of high and low logic states.
At this point we’ll back up and consider I2C in a little more detail. But first, by way of background, what is a bus? It comes from the Latin word omnibus, meaning “for all.” In electrical power distribution a bus is a metal strip or bar that conducts electricity, usually lots of it for relatively short distances as in switchgear or in an entrance panel. In computing and communications equipment, bus has a different though related meaning. It is the complete system that is involved in data transfer. It is the pathway between computers, nodes within a single computer or portions of a communications system, including the conductors, such as Ethernet cable, but also including the hardware at either end plus enabling software and protocols.
I2C stands for Inter-Integrated Circuit. It was invented by Philips Semiconductor in 1982 to facilitate communication between or among processors and microcontrollers, for the most part within the confines of a single circuit board, or by means of a cable connection, between devices on very nearby circuit boards. Since the mid-1990s, compatible products have been developed by Siemens AG, NEC, Texas Instruments, ST Microelectronics, Motorola, and others. Currently, anyone can implement I2C with no licensing fees.
In all instances, I2C is based upon a two-wire master-slave relationship, although there may be any number of masters and any number of slaves all on a single serial bus. All masters and slaves are connected in parallel between the two lines, just like receptacles in an electrical branch circuit. The logic high voltage is applied to one of the lines, and it is pulled down when any one of the devices conducts. The two wires are bidirectional open-drain lines. One is a serial data line and the other is a serial clock line. Both are pulled up by resistors, and common voltages are 3.3 and 5.0, although others are possible.
Nodes are either master or slave, determined by what they do. The master node generates the clock signal and initiates communication with the slave. The slave node receives the clock and responds when addressed by the master. The I2C bus is designed to accommodate any number of masters and slaves. After a transmission has ended, master and slave roles may be reversed.
Communication initiates when the master sends the seven-bit address of a slave, followed by a zero if it wishes to write or a one if it wishes to read.
If there exists a slave on the I2C bus that has the address as sent by the master, then it will send a one-bit acknowledge message, which is zero. All other slaves with different addresses ignore these transmissions. Then, depending upon whether the master has sent a read or write bit in the opening communication, both entities perform their prescribed roles.
When the system is idle, both lines are high. If any node drives the line low, it will be low. As mentioned, the clock signal is sent by the master. Any reasonable rate will work, so the system can be designed to accommodate the speed of the slowest slave. Moreover, if the receiving slave feels overwhelmed, it can slow the clock rate as required to process the transmission. This is called “clock stretching,” but with today’s high-speed devices, it is rarely necessary.
All masters on a given I2C bus monitor the bus for start and stop bits. While one master is using the bus, another master will not initiate a communication. If two masters are sending messages to two different slaves, the one sending a message to the slave having the lower slave address will take priority.
I2C has been extremely successful and is seen frequently in embedded systems. It is in everything from refrigerators to space ships. It has become ubiquitous in interfacing peripheral circuits to prototyping systems such as Arduino and Raspberry Pi.
A logic probe in conjunction with a logic pulser works well to follow the voltage fluctuations in a parallel bus system. But in serial transmission, the rapidly blinking LED is in over its head. The tool of choice is an oscilloscope with advanced logic capabilities such as the Tektronix MDO3104.
To get started, one needs a source for serial us signals. The Tektronix MDO Demo 1 Board provides numerous outputs including I2C. It is intended to go with the Tektronix MDO4000 Series oscilloscopes, but works well also with the MDO3000 Series instruments.
The Tektronix MDO Demo 1 Board comes with a special T-type USB cable that has dual USB type A connectors at one end. Both of these are to be plugged into the two USB slots in the oscilloscope. The reason for this is that the power requirements of Demo Board 1 are such that if a standard USB cable were to be used, it would overload a single USB output at the oscilloscope.
Once powered up, one red and two green LEDs indicate the board is ready for use. On all four sides of the board are numerous output terminals. They are suitable for probe connection using probe hook tips and ground return lead alligator clips.
For the present discussion, TPP 1000 10:1 probes plug into analog channel inputs One and Two. Both ground return leads connect to one of the board’s ground terminals, and the two probe tips hook onto the I2C data and clock signal terminals. As always, the ground return leads should be connected first, before the probe tips.
The oscilloscope then displays the I2C data and clock signals. Using the Channel One and Channel Two scale buttons followed by Autoset, these pulses can be enlarged for readability, and the acquisition can be stopped to make the display more stable. The Wave Inspector knobs can be used to pan and zoom the traces for a closer look. Then, it is a simple matter to compare points on the clock and data streams to ascertain the logic state (high or low) at any point in time. The vertical cursor, moved by turning Multipurpose Knob a, is helpful in seeing how these traces line up with respect to time.
Now that we have seen how a serial bus data and clock signals can be visualized using and oscilloscope, the probes can be connected to similar terminals in a functioning (or non-functioning) piece of electronic equipment. (Be sure to turn the acquisition back to Run.)