Feeling Comfortable
with Logic Analyzers
Application Note 1337
2
Contents
Introduction
Oscilloscope or Logic Analyzer? . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
What Is a Logic Analyzer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Timing analyzer basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
State analyzer basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
Using Digital Tools Efficiently . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
How to Connect to Your Target System . . . . . . . . . . . . . . . . . . . . . .20
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
If you use the right tools for the job, your attempts to conquer your digital
debug challenges will be more rewarding and less time consuming.
Before you can choose the right tool, it is important to understand the
tools at your disposal and what they do best.
This application note gives you a quick overview of logic analyzer
basics. It doesn't cover many detailed measurements, but it does give
you a good idea of what a logic analyzer can do. We explore questions
like "Why should I use a logic analyzer?" and "What will a logic analyzer
do for me?"
www.agilent.com/find/logic
3
Oscilloscope or
Logic Analyzer?
When given the choice between
using a scope or a logic analyzer,
many engineers will choose an
oscilloscope. Why? Because a scope
is more familiar to most users.
However, scopes have limited
usefulness in some applications.
Depending on what you are trying
to accomplish, a logic analyzer may
yield more useful information.
Because of overlapping capabilities
between scopes and logic analyzers, either may be used in some
cases. How do you determine
which is better for your application? Let's review some basic
guidelines.
When to use a scope
• When you need to see small
voltage excursions on your signal
• When you need high time-interval
accuracy
Generally, an oscilloscope is the
instrument to use when you need
high vertical or voltage resolution.
To say it another way, if you need
to see every voltage excursion, like
those shown in Figure 1, you should
use a scope.
Many scopes, including the newgeneration digitizing ones, can also
provide very high time-interval
resolution. That is, they can measure
the time interval between two events
with very high accuracy. Overall, use
an oscilloscope when you need
parametric information.
Figure 1. Oscilloscope waveform
4
When to use a
logic analyzer
• When you need to see many
signals at once
• When you need to look at
signals in your system the
same way your hardware does
• When you need to trigger on a
pattern of highs and lows on
several lines and see the result
Logic analyzers grew out of
oscilloscopes. They present data
in the same general way that a
scope does: the horizontal axis is
time, the vertical axis is voltage
amplitude. But, rather than providing high voltage resolution
or time-interval accuracy like a
scope, a logic analyzer can capture
and display hundreds of signals at
once, something that a scope
cannot do. A logic analyzer
reacts the same way as your
logic circuit does when a single
threshold is crossed by a signal
in your system. It recognizes the
signal to be either low or high.
It can also trigger on patterns of
highs and lows in these signals.
In general, use a logic analyzer
when you need to look at more
lines than your oscilloscope can
show you, provided you do not
need precise time-interval information. If you need to look at
parametric information such as
rise time and fall time, a logic
analyzer is not a good choice (see
Figure 2). Logic analyzers are
particularly useful for looking
at time relationships or data on
a bus – for example, a microprocessor address, data, or
control bus. They can decode the
information on microprocessor
buses and presents it in a
meaningful form.
Generally, when you are past the
parametric stage of design, and
are interested in timing relationships among many signals and
need to trigger on patterns of
logic highs and lows, a logic
analyzer is the right tool.
Figure 2. Oscilloscope and timing waveforms
www.agilent.com/find/logic
5
Now that we have talked about
when to use a logic analyzer, let's
look in a bit more detail at what
a logic analyzer is. Up to now, we
have used the term "logic analyzer" rather loosely. In fact, most
logic analyzers are really two
analyzers in one. The first part is
a timing analyzer, and the second part is a state analyzer.
Each has specific functions that
we will talk about in the following sections.
Timing analyzer basics
A timing analyzer is the part of a
logic analyzer that is analogous
to an oscilloscope. As a matter of
fact, you can think of them as
close cousins.
The timing analyzer displays
information in the same general
form as a scope, with the horizontal axis representing time
and the vertical axis as voltage
amplitude. Because the waveforms on both instruments are
time-dependent, the display is
said to be in the time domain.
Choosing the right
sampling method
A timing analyzer works by sampling the input waveforms to
determine whether they are high
or low. It cares about only one
user-defined voltage-threshold. If
the signal is above the threshold
when it samples, it will be displayed as a high or 1 by the analyzer. Any signal sampled that is
below the threshold is displayed
as a 0 or low. From these sample
points, a list of ones and zeros is
generated that represents a onebit picture of the input waveform. As far as the analyzer is
concerned, the waveform is
either high or low – it does not
recognize intermediate steps.
This list is stored in memory and
is also used to reconstruct a onebit picture of the input waveform, as shown in Figure 3.
What Is a
Logic Analyzer?
Figure 3. Timing analyzer sample points
6
Take a look at the display shown
in Figure 4, These waveform displays are actually the same signal (a sine wave) displayed by a
digitizing scope and a timing
analyzer. The timing analyzer
tends to square everything up,
which would seem to limit its
usefulness. We should remember,
however, that the timing analyzer
is not intended to be a parametric instrument. If you want to
check the rise time of a signal
with an analyzer, you should use
a scope. But if you need to verify
timing relationships among several or hundreds of lines by seeing them all together, a timing
analyzer is the right choice.
For example, imagine that we
have a dynamic RAM in a system
that must be refreshed every 2
ms. To ensure that everything in
memory is refreshed within that
2 ms, a counter is used to count
up sequentially through all rows
of the RAMs and refresh each. If
we want to make certain that the
counter does indeed count up
through all rows before starting
over, a timing analyzer can be set
to trigger when the counter
starts and display all of the
counts. Parametrics are not of
great concern here – we merely
want to check that the counter
counts from 1 to N and then
starts over.
Figure 4. The same signal displayed by an oscilloscope and a timing analyzer
www.agilent.com/find/logic
7
Figure 5. Timing analyzer sampling an input line
When the timing analyzer samples an input line, it is either
high or low. If the line is at one
state (high or low) on one sample and the opposite state on the
next sample, the analyzer
"knows" that the input signal
transitioned sometime in
between the two samples. It
doesn’t know when, so it places
the transition point at the next
sample, as shown in Figure 5.
This causes some ambiguity as to
when the transition actually
occurred and when it is displayed by the analyzer.
The worst case for this ambiguity
is one sample period, assuming
that the transition occurred
immediately after the previous
sample point.
With this technique, however,
there is a trade-off between resolution and total acquisition time.
Remember that every sampling
point uses one memory location.
Thus, the higher the resolution
(faster sampling rate), the shorter the acquisition window.
8
Transitional sampling
When we capture data on an
input line with data bursts, as
illustrated in Figure 6, we have to
adjust the sampling rate to high
resolution (for example, 4 ns) to
capture the fast pulses at the
beginning. This means that a
timing analyzer with 4K (4096
samples) memory would stop
acquiring data after 16.4 µs, and
you would not be able to capture
the second data burst.
Note that in our usual debugging
work we sample and store data
for a long time where there is no
activity. This uses up logic analyzer memory without providing
additional information. We can
solve this problem if we know
when transitions occur and if
they are positive or negative.
This information is the basis for
transitional timing, which uses
memory efficiently.
To implement transitional timing,
we could use a “transition detector”
at the input of the timing analyzer
along with a counter. The timing
analyzer will now store only
those samples that are preceded
by a transition, together with the
elapsed time from the last transition. With this approach, we use
only two memory locations per
transition and no memory at all
if there is no activity at the
input. This transitional timing
technique is used in Agilent
16800/900 Series logic analyzers.
In our example, we can capture
the second burst, and also the
third, fourth and fifth bursts,
depending on how many pulses
per burst are present. At the same
time, we can keep the timing resolutions as high as 4 ns (Figure 7).
We can now talk about ‘effective
memory depth’, which equals the
total time data is captured divided
by the sampling period (4ns).
Note: This is a conceptual
description of the transitional
timing technique.
Figure 6. Sampling with a transition detector
Figure 7. Sampling at high resolution
www.agilent.com/find/logic