The LeCroy I2CBus TD package contains powerful triggering options, including the ability to specify conditional criteria for your data patterns. These capabilities allow you to isolate and identify specific bus events, which let you quickly perform debug and verification of your design.
An example of an application where this would be useful is monitoring the output of an I2C-based temperature sensor. By observing the bus for temperature readings above a selected value, the behavior of your design in over-temperature conditions can be observed. In an I2Cbased temperature sensor such as the LM75, the current temperature is read by an I2C bus master, such as a microcontroller, as a 2-byte word. This word will contain a temperature reading whose bit length varies from device to device. In the case of the LM75, the temperature reading is a 2’s complement value that is 9 bits long and justified to the most significant bit position within the word (see Figure 1).
Let’s look at an example of triggering on a temperature above a certain threshold, for instance 40 °C. Note that since the I2CBus TD trigger function assumes that the data trigger conditions represent unsigned numbers, an upper bound is necessary in order to fully describe the conditions for triggering on a 2’s complement number greater than a certain value. Fortunately, the range triggering options included with I2CBus TD allow this condition to be easily accommodated.
As shown in Figure 1, the temperature 40 °C would be represented by the 9-bit binary value 001010000, which maps to the 2-byte word 0x2800 (since the binary value is left-justified within the word). Since the temperature data is represented in 2’s complement form, the highest positive temperature value is represented by the binary value 011111111, which corresponds to the word 0x7F80. Therefore, any temperature higher than 40 °C will be represented by a word that falls between 0x2800 and 0x7F80.
Using the I2CBus TD package, this condition can be triggered upon using an ADDR+DATA trigger. The ADDR should be set to binary “1001xxx” with a direction of Read. in order to identify the correct I2C device. For the DATA portion of the trigger, this condition can be identified using an INRANGE trigger with lower bound 0x2800 and upper bound 0x7F80, as shown in Figure 2 on the next page.
In order to ease the entry of complex data patterns, the I2CBus TD trigger setup interface allows you to input both addresses and data directly, in either binary or hexadecimal format. Inputting the correct parameters is as easy as typing the patterns out on the touch screen, allowing you to quickly set up your trigger patterns without having to spend lots of time twisting knobs.
Once the correct trigger patterns are entered, be sure to enable the I2CBus TD decode options in order to show the decoded bus traffic. Just enable the serial decode function, select I2C decode, and set up your clock and data channels. The corresponding address and data patterns will be overlaid on the clock and data waveforms (Figure 3).
By using the conditional data trigger options that are included as part of the I2CBus TD package, isolating specific events on the I2C bus is simple and easy, allowing you to find the conditions for which you are searching.