Do I need a Logic Analyzer?

In one of my previous posts I tried to answer the question: “Do I need an Oscilloscope?“. The answer has been a short: Yes, under some circumstances.

But, there is another great measurement tool available: A Logic Analyzer. There are a lot of options, and a quick look at them reveals one thing: They are so much cheaper than oscilloscopes with the same amount of channels. The cheapest oscilloscope from Rigol, the 1054Z with 4 channels costs about $399 (but more if you add some options), the cheapest Logic Analyzer from Saleae costs $109. If you are interested in buying an oscilloscope, but don’t want to spend so much money at it (yet), is a Logic Analyzer an alternative?

Well, the good news is yes! Under some circumstances. Sometimes it’s even a better buy than an oscilloscope. Let me first explain what a Logic Analyzer does and why it’s so useful and often more useful than an oscilloscope.

What is a Logic Analyzer?

A Logic Analyzer is a device that measures over time if a signal it is connected to is HIGH (typically above 1.8-2 V) or is LOW (typically below 0.6-0.8V). The thresholds vary with the device the Logic Analyzer is connected to (i.e. a 3.3V device like the Teensy 3.1 has different thresholds than an Arduino Uno R3 with 5V) but you get the point. If you don’t know what I am talking about right now: You can stop reading and spare your money: Get a nice Arduino Startup Kit (Fritzing Creator Kit is great).

In comparison to that an oscilloscope measures the voltage of a signal over time. This is a big difference which explains the difference in costs. A Logic Analyzer can be quite cheap as it does not need to care if the circuit measures 1.8 or 2.1V as all of these values are considered as HIGH. But, if you want to know the exact voltage because you want to measure raise and fall times than it makes a lot of difference.

Logic Analyzers are often connected to your PC/Mac and deliver the measurements via USB to a software that you can control with mouse and keyboard. If you don’t buy crap – and you never should – then you get really fast, usable software with a lot of options. Often, it’s much faster to navigate these signals with keyboard and mouse than with the knobs of an oscilloscope.

As your PC/Mac machine is so capable it can handle millions and millions of measurements and can display them in real time. Your oscilloscope won’t have that much RAM and horse power to do that.

As you can see in the screenshow below you can have a very clear picture of what signals do over time, you can measure how long they take and various other things.

logic_analyzer_measure

Typical workflow

An oscilloscope is a real time device. It’s there to point the probe to a circuit and immediately see what the circuit is doing. You can “freeze” time and analyze the signal in detail in modern scopes. And the more you pay for it the more time can be frozen (typically). But it’s sometimes hard to navigate around.

A logic analyzer is a device that captures data for a longer time, transfers the data to a PC/Mac where you can analyze the data in a software. If you want to see if something is happening in your circuit right now you will need to start capture, wait some time, end capture, wait for data to be transferred to your PC/Mac and then check the software to see the signals.

This workflow reveals why both devices are very different although they mostly do the same: measure voltage over time.

A Logic Analyzer is meant to give you a better picture of what your digital circuit is doing over a longer period of time, while the oscilloscope helps you to get that fine little details right. Consider a high speed connection between your MCU and a camera module. These signals are very fast, you need to get sync right, etc. You can use your oscilloscope to see if you meat that 3 pico seconds raise time. A Logic Analyzer will not be of great help, if it’s fast enough it will allow you to see the RGB values from every pixel sent over the last 3 minutes, but that might not be of good use.

Now consider another case: You connect two Arduino devices which should communicate over serial (UART). It’s working fine, but sometimes it isn’t. What you want to know is if data is corrupted when it’s sent for example. Using an oscilloscope would not be of great help, as you often will not be able to capture a longer period of time and even if you could, it’s hard to navigate the data with a knob.

Attach a Logic Analyzer and capture as long as you need. Then, afterwards you can have a look at the data, the software will decode the data using typical protocols. This allows you to see the data in a human readable form, which greatly simplifies debugging.

There is no black and white

Of course, there are things in between. Better Logic Analyzers can also read analog signals (i.e. the exact voltage) like oscilloscopes do, and better oscilloscopes have Logic Analyzers built in (like the MSO 1054Z from Rigol). But none of these additional capabilities are comparable with each other.

Do I need a Logic Analyzer?

If you are working on protocols, drivers, more complex code or anything a bit more complex than uploading a sketch to an Arduino than a Logic Analyzer can be a very handy tool. Quite a lot of issues can hardly be fixed by just guessing. This is time consuming and does not really make fun. But, you are into electronics because you want to have some fun, do you? Then get a Logic Analyzer.

What to buy?

I only got one Logic Analyzer and I am very happy with it: Saleae Logic 8. The software is working great (now) and is fast and available for all major operating systems. They have a very cheap one, too: The Logic 4. However, if you can afford the Logic 8 I would rather go with that. Whenever I plug my Logic 8 to my circuits I very often end up using more than 4 wires that would be available on the Logic 4. Of course Logic 4 have enough ports for protocols like I2C and SPI, but if you want to observe another signal in parallel to SPI (which has 4 wires) you can’t.

Leave a Reply

Your email address will not be published. Required fields are marked *