Inter Integrated Circuit (Inter IC or I2C)
I2C is a master/slave synchronous communications system developed by Phillips with rates of up to 3.4 Mb/s. I2C uses two bidirectional lines with clock (SCL) and data (SDA) signals. Slaves are addressed using unique address codes which can be in a 7 or 10 bit format, multiple masters can be used in a single I2C system, each with a unique address. Data transfer is initiated by the master with a start bit followed by the address of the desired slave and a read/write bit signaling that it wants to read from or write to the slave. The slave responds with an acknowledge bit (ACK). This tutorial will get you familiar with the LeCroy I2C Decode & Trigger Option.
A LeCroy WaveSurfer Xs-B series oscilloscope with the I2C option keycode installed.
2 passive Probes
WaveSource 100 demonstration signal source
Note: Although a specialized signal source is used in the following tutorial the explanations of how to set up measurements and interpret the results should be useful to WaveSurfer users who have other signal sources.
The WS 100 Demonstration Signal Source
The WS 100 signal source is a USB powered circuit board which has 6 sets of output waveforms. There are two sets of duplicate output connections on the WS 100 which are marked Ch1, CH2, and Trig. Table 1 summarizes all the available outputs. In this tutorial we will use selection S2 (I2C).
Displays shown in the tutorial are based on the following initial setup on a WaveRunner 6 Zi scope:
- Recall the default setup: File pull down > Recall Setup> Recall Default.
- Verify that the input coupling on both channels 1 and 2 is DC 1 M: Touch or click the channel 1 annotation box>touch or click on the coupling field >select DC 1M. Repeat for channel 2 if necessary
- Using the C1 dialog box of the front panel vertical scale control, set the channel 1 vertical scale to 1 V/division and the vertical offset to -3V. Repeat this action for channel 2
- Touch or click the Trigger annotation box on the display of the oscilloscope. Set up the trigger as follows: Edge-Trigger, Source :C1, Coupling : DC, Slope: Positive, Trigger Level: 2.5 V
- Press the Normal button in the Trigger area on the oscilloscope’s front panel.
- Connect the WS 100 to a front panel USB connector. If the Found New Hardware Wizard appears press the cancel button. Select S2 (I2C) of the WaveSource100.
- Connect one passive probe to Ch1 of the scope and Ch1 of the WS 100. Ch1 is the data of the I2C signal. Connect the ground lead of the probe to the ground connection on the WS-100 as shown in Figure 1.
- Connect one passive probe to Ch2 of the scope and Ch2 of the WS 100. Ch2 is the clock of the I2C signal. Connect the ground lead of the probe to the ground connection on the WS-100 as shown in Figure 1.
- Touch or click the Timebase annotation box on the display of the oscilloscope. This will bring up the Timebase dialog box.
- Set Time/Division: 20 ms, Select Set Maximum Memory and set Maximum Sample Points to 13MS.
- Press the Stop button in the Trigger area on the oscilloscope’s front panel
- This completes the initial setup. The scope display should be similar to Figure 2.
Use the Analysis pull down menu and select Serial Decode (Figure 3) this will bring up the Serial Decode dialog box.
In the Serial Decode dialog box check the Decode 1 ‘Decode On’ check box.
Select the Decode 1 Protocol to be I2C.
If not already selected choose C1 and C2 to be the source channels.
Turn off the channel 2 trace.
Finally, check the Link to Trigger On checkbox as shown in Figure 4.
Touch or click the Decode Setup tab in the Serial Decode dialog box.
Set the ‘Table # Rows’ entry to 10.
Turn on zoom by pressing the Zoom button (magnifying glass over waveform icon) on the front panel.
Click or touch any entry on the decode table, a popup will appear offering you five choices shown in Figure 5:
Off – Turn off serial decode
Zoom – Turn on Zoom and expand the selected decode
Setup – Turn on the Serial Decode dialog box
Export – Save the decode table in .CSV format
Measure – Not available in the WaveSurfer product line.
Choose Zoom. Note that the zoom trace is updated to show the selected decode.
Touch or click on the Trigger annotation box or press the Setup button in the front panel trigger group.
This will cause the trigger dialog box to appear. Select the I2C tab as shown in Figure 6.
Having checked the Link to Trigger box on the serial decode setup you will find that the basic configuration of the signals sources has been automatically transferred to the trigger setup.
There are 8 trigger types to choose from. We will setup a trigger based on the I2C address and data content.
Press the button that is labeled Addr+Data in the Trigger type section of the I2C trigger setup.
The grayed out areas in the Address Setup and Data Pattern setup will activate.
Enter the value 4C into the Address field in the Address Setup.
Enter the value 65 into the Data Value field in the Data Pattern Setup.
Touch or click the Zoom (Z1) trace annotation box. When the Zoom dialog box appears press the reset zoom button. This will reset the zoom so that the trigger point is centered on the screen.
Use the Horizontal In button to expand the zoom trace. The trace will expand about the trigger point so we can see the packet that is aligned with the trigger point as shown in Figure 7.
Close the Zoom dialog box.
Your display should be similar to Figure 8. Only packets with address 4C and with Data value equal to 0x65 will trigger the scope.
Go back to the Decode Setup. On the Basic tab change the Viewing selection from Hex to ASCII. The decode content will now be displayed as ASCII text as shown in Figure 9. Note that you also have the option to see the data in Binary.
This completes this tutorial.