User manual
EMU3 emulator features UM0036
312/385 Doc ID 7705 Rev 11
Example 5—Measuring long time periods between events
The trace recording includes a Timestamp field, but the Timestamp's counter is only 30-
bits, while the maximum trace recording length is 256 Kbytes. This means that if you fill the
trace buffer, the Timestamp counter is filled and automatically reset many, many times, and
the Restart message appears in the Timestamp Event field each time the counter is reset.
50 seconds is the approximate time, using the internal 20 MHz clock, that the 30-bit
Timestamp counter can count before the counter is filled and it is reset. Therefore, if you
want to measure the time passed between two events and this time is longer than 50
seconds, the best thing to do is to set up an Advanced Breakpoint so that the trace is only
recorded between the two events of interest. ()
Note: This is almost true - in addition to the trace records that result from your Advanced
Breakpoints program, you may also have some forced trace recordings that occur every
time a Restart message occurs. This is because the timestamp counter is started at the
same time the program run is started. If the time passed between the start of the run and
the occurrence of the first event of interest is longer than about 50 s, there will be a trace
record that is blank except for the Restart message in the Timestamp Event column.
For this example, let's assume that we are interested in the time passed between the
reception of a certain input trigger signal and the outputting of a certain output signal. We
expect these two events to take place within the space of 256 Kbyte cycles.
We will program our Advanced Breakpoints window as described in the table below.
Note: It is necessary to start with Trace OFF so that the trace starts to be recorded after the
required event occurs and continues either until the second event occurs or the trace is full.
Once the two events of interest have occurred and you have a trace record spanning the
entire time between the events, proceed as follows:
Table 80. Advanced breakpoints summary
Step Description
START with TRACE OFF
LEVEL 1:
IF (input_probe value == 0xF)
THEN (Trace ON), GoTo Level 2
LEVEL 2:
IF (output_probe value == 0xF)
THEN (Trace OFF), Break
ELSE IF (trace_full = 1)
THEN Break;
LEVEL 3-4: (empty)