Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

How to Use a Logic Analyzer

Contents

You may have troubleshot some of the digital parts of your electronic devices and got lost in the process. Incidentally, could it have helped if you used a Logic Analyzer?

Introduction

Digital signals are very different from Analog signals in that their signal levels are well-defined. If you’ve designed a digital circuit before, you’ll surely know this. A logic high is defined as the minimum level of an input voltage that a chip determines as high. This is the opposite of a logic low, where the maximum level of an input voltage is determined as low.

Because of the discrete nature of digital logic, a logic analyzer (LA) comes in handy. Imagine trying to solve a complex timing, logic, or serial protocol issue by only using your oscilloscope or multimeter. This is quite hard to do. Consequently, a logic analyzer is best paired with a DSO (Digital Storage Oscilloscope). With this combination, you get to test both analog and digital circuits.

Types of Logic Analyzers

  1. Modular Logic Analyzers – these are like Digital Storage Oscilloscopes in form factor. They work stand-alone, sometimes hooked up to a PC. They display digital waveforms appropriately on their screens. They have a generous amount of digital ports that connect to circuits through test hooks or clips.
  1. Portable Logic Analyzers – As its name implies, they can be carried on the field as test equipment. They usually have smaller screens and are similar to portable DSOs. They have a limited amount of digital ports just right for fieldwork.
  1. PC-Based Logic Analyzers – If PC-based oscilloscopes are on the rise, then logic analyzers aren’t far behind. You’d also find a combination of PC-based oscilloscopes with Logic Analyzer functionality. A very popular LA brand named Saleae is probably best known among engineers, hobbyists, and students alike.

How Does A Logic Analyzer Work?

This part deals more with PC-based LA’s as they’re very popular among makers and hobbyists.

A logic analyzer works with a DUT (Device Under Test) or a SUT (System Under Test). LAs usually come with several probes that attach themselves to test points defined by the user. These probes are usually clips and are made exactly for that purpose; to attach themselves to hard-to-reach points in a circuit. You’ll usually find that you can insert them on exposed pins of ICs.

If you have a PC-based logic analyzer (which is very common among hobbyists and makers), you have to attach a USB cable from the LA to your PC. High-end LAs tend to have USB 3.0 interfaces and capture rates of up to 100 MHz. Low-cost PC-based LA capture rates can go as high as 24 MHz these days.

PC software is required for PC-based LAs. Saleae has its proprietary software, and it’s very easy to use. A similar software called Sigrok is a popular open-source signal analysis suite. We’ll focus more on how to use Sigrok.

Using The Sigrok Software

First, download the latest stable Release builds of Sigrok, It can be found in:

https://sigrok.org/wiki/Downloads

Choose your platform.

Sigrok comes in two forms, sigrok-cli and PulseView. Sigrok-cli is needed as a device driver for your LA hardware. PulseView is the actual LA software to be able to view your waveforms and analyze timing.

After installation, go ahead and launch sigrok-cli.

If this is the first time you’ve opened sigrok-cli you may have to install the WCID Driver.

If your device is not listed on sigrok-clik, click Options -> List All Devices.

If you plug your LA, you should see it in the list. Sometimes, if it’s a generic brand, it might be hard to distinguish it. Click on your device.

Now your device is ready to run as a Logic Analyzer in PulseView.

Your device may appear as Saleae Logic, even if it’s a generic brand.

In case your device gets disconnected, choose your device again in sigrok-cli. Then in PulseView,  connect to your device again on the drop-down menu.

Choose how many sample points you want to capture on the first drop-down.

On the second drop-down, choose what sampling rate you’d like to capture.

 

 

It’s essential to get the correct sampling points vs sampling rate ratio. If you have so many sampling points but have a low sample rate, you’ll end up with a very long capture. Likewise, if you have so few sampling points but have a high sampling rate, you may end up with a very fast capture.

Now it’s time to press Run to start capturing your waveforms.

You should see the samples being captured in real-time when you press Run. You have the option to press Stop when the capture takes too long, and you’ve already captured the data you want.

It’s possible to trigger on a port while capturing your data. You can trigger on the rising, falling, or both edges of a signal. You can also trigger on a level. Otherwise, choose the dot to simply show the waveform.

 

 

One thing that’s special about this Logic Analyzer software is its ability to run a decoder or a Protocol Analyzer. A Protocol Analyzer displays important information on your digital serial interfaces. Examples of these are SPI, I2C, or UART.

Here is an I2C Protocol Analyzer applied on an I2C waveform captured using the LA. To execute the protocol analyzer, press the Add protocol decoder above. Then on the left-side scroll below until you see I2C – Inter-Integrated Circuit.

As you can see the states of the I2C waveform can now be clearly defined.

We can also do measurements on this waveform (or any other digital waveforms for that matter). Click the Show Cursors menu above and then adjust the cursors. You’ll see there are timing markers both in microseconds and kilohertz format.

Conclusion

Logic Analyzers are indispensable tools when it comes to troubleshooting or analyzing complex digital data. Try to find the best Logic Analyzer for your workbench taking into account its form factor, cost, and characteristics. There is open-source software that you can use for your LAs, like Sigrok. It’s simple and easy to use. Use Saleae Logic Analyzers if you want a quality LA with proprietary software and complete customer support. Consequently, there are now DSOs with built-in LAs and you can check on those too.

Phipp’s Electronics has available Logic Analyzers as well as Logic Analyzer Test Hooks that you can use for your projects.

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top