Logic Analyzer

Table of Contents:

What Is A Logic Analyzer? 

Logic analyzers are test instruments used to test, develop and debug complex digital or logic circuits. They are able to display traces of logic channels to reveal circuit operation [1]. The user of the logic analyzer chooses the points of observation in the system under test, provides names for the input signals, and then expresses when information should be captured in terms of the values observed in the input signals. Hence, a logic analyzer can be programmed to observe a precise subset of system state under specific system conditions [2]. For example, a logic analyzer can capture a trace of memory addresses transmitted between a computer's CPU and DRAM [2]. Logic analyzers can come as a standalone instrument chassis, built into oscilloscopes, PC based or linked to computers providing more processing power and flexibility [3].


Figure 1: Standalone Instrument Chassis Logic Analyzer [3]Figure 2: Image of a Logic Analyzer Connected to a PC [4]

An image of a standalone instrument chassis logic analyzer.

An image of a logic analyzer connected to a PC.


Advantages and Disadvantages of Logic Analyzers

Advantages of Logic Analyzers:

Disadvantages of Logic Analyzers:
  • Supports measurements of multiple channels not supported by oscilloscopes  [5]
  • Useful for debugging microprocessor or microcontroller based boards [5]
  • Logic analyzers do not focus on analog characteristics of a signal and its specific values [5]
  • They are not suited for analog measurements [5]


Application of Logic Analyzers

The following are some common steps for using a logic analyzer, these steps will be explained in further detail later [6]: 

  1. Connecting probes to the system under test
  2. Setting the sampling mode
  3. Configuring the trigger conditions
  4. Acquiring signal data
  5. Displaying and analyzing waveforms 


Probe Setup

  1. Most logic analyzers come with a wire harness containing a number of probes called flying lead probes, the wire harness should be connected to the logic analyzer [6]
  2. The system that is being tested should be powered off [6]
  3. Find the ground or common probe and attach it to the ground or common in your system, ground will be used as a reference voltage when sampling signal lines [6]
  4. Find the signal lines in the circuit that are going to be monitored, they should be GPIO lines or a communication bus, such as UART, SPI, or I2C [6]
  5. Attach one probe to each signal line [6]
  6. Most logic analyzers have clip-on probes that you can attach to headers, plated-through hole parts, or larger surface-mount devices [6]
  7. If you are working with small SMD parts with no exposed leads, you can solder thin wire to an exposed printed circuit board trace to give you access to the signal [6]


Figure 3: Clip on Probes Connected to a SMD Part [6]

An image showing an example of clip on probes connected to a SMD part.


Sampling Modes

Most logic analyzers have two methods of capturing and displaying data, which are the timing and state modes. Timing mode, also called asynchronous mode data, is useful to view data as a waveform that changes over time whereas state mode allows you to visualize data as a list synchronized to a clock. In timing mode data is captured at precise intervals according to the logic analyzer's internal clock [6].


Figure 4: Sampling a Sin Wave in Timing Mode [6]

An image showing a sin wave being sampled in timing mode.


State mode can be helpful to view data in the same manner a receiver on a transmission bus might see it. State mode also, called synchronous mode, requires one of the channels to be defined as a clock; signals on the other data lines are sampled on the edge/edges of the clock signal [6].


Figure 5: Sampling Inputs to D Flip-Flops in State Mode [6]

An image showing inputs to D flip-flops being sampled in state mode.


Trigger Configuration

Before data sampling can begin, trigger conditions must be configured. Most logic analyzers allow a user to configure a trigger by selecting a channel with the onscreen menu and selecting from a number of options such as rising edge, falling edge, and pulse width [6]. 

Specific trigger configurations include:

No Trigger

With no trigger, the logic analyzer will begin sampling and recording data as soon as the "Start" or "Run" button is pressed [6].

Edge Trigger

The logic analyzer can be set to watch for a rising or falling edge on a single channel, which will begin the recording process [6].

Pattern Trigger

If you are capturing multiple channels, you can set the logic analyzer to start the capturing process when it sees a pattern of 1s and 0s across several channels. Pattern triggers can be useful if you are looking for start-of-frame transmissions on parallel buses [6].

Complex Trigger

Some advanced logic analyzers will let you set a series of if-then-else statements to create a trigger. These types of triggers can be helpful to look for transmissions to a particular address on a bus [6].


Acquiring Signal Data

To acquire signal data, a button named run or start should be pushed. If no trigger is configure, the analyzer will begin sampling and storing data until memory is full. However, if a trigger is configured the analyzer will begin capturing data, but older samples will be deleted and be replaced by newer samples. When the trigger condition is met, the logic analyzer will continue capturing data until its memory is full. Some logic analyzers retain and display a portion of the data prior to the trigger point. This data is called negative time. Some analyzers have a repeat or continuous capture mode that will continually capture and display data in real-time without stopping. This mode can be helpful for looking for signals that you might not know exist yet [6].


Figure 6: Logic Analyzer Displaying Data

An image of a logic analyzer displaying data before the trigger point.


Generally, digital signals need to be sampled at least 4 times faster than their bandwidth. There is usually no harm in sampling significantly faster than this, and sampling faster improves timing resolution [7].


Displaying and Analyzing Data

Most logic analyzers will display data as waveforms with time in the x-axis and logic state (1 or 0) in the y-axis. This type of display is useful for seeing correlation among multiple signals in the time domain. Some logic analyzers come with the ability to decode various communication protocols, such as UART, SPI, I2C, etc. Decoders might show the data as a waveform but will also present the data as decimal, hexadecimal, ASCII, and so on. Advanced logic analyzers can be equipped with decoders capable of analyzing machine language and converting it to assembly code. This type of analysis requires software unique to each type of processor or instruction set [6]. 


Figure 7: Logic Analyzer Displaying Multiple Signals [6]Figure 8: Example of Decoding the ASCII Character 'a'  [6]

An image of a logic analyzer displaying multiple signals.

An image showing an example of decoding the ASCII character 'a' on the Tx line of a UART transmission.


To view the captured data in greater detail, most logic analyzers have buttons or knobs that allow scrolling or zooming in. Many analyzers will also search for patterns if numbers or ASCII characters are entered in. Setting decoders usually involves selecting from an available list in one of the analyzer's menus [6].


References

[1] E. Notes, “What is a Logic Analyzer,” Electronics Notes. [Online]. Available: https://www.electronics-notes.com/articles/test-methods/logic-analyzer/basics-tutorial.php. [Accessed: 01-Apr-2021].

[2] “Logic Analyzer,” Logic Analyzer - an overview | ScienceDirect Topics. [Online]. Available: https://www.sciencedirect.com/topics/computer-science/logic-analyzer. [Accessed: 01-Apr-2021].

[3] P. Mannion, “The Essentials of Logic Analyzers,” ElectronicDesign. [Online]. Available: https://www.electronicdesign.com/technologies/test-measurement/article/21805724/the-essentials-of-logic-analyzers. [Accessed: 01-Apr-2021].

[4] “Ikalogic SP209 9-ch logic analyzer & protocol decoder,” Elektor. [Online]. Available: https://www.elektor.com/ikalogic-sp209-9-ch-logic-analyzer-protocol-decoder. [Accessed: 01-Apr-2021].

[5] “Test and Measurement World,” Advantages of Logic analyzer,disadvantages of Logic analyzer. [Online]. Available: https://www.test-and-measurement-world.com/Terminology/Advantages-and-Disadvantages-of-Logic-Analyzer.html. [Accessed: 05-Apr-2021].

[6] “How to Use a Logic Analyzer,” Saleae Articles. [Online]. Available: https://articles.saleae.com/logic-analyzers/how-to-use-a-logic-analyzer. [Accessed: 07-Apr-2021].

[7] “What Sampling Rate Should I Use?,” Saleae Support. [Online]. Available: https://support.saleae.com/faq/technical-faq/what-sample-rate-is-required. [Accessed: 08-Apr-2021].

Contributors:

UserLast Update
Mayurakhi Khan 1153 days ago
Former user (Deleted)
Former user (Deleted)

Faculty Advisors: Kim Pope, John Thistle, Vincent Gaudet, Michael Lenover, Allyson Giannikouris