Using an Oscilloscope to Debug the I2C Protocol
July 19th, 2010A modern scope can take the tedium out of checking protocol operations in an embedded system with multiple I2C devices
In designing and testing an embedded system, engineers need to provide a way for the various devices and subsystems on the system, such as DACs, low-speed ADCs, fan control chips, EEPROMs, and PLDs to communicate. The Inter-Integrated Circuit protocol, more commonly known as I2C, is one of the more popular protocols in use today.
Unlike protocols such as SPI and UART that may need multiple dedicated I/O connections, I2C communication takes place using only two I/O connections. Since I/O connections on embedded systems are generally scarce and engineers need to use a minimal number of pins per device, the I2C protocol is often preferred. However, when using an embedded system with multiple I2C devices, debugging the I2C protocol can be tedious. But by using a modern digital oscilloscope for debugging, engineers can analyze the I2C protocol and view physical signals without disrupting the system.
Understanding I2C
It is important for engineers to understand the protocol thoroughly in order to select the correct set of tools for debugging. I2C is a multimaster single-ended serial protocol, which means it can support multiple slaves and multiple masters on the same bus. It is based on two bidirectional lines, Serial Clock Line (SCL) and Serial Data Line (SDA), which are pulled high with pull-up resistors. These lines together are commonly known as an I2C bus, which is used for communication among all I2C devices (multiple masters and slaves).
I2C protocol comes in four modes: Standard mode (100 kHz), Fast mode (400 kHz), Fast mode-Plus (1 MHz), and High Speed mode (3.4 MHz). The protocol consists of a Start bit, Address bits, read/write (R/W) bit, data byte, acknowledge bit (ACK), no-acknowledge bit (NACK), stop bit, and re-start bit (which is equivalent to Start bit without a stop bit).

Fig. 1. The screenshot shows I2C address, and how SDA and SCL signals are interpreted for various protocol components.
The Start bit (S) is always sent by a master to initiate communication. It is defined as high to low transition on the SDA line, while SCL is held high.
Address bits are either in a 7- or 10-bit format, depending on system configuration. The 7-bit format has fixed address bits and hardware-selectable address bits (optional), for a total of 7 bits. And the 10-bit format consists of a fixed command (11110) and a 10-bit address (fixed or hardware selectable).
The read/write bit (R/W) is the eighth bit on the address byte, where low is write and high is read, for the 7-bit addressing mode.
In the 10-bit addressing mode, read/write is a little more involved than the 7-bit addressing mode. The write operation consists of two bytes, and the read operation consists of three bytes.

Fig. 2. The display shows Write (top) and Read (bottom) addressing for 10-bit I2C mode.
The data byte is sent by the transmitting device (master or slave) and the acknowledge bit (ACK) occurs on the ninth SCL clock pulse. It is transmitted by the receiving device, while it pulls SDA line low. The no-acknowledge bit is transmitted when the receiving device fails to pull the SDA line low. The transfer is aborted when NACK is received. The stop bit is always sent by the master to end the communication. It is defined as low to high transition on the SDA line while the SCL line is held high.
Debugging the I2C protocol
Embedded-system engineers must make sense of the I2C messages sent back and forth on their system. They must identify the messages being sent to a particular device based on the device’s address, and then continue to analyze the payload/data bytes transferred between the devices.
Often, engineers use low-cost I2C sniffer/analyzers to capture I2C traffic for analysis. However, most embedded designs have no connector to attach an I2C analyzer on the embedded board, so engineers must look at electrical signals on the I2C bus to make sense of the error or messages transferred among devices.
The problem becomes even more complicated when the device that must be debugged is hot swappable, and engineers cannot put the entire system in debug mode. Oscilloscopes are very useful in these situations, because they allow engineers to probe the I2C bus and capture I2C traffic without disrupting the entire system.
Nevertheless, capturing I2C traffic is only half the battle. Engineers must also decode the messages sent to several devices, and so often spend many hours manually counting bits. An oscilloscope with an I2C trigger and decode package avoids the frustration of decoding messages manually and gives an instant snapshot of the I2C communication taking place.
For example, consider the state of a Nintendo Wii controller’s I2C bus while it is connected to a FreeStyleGames DJ Hero system (see Fig. 3). Since the Wii controller and DJ Hero communicate over I2C, several packets are being sent back and forth at any given time [1].

Fig 3. I2C traffic with multiple devices.
Using a modern digital oscilloscope, engineers can capture I2C traffic and use its decoding capabilities to analyze messages communicated between the master and the slave. The scope’s ability to decode the I2C protocol lets engineers debug the design efficiently and effectively. To quickly view timing and packet relationships, a table view provides a higher-level snapshot of a long I2C bus capture.
The table view in Fig. 3 shows messages (in the data column) sent to each device based on the device address (in the address column) and presents the data in a format similar to a sniffer/analyzer. Also, the scope’s I2C trigger capabilities enable engineers to focus on the device they plan to debug, using specific address and data triggers to isolate communication between a particular slave and master.
Advanced debug tools
Finally, some oscilloscopes also have feature-finding algorithms that help engineers interpret what surrounds the anomaly and what caused it on the SCL line (see Ffig. 4). The feature finder is especially helpful in locating the clock synchronization process, which is automatically performed by masters in a multi-master environment.

Fig. 4. The runt is shown in the yellow box and the “found feature” in the lower trace. The upper left shows a table of three features found that met this condition.
The I2C protocol is ubiquitous in embedded systems, but the protocol structure of multiple slaves and masters creates many challenges to solving problems in a system. Choosing the correct scope with specialized trigger, decode, advanced search, and viewing tools can simplify and shorten the debug process. ■
- Note that no claims are made regarding any known bug in Nintendo Wii and FreeStyleGames DJ Hero. These systems were used merely to provide an example of a hypothetical real-world situation.
(source www2.electronicproducts.com- Vrajesh Dave of LeCroy, Chestnut Hill, NY http://www.lecroy.com)



DENVER – Xcel Energy is now operating a first of its kind demonstration of a hybrid solar-coal approach,using parabolic-trough solar technology integrated with a coal-fired power plant. The project, located at Xcel Energy’s Cameo Generating Station near Grand Junction, Colo., is designed to increase the plant’s efficiency, decrease the use of coal, test the commercial viability of concentrating solar power thermal integration, and lower carbon dioxide emissions. Abengoa Solar developed the parabolic-trough technology, which concentrates solar energy to provide heat for producing supplemental steam for electric power production.
Terrestrial Trunked Radio (formerly known as Trans European Trunked Radio) is a specialized professional mobile radio [PMR] and two-way transceiver standard. TETRA was specifically designed for use by government agencies, emergency services (police force, fire department, ambulance), rail transportation staff, transport services and the military. TETRA is an ETSI standard, first version was published in 1995. ETSI, the body that published the standard for GSM which is currently the most popular standard for mobile phones in the world, TETRA works in a very similar way to GSM the main differences being, the handsets have a longer range and there is more bandwidth allocated for data. TETRA is endorsed by the European Radio Communications Committee (ERC) and mandated for use in Europe.
Terrestrial Trunked Radio (TETRA) is a digital trunked mobile radio standard developed by the European Telecommunications Standards Institute (ETSI). The purpose of the TETRA standard was to meet the needs of traditional Professional Mobile Radio (PMR) user organisations such as those listed below. The air interfaces, network interfaces as well as the services and facilities are specified in sufficient detail to enable independent manufacturers develop infrastructure and radio terminal products that would fully inter-operate with each other. For example, radio terminals from different manufacturers can operate on infrastructures from other manufacturers. The ability for full interoperability between different manufacturer’s products is a distinct advantage of open standards developed by ETSI. As the TETRA standard is supported by several independent manufacturers this increases competition, provides second source security and allows a greater choice of terminal products for specific user applications.















LOFAR started as a new and innovative effort to force a breakthrough in sensitivity for astronomical observations at radio-frequencies below 250 MHz. The LOw Frequency ARray is a multi-purpose sensor array. Its main application is astronomy at low frequencies (10-250 MHz) but also has geophysical and agricultural applications. Its heart is currently being assembled in the Northeast of the Netherlands and spreads over the whole country and over whole Europe.
Her Majesty the Queen will open the largest radio telescope in the world, LOFAR, on Saturday afternoon 12 June 2010 in Borger-Odoorn (Drenthe). The new LOFAR telescope has been built according to a completely new concept. No large dishes are used, but large numbers of small antennas.



