Tools of the Trade
I am one of those people who really like to design, build, and yes, debug custom control systems. This wasn’t always the case though. I found the design and building stages to be relatively easy while the debugging stage could really try my increasingly limited patience. When I first got into electronics I couldn’t afford any decent test equipment and was limited to a simple voltmeter. Later I was able to upgrade to a multimeter that could test resistance and current as well. But the really interesting things can only be seen with the proper test equipment and I have the philosophy of, “Tools over Toys”. It doesn’t do much good to have really cool electronic toys if you don’t have the necessary test equipment to realize your projects. So over the years I have built up a decent set of tools to ply my trade.
To that end, I had been looking for a decent logic analyzer for some time when I started seeing ads in the electronics magazines for the Saleae (pronounced say-lee-“A”) Logic Analyzer. The price was attractive and I ordered one for my desk at work to use at Parallax several months ago. I was very impressed with the unit and was thinking about how many people I had helped on the Parallax Support and Savage///Circuits Forums who would have had a much easier time solving their issues if they could just see what was really going on. Being the host of Savage///Circuits TV and running my own project website, I decided to do a review on the Saleae Logic Analyzer and start using it in upcoming diagnostics episodes of Savage///Circuits TV and Short Circuits. Joe from Saleae was kind enough to send me an extra unit just for these purposes. Below is my official review of this product. Episodes of Savage///Circuits TV to make use of this product are forthcoming.
What is Logic?
Logic is an 8-channel logic signal analyzer that connects to the USB port of your computer and allows you to see the states of up to eight channels over time. This is very useful for debugging communication between a microcontroller and peripheral device as often it is not clear if issues are code or hardware related. A logic analyzer can allow you to see the logic states of multiple signals at once to help determine where the problem may be. Saleae Logic takes that a step further by providing you with several protocol decoders that automatically decode the data being monitored. This makes it extremely easy to verify that the correct data is present on the communication bus being monitored. As of this review, the software can decode Asynchronous Serial, SPI, 1-Wire, I2C and UNI/O® Bus and the data can be exported to an output file for further analysis. The company is always working on improving the capabilities and features of this product.
The first thing that caught my attention was the case that the unit came in. Similar to an external hard drive case, this semi-hard case (shown in Figure 1) is a nice addition to the product. It very nicely fits all contents, keeps them protected and is portable. Inside the case are the real goodies. When I opened the case I could see that everything inside was neatly packaged individually inside plastic re-sealable bags. The package comes with everything seen in Figure 2 below and the software can be downloaded from the Saleae website.
I was initially surprised at how small the actual logic analyzer module is (See Figure 3). It kind of resembles a square hockey puck. However, picking it up reveals it is solid and enclosed in an anodized, custom machined aluminum enclosure. I appreciated how little space the unit takes up on my increasingly cluttered bench. The leads for the probes feel really nice. They’re very flexible and the assembly plugs nicely into the analyzer via the SIP connector. Each probe attaches to one of the leads and I was glad they weren’t already attached as I often only need a couple of channels and don’t need extra probes hanging in the way.
Before connecting the hardware to my PC I headed over to the Saleae website to obtain the software. At first I was a little nervous because I am running Windows 7 64-bit and very little software seems to natively support 64-bit Windows 7. I was amazed to see that there was not only 32-bit and 64-bit versions of the software (64-bit for Vista & 7 only) but that there were also OSX and Ubuntu versions of the software as well. Saleae even provides an SDK so that you can import the data into your own applications using the Logic hardware. The version of the software used in this review was V1.0.33.
The software was very streamlined and makes it easy to see a lot of information about the currently displayed signals. The software is a free download from the Saleae website and you can simulate data, including using the decoders without the hardware connected. In Figure 4 below I have run a quick simulation to give you an idea how much information is available at a glance. For starters, all channels are conveniently labeled for the signal type and shown with the label in the color of the test lead connected to it. You can also rename signals manually, and as a bonus if you select an analyzer, once you define which pins it uses it will ask you if you’d like the pins renamed to those signals. This is a very convenient function.
In Figure 4 you can also see that the 8 bits of the serial lines are shown with little diamonds in them. This makes it easy to separate the start/stop bits from the data bits. Above each piece of data is the value of that data. The clock signal shows the rising edge of the clock and the little box in the lower right shows several pieces of information about the channel you are holding the cursor over, which in this case is the clock line. This clock signal is running at 20kHz (50µS period) with a 50% duty cycle (25µS per state). You can also see that I placed markers at 2.28725mS and 2.5975mS to measure the width of the pulse on Input 8, which is 0.31025mS. You can even customize some of the data that appears in this window or minimize it to get it out of your way.
Real World Test
Okay, so we can see what a simulation does, now let’s have a look at a real example of using the logic analyzer to monitor and decode signals from the 24LC256 EEPROM on the Propeller Professional Development Board (PPDB). The 24LC256 has two signals to watch; SCL and SDA. Figure 5 below shows the logic analyzer connected to the PPDB EEPROM. What we’re going to watch is the activity on the EEPROM during a Propeller reset.
At startup the Propeller chip will load the contents of the connected 32K EEPROM into RAM. So we can expect to see 32K worth of reads from the EEPROM following preamble.
Figure 6 shows a screen capture of Logic while looking at the start of the read sequence from the Propeller chip. Looking at the file, “Capture_01.txt” inside the attachment, “CaptureData.zip” (also Figure 7) we can see the activity on the I2C bus as it is output to the text file.
If there were any communication issues with the EEPROM we could easily identify them from the captured data. There were no errors or issues in this capture, but I have seen situations where the host was communicating with an EEPROM faster than the rate for that EEPROM, as well as errors during write sequences, also usually related to speed, but again, these issues are almost impossible to find without a logic analyzer.
Since purchasing the Saleae Logic analyzer at Parallax, I have used it to debug many projects and it has saved me countless hours of frustration and hair pulling. I have used it on both BASIC Stamp and Propeller related projects to verify that, yes, the device is sending a reply serially even though my code says there was a serial timeout. I have used it to see that I was sending bits in the wrong order or that a Propeller object I downloaded wasn’t doing what I expected. I use the Logic analyzer more than I use my scope these days since it is usually the correct tool for debugging digital communication signals.
The Saleae module is small and compact, yet rugged. The leads are not too short or too long. The probes were a new thing for me as all my previous test equipment used a different type of test clip. Figure 8 below is the style I am used to while Figure 9 is the style that comes with this unit. The advantages of the Figure 8 style is they hook nicely onto through hole parts while the Figure 9 clips don’t really open wide enough to get onto a DIP IC pin from the side, however if you come in at an angle it will attach. The Figure 9 probes do have an advantage over the Figure 8 probes which became evident when I needed to connect to three consecutive pins on an SIOC chip. The Figure 9 probes are small enough to grab on and not short each other out on many SMD devices.
Figure 10 shows the card that is included in the package. I was glad to see this because until I took a second look my assumption was that the black lead was ground. In fact, the gray lead is ground. In all fairness that lead also has a label on it (Figure 11), though I will admit to being hasty and not noticing this until I saw the card.
One thing I think would be a benefit to the software in my opinion is the ability to open the data in a window within the software to view it as it was exported. For example, in my test above I exported data to a text files so I could see the textual information more clearly. It would be nice if that data could be viewed within the software without having to save to a text file first.
Probably the last thing I will comment on is that there is a setting in the software called, “Glass Style” which allows you to set the frame transparency. This takes advantage of the Windows 7 Aero effects and can look really cool if you have a dark background. When I first installed the software I had a white background and thought there was some information missing as some of the text on the frame is white and can’t be seen against a white background (See Figure 12). This is easily fixed by un-checking “Use Glass Style” in the Preferences under options. Alternatively you can opt for a darker wallpaper, though I like the brushed aluminum look when not using the glass style.
All in all, I think the Saleae Logic analyzer is a great diagnostics tool and I would recommend it to both beginners and seasoned engineers. It’s inexpensive, portable, reliable and Saleae continues to make improvements to the software. It also carries a 2-year warranty, which is great for a diagnostics tool. In future episodes of Savage///Circuits TV we will be covering some examples of debugging and troubleshooting using a logic analyzer and the Saleae unit will be featured in these episodes. If you have any questions or comments please reply below and I will try to pass on any important information to Joe at Saleae.
UPDATE: Since the original review I have been using the Saleae Logic Analyzer more at work and home and using the newer cross-platform software and I must say, I am very happy with the direction they have gone with the software, the features added and the additional protocol analyzers. The guys from Saleae even made it to the 2011 UPEW at Parallax to show off their 16-channel Logic Analyzer which I will be reviewing very soon!