Professional Documents
Culture Documents
I2C Exerciser Advanced Trigger Tutorial
I2C Exerciser Advanced Trigger Tutorial
Page 1
Non-Consecutive
Events
Consecutive
Events
Start
Start
State 1
State 1
No
No
Event A?
Event A?
Yes
Yes
State 2
State 2
Event B?
Event B?
Yes
Yes
Trigger
Trigger
No
No
Page 2
Pulsing I/O
The I/O can be configured as active HIGH or active LOW. The signal will be driven to the inactive state at
the beginning of the test, and then pulsed to the active state for approximately 0.5 ms. This allows the
AT1 or AT2 port on the front panel of the bus analyzer to be connected to the trigger input of an
external instrument.
Note: The USB communication link between the bus analyzer and I2C Exerciser software will exhibit
a typical latency of about 1.6 ms, though this may vary anywhere from 1.5 ms to 150 ms depending
on transaction load. It is important to ensure that the instrument being triggered has enough pretrigger buffer memory to overcome this delay.
Page 3
Page 4
Page 5
Figure 5. Trigger template for single event repeated for N times consecutively
Page 6
Page 7
Next, we add a condition to evaluate the data byte and match the value 64h. To do this, right-click the
AND symbol again and choose Insert After | Compare Data Byte | equals. Enter the values 64, FF, and
0 as prompted. This means the data byte must equal 64h with a mask of FFh (evaluate all bits) on the
data byte in position 0 (the first data byte).
Page 8
Finally, change the TxType = Addr value to Data and change the Address = A0 value to 9A either
by double-clicking the value or by right-clicking the value and selecting Edit. The Trigger tab should
now resemble Figure 7 below.
Page 9
Now that the initial event has been defined, the main values included in this Subtree can be copied to
the other two conditional statements. First, remove the existing conditions Subtree by right-clicking the
AND symbol under the first ELSEIF statement as shown in Figure 8 below.
The ELSEIF statement now has no event Subtree. Repeat the process for the second ELSEIF statement.
Page 10
We are now ready to copy the first Subtree to replace the deleted conditions. First, right-click the AND
symbol under the first IF statement and select Copy Subtree. Next, right-click the first ELSEIF
statement and choose Paste Subtree. Finally, right-click the second ELSEIF statement and choose
Paste Subtree. The Trigger tab should resemble Figure 9 below.
Page 11
The new conditions need to be adjusted. The first ELSEIF statement should move to the TRIGGER state
when C1 reaches 1. Double-click on the entry C1 > 1 under the first ELSEIF statement and choose C1
= 1.
For the second ELSEIF statement, we want the conditions to be met when the data byte does not equal
64h, regardless of counter state. To fix this, double-click on the DataByte entry to edit it and select !=,
64h, FF, 0. The counter value should not be evaluated for this set of conditions, so right-click the
value C1 = 1 and choose Delete. The Trigger tab should now resemble Figure 10 on page 13.
Page 12
The original template was configured to evaluate 4 consecutive events, but we only need 3. Double-click
on the entry Set C1 to 4 in the last THEN statement and change the value to Set C1 to 3.
Page 13
Finally, click Save As and give the file a name to save your work, then switch the radio button at the
top to Enable Trigger (Active Mode). The next time the Monitor is run, the Trigger will be active.
Page 14
Master emulation
The CAS-1000 can be used to emulate the master that we will be evaluatingthis is very useful for
verifying the trigger script. The master emulation script below emulates a master reading data from a
tc74 temperature sensor using the Read Temperature (TEMP) command. The script sequence below
can be used with the CAS-1000 Emulator module with the setting Forever to continuously read
temperature values from a tc74 temperature sensor.
main()
{
b10Bit = FALSE;
// addr type
Slave Emulation
The slave SDF file should include conditions that cause the trigger to fire as well as some negative test
cases. The slave data below will cause the trigger sequence that we have defined fire on the third
consecutive 64 value. Save the code below in a slave data (.SDF) file to use it with the CAS-1000-I2C/E
slave emulation module.
// Sample Data
50 52 51 54 55 57 58 58 59 60 59 60 60 59 60 60
61 61 62 62 61 63 62 61 63 63 64 63 64 64 64 64
Page 15
Page 16
Click OK to save the master definition and we are now ready to run the scripts.
Click the Run icon to start the emulated devices. The Status for both the master and slave should now
display Running. Click the Monitor icon to return to the Monitor. If the Trigger tab is not already
visible, use the menu to select Trace | Trigger to bring up the definition window. Change the mode
from Disable Trigger (Design Mode) to Enable Trigger (Active Mode) to arm the trigger. We are
now ready to collect data to test the trigger!
Click the Run Single icon or press F11 to start the monitor. The system should trigger almost
immediately once the monitor startscheck the trigger status by changing from the Trigger tab to the
Run Status tab in the Monitor Tools window. The status should include the word Trigger in red text to
indicate that the trigger conditions were met.
The monitor window should resemble Figure 14 below. The master and slave were running continuously
in the background, so the line numbers will vary depending on when during the sequence the monitor
was started.
Page 17
Additional Tips
The advanced trigger function of Corelis bus analyzers is highly configurable and very powerful. The tips
below will help you get the most out of your bus analyzer.
Make use of the master scripting function for testing your trigger
Many events are infrequent, intermittent problemsif an event only happens every few days, it is
important to test the trigger prior to gathering data. The master script function or Debugger module can
be used to mimic the system master to make sure that the CAS-1000 triggers on the desired event.
Page 18