Debugging

What to Do When You're Stuck

Projects don't always go well. We encounter many road bumps and errors along the way. There are always one or two major problems that suddenly appear and threaten to sink the ship. These problems can seem to drag on forever. We check our work, try every possible thing we can think of, and then resort to trying random things after that. No matter what, the problem won't yield. But you know a solution is out there, it always is, so you keep searching, even while a sense of dread builds up inside.

When we are in this kind of situation, it can feel hopeless. We can't provide a schedule to a client’s or manager’s looming or already past deadline. We feel the weight of the project resting upon our shoulders. Benevolent people want to ask how it's going and offer encouragement, which only emphasizes the importance of our work and the impact the delay is having.

I know this first-hand. At the time of writing this article, I have been stuck on the same problem for over a week, with probably 60 hours spent actively investigating it. We must resolve the problem somehow, or else the project will be a complete failure for us and for our clients. We also don't have unlimited time to solve the problem. Eventually, the clock will run out and the project will be terminated.

I started thinking about how I generally overcome this type of problem, and I noted these strategies:

  1. Detachment
  2. Take Care of Yourself
  3. Review Your Debugging Process
  4. Inject Novel Ideas
  5. Throw it Out and Start Over

Detachment

Before attempting anything else, we need to detach ourselves from the problem. Step away. We can grant ourselves a break and a reset. We want to get to a place where we can take a new perspective on our problem. This step is critical, and the longer you've been wrestling with the problem the harder it will be

It doesn't matter how you acquire a measure of attachment. There are many approaches, and you must find something that works for you:

  • Go for a walk
  • Exercise
  • Listen to music
  • Take a nap
  • Call someone you enjoy talking to
  • Cook something special
  • Slowly make a pot of tea
  • Play a game

This step seems small, but it is crucial. . I quoted the stoic philosopher Seneca in our article, How I Schedule My Day as a Consultant, and it is worth repeating here:

The mind must be given relaxation - it will rise improved and sharper after a good break. Just as rich fields must not be forced - for they will quickly lose their fertility if never given a break - so constant work on the anvil will fracture the force of the mind. But it regains its powers if it is set free and relaxed for a while. Constant work gives rise to a certain kind of dullness and feebleness in the rational soul.

We need to give our brain a rest. We've become emotionally invested in the problem, and our emotions (especially frustration) are clouding our thinking. We want to let go of our feelings about the problem. We need to let go of what we've already tried to do. Those attempts didn't work. We can't keep attacking the problem from the same point if we want to move past it. We're stuck.

Our goal in achieving detachment from the problem is to re-enable clear thinking and to make our minds receptive to new ideas.

Sometimes all we need for a breakthrough is fresh air and separation from the problem. Even if we don't find a solution during a break, a relaxed and detached perspective is necessary for clearing up our thinking and making progress on the problem. Former US Navy Seal Jocko Willink puts it succinctly:

Take Care of Yourself

With persistent and difficult problems, I've noticed a tendency to fall into a trap: I stop taking care of myself.

We can't forget to rest. Tricky problems lead to long working hours, poor eating habits, over-caffeination, and sitting too long. These actions will cloud our minds, slow our thoughts, and make us less effective.

Take frequent breaks. Don't work too late. Go for a walk every two hours. Don't skip meals. Make sure you are eating healthy food at your preferred mealtimes. Make sure you are staying well hydrated. Don't drink extra coffee. Get plenty of rest at night (extra, ideally, because your brain is working hard).

Taking care of yourself is crucial for maintaining detachment and clear thinking. It’s true that the problem is weighing on you, and that the team is waiting on you, which are both hard to deal with. But if you don't take the time to take care of yourself, you are reducing your effectiveness and prolonging the path to resolution, thus hurting the entire team.

Review Your Debugging Process

With tricky problems, we can easily fall into a trap of random debugging. We become frustrated and start running all sorts of random experiments, often bundling multiple changes into a single test run. Eventually, we end up feeling like we're repeating the same tests, but we're not exactly sure anymore.

When we find ourselves in this situation, we need to step back and revert to a proper debugging process. We should be working methodically, in small steps, testing hypotheses, and noting down the details and results of each experiment. Attempt one thing at a time, observe the outcome, and write both down in a debugging log. The goal is to find the critical variables and to rule out those areas of investigation that have no impact on the problem.

If you don't have a well-established debugging process you can revert to, I recommend reviewing Debugging: 9 Indispensable Rules. Here are the results outlined in that book:

  1. Understand the System
  2. Make it Fail
  3. Quit Thinking and Look
  4. Divide and Conquer
  5. Change One Thing at a Time
  6. Keep an Audit Trail
  7. Check the Plug
  8. Get a Fresh View
  9. If You Didn't Fix it, It Ain't Fixed

Inject Novel Ideas

We're working on a persistent problem, and we've already exhausted all of the ideas we had for solving it. We've probably even tried random things to see if anything would make the problem budge. If you're reading this article in the middle of such a problem, you might even think there are no ideas left for you to try.

This feeling is why it's crucial to detach, make sure we're taking proper care of ourselves, and re-establish a debugging process. Once we've restored our ability to think clearly and methodically, we need to infuse our mind with new ideas.

One place to turn for novel ideas is another human, ideally one who is detached from the situation. Talk through the problem with people who might be familiar with what you are working on, as well as people who are completely outside of your field. In the best case, we might receive extremely helpful advice. Otherwise, simply having to explain the problem will often provide us with new ideas or point out holes in our understanding. People notice when we're glossing over details, providing hand-wavy answers, or not able to answer questions. These are all areas we can explore further in our debugging efforts.

Sometimes another human isn't available. In such situations, the common advice is to explain your problem to a rubber duck (or other inanimate object). The act of translating our thoughts into words will provide many of the benefits talking to another human can provide.

Even after talking to our trusty companions, we may find that we're still out of ideas. In such cases, I like to let my subconscious work for me through a method I call "consulting the oracle". First, I state a clear question or problem statement either in writing or in my mind (not a yes/no question). One the question is asked, I apply a random input and receive an answer. The answer often prompts my subconscious mind into thinking up something related to both the problem and answer. My goal is to take the problem in a new direction: the solution is probably going to be in a place I haven't already looked.

My two favorite oracular works to use are the I Ching and Brian Eno's Oblique Strategies.

The I Ching is an ancient Chinese oracular text. You throw some coins and generate a hexagram, and the book provides an image, a judgment, and commentary on the symbol. The I Ching is often consulted when making decisions or trying to explore one's internal state, but it also can provide effective approaches and triggers for solving problems.

Oblique Strategies is a set of cards created by Brian Eno in the 70s. The cards offer guidelines and constraints to help artists (primarily musicians) work past creative blocks. Since the cards are designed for artists, not all of the strategies apply to a technical situation. Some, however, are powerful triggers that may cause you to reframe the problem completely. Using this deck, we can take two approaches. First is the strict approach: draw a card and follow it exactly. The second approach is to pull cards until we find one that resonates with us - our brains will give us a feeling of "hey, maybe that will work!" when we find a card that resonates. Follow that trail!

If you doubt the efficacy of consulting an oracle, I simply ask you to view this strategy from another perspective. The point is to provide a fresh take on our questions and to let our own minds provide the answers from our subconscious associations. We just need new input for the brain to generate new output. That input doesn't have to be reasonable, be related to the problem, or to mean anything in particular. We are simply trying to jiggle our brains so they can change state and generate a new perspective.

Throw it Out and Start Over

If you remain stuck, sometimes the best decision is to throw out our previous attempt(s) to solve the problem and start over. This can be a painful and counter-intuitive process, especially with a looming schedule deadline. But we know a lot more than we did during the initial implementation. We can implement a second-pass solution more quickly, or at least in a better fashion than the first attempt.

My main concern with a problem that drags on too long is that the problem isn't actually what (or where) we think it is. What if the problem is related to a small detail that is only tangentially related, or a detail that we have ignored completely in our investigations? We can scrap the idea and re-implement the same approach, or we can free ourselves to attempt an alternative approach. Either way we will overcome the problem or confirm that the problem is as real as we think it is.

Still need help?

Sometimes, we keep our head about us and follow all of these guidelines, but we can't get past the obstacle.

If you really can't figure it out, give us a call - we're detached from your problem and can bring in a new perspective. Plus, we love debugging and helping teams move past tricky and persistent problems.

Further Reading

Related Articles

Five Wire, a Portable Debugging Suite for Digital Engineers

Table of Contents:

  1. Introduction
  2. Feature Overview
  3. Unboxing
  4. Installing
  5. Documentation
  6. Five Wire in Action
    1. LiveLogic
    2. Protocol Tool
    3. Waveform Source
    4. Logic Analyzer
    5. Logic Source
  7. Design Motivations
  8. Comparing the Five Wire to My Current Toolset
    1. Price Point
    2. Capabilities
    3. Verdict
  9. My Five Wire Wish List
  10. Closing Thoughts on the Device

Introduction

As an engineer, I take my tools seriously. Our tools act as a force multiplier for our work, enabling us to accomplish increasingly complex tasks with reduced effort. The time we invest in selecting, learning, and maintaining our tools is time well spent.

One tendency that I regularly see, and that I've personally struggled with, is the tendency to become complacent with the current toolset. We become comfortable with our tools, especially after investing time in learning how to use them. We don't even consider other options, even when they promise a dramatic improvement. This effect is magnified by the time it would take to learn the new tool.

I recently encountered Five Wire, a tool that promises to condense most of my suite of embedded debugging tools into a single hardware and software package. I was excited at the feature set and possibilities, but the familiar feelings of new-tool-trepidation came to the surface:

  • Don't my current tools already provide most of these capabilities?
  • Will it really do everything it claims?
  • How much time will it take to reach fluency?
  • Is it worth the price?

I believe that engineers should invest in quality tools: they pay dividends by increasing our productivity and product quality. I decided to follow my own advice and check out the Five Wire. If you're on the fence about purchasing a Five Wire tool, I hope this review gives you a thorough look at the device, warts and all.

5 second summary: I think the Five Wire is an extremely powerful debugging tool that is well worth the price. I've spent an equivalent amount of money for all of my lab and debugging equipment, much of it used, and still can't match the capabilities that the Five Wire provides. It also greatly simplifies my travel debug kit.

 

The FiveWire debugging tool, freshly unboxed.

 

Feature Overview

The main draw of the Five Wire tool is that it combines five distinct hardware tools into a single package. Each tool is controlled through a single computer program. The five tools are:

  1. LiveLogic (a digital oscilloscope)
  2. Logic Analyzer
  3. Protocol Tool
  4. Waveform Source
  5. Logic Source

Each tool is implemented in hardware. The hardware is implemented in such a way as to avoid bandwidth issues. All five tools can be used simultaneously if needed.

All I/O pins on the Five Wire are rated to 0-5 V. This works well for modern embedded applications. If you need to analyze higher voltages, a proper oscilloscope is required.

The Five Wire software is essentially a display front-end for the hardware. Each of the five tools has its own window, and they can all be open at the same time. Each tool window also includes a convenient "copy window" button, which copies a screenshot of the current contents to the clipboard. This is especially convenient for capturing and sharing your results.

The Five Wire uses a "delta" storage format. Only signal transitions are recorded, allowing long time-spans to be captured. Each tool can save captured data into a CSV for post-processing. The data files can be shared with other team members. Captured data can be viewed in the Five Wire program without having a Five Wire device.

Each tool has an associated hardware button on the Five Wire device. These buttons may seem to be unnecessary since we can start and stop each tool in software. During my testing, I used the hardware buttons much more often than I thought I would. It turns out that it's much easier to coordinate pressing a physical button and starting software in tandem than trying to start two software programs.

The Five Wire can decode communication protocols such as RS232, I2C, SPI, and LIN. You can also write your own custom communication protocol decoders with the Five Wire's DCD Script language.

All of the tools have the ability to trigger events and wait for events. This enables complex behaviors, such as triggering the Waveform Source tool with a custom analog waveform whenever a GPIO trigger is received from the target device. These triggers and events can be configured in the application. You can write scripts to control the tool suite using the Five Wire's MBScript language.

The software currently runs only on Windows 10.

Unboxing

I dig deeper into the features below, but I figured that a $1795 tool deserves an unboxing ceremony.

The Five Wire ships in a nice sturdy box. The art is kept on a sleeve which slides off (product designers, take note - you don't need to add a fancy $15 custom foam-cut package to your BOM for attractive packaging).

 

The FiveWire ships in a nice sturdy box. The art is kept on a sleeve which slides off.

 

When you open the box, you are greeted by a one-sheet getting started guide. Underneath the guide is the Five Wire device and an oscilloscope probe.

There is also a box with accessories - many more than I was expecting to find! The Five Wire comes with:

  • Two 10x Oscilloscope Probes
  • Logic Analyzer probe with 10-wire connector
  • Pattern source probe with 10-wire connector
  • I2C Protocol Adapter with 3-wire connector (clock, data, and GND)
  • Power Adapter
  • USB Cable
  • USB drive containing the Five Wire software and user manuals

Greeted by the five wire and a scope probe.

I wasn’t expecting to see all of these accessories!

The Five Wire device itself is a sturdy metal product. The metal enclosure is a welcome touch - I'm growing weary of flimsy plastic products.

The Five Wire comes with a kickstand, which places the device at a much more convenient viewing angle. The left side of the device features a USB connector and power connector. Cables for both are provided in-box.

The FiveWire, free from its former restraints.

The FiveWire comes with a kickstand for easy viewing. Also note the USB and power port on the left side of the device.


Installing

Installing the software was straightforward, especially since the in-box USB drive contained an installer. You can also download the latest software from the Five Wire website.

The software is targeted for Windows 10, and it uses the .NET 3.5 Framework. If you don't have the .NET 3.5 framework installed, Windows will prompt you to download and install it when you first run the Five Wire application.

 

FiveWire uses the familiar Windows installer.

 

Documentation

If you're a long-time reader of this blog, you know how much I value well-documented products. The Five Wire is one such product.

The USB drive that ships with the Five Wire contains helpful reference documentation:

The Five Wire website has a series of Getting Started videos which helped me quickly become familiar with the tool. Currently the videos are focused exclusively on the LiveLogic and Waveform tools.

The Five Wire website also features a series of Application Notes which use the product in a variety of different scenarios. These caught my eye:

Of course, the User Manual is always a last resort, but I was extremely grateful for its detail. There were many questions I had which weren't covered by the introductory material, such as how to configure protocol analyzer triggers or how to use the protocol tool to talk to an I2C slave device. I highly recommend taking the time to read the manual if you find yourself stumped.

Five Wire in Action

Now that we're oriented with the device, let's look at each of five tools in greater detail:

  1. LiveLogic (a digital oscilloscope)
  2. Logic Analyzer
  3. Protocol Tool
  4. Waveform Source
  5. Logic Source

LiveLogic

The LiveLogic tool is meant to operate similarly to a two-channel digital oscilloscope. LiveLogic sports a 400 MHz sampling rate. Two channels is enough - most 'scopes I've used in my career, including the HM1507-3 that I own, only support two channels. Four-channel 'scopes are prohibitively expensive, and many larger companies only keep 1-2 on hand.

The capture button, zoom knob, and scroll knob give a familiar 'scope feel for capturing and navigating around a waveform. Having a hardware capture button is especially useful when coordinating multiple activities, such as starting software and triggering a capture at the same time. It also gives our debugging partner something useful to do. (Who hasn't been a part of a 'scope huddle from time to time?)

The display is continually updated and signals are auto-scaled. Like all auto-scaling 'scopes, the initial scaling probably needs to be tweaked a bit to get to the exact view you need.

Both continuous and single capture modes are supported, with a variety of trigger settings. Where LiveLogic excels over the traditional oscilloscope is the ability to easily specify complex triggering logic. It's a breeze to specify "trigger a capture when the line has been high for 10ms and then goes low for 15us", which would be almost impossible to implement on a traditional 'scope.

Another area where LiveLogic excels over traditional scopes is the potential capture duration. Because LiveLogic uses a delta capture format, where only signal changes are stored, the tool can support a much longer capture duration than a traditional oscilloscope.

A view of the Live Logic window. My trigger is set on a falling edge after logic ‘1’ has persisted for > 100 microseconds (100u).

Other familiar 'scope features are included in LiveLogic, such as reference markers which perform time calculations.

You can right click on the waveform to set marks. You can set a time reference, and additional time marks which calculate the durations relative to the reference mark. Time mark measurements have a 2.5ns resolution.

You can set time marks for waveform measurements, just like on a scope.

LiveLogic supports protocol decoding, so you can hook up an I2C clock and data signal and see the translated output. A variety of decoders are supplied with the tool. You can also write custom decoders using DCD script.

LiveLogic was used to capture and decode I2C traffic. Channel 1 is SCK, and Channel 2 is SDL.

The LiveLogic display features a digital voltmeter (DVM) on each channel, allowing you to get quick voltage readings. This feature is quite helpful since LiveLogic only operates as a digital scope - looking at the graph output doesn't give you any indication of the signal's voltage level.

Screen Shot 2019-04-25 at 12.19.44.png

Protocol Tool

The Protocol Tool is a complex one - accurately described as comprising multiple tools in a single package. The Protocol Tool automatically configures itself depending on the probe that you attach to the Five Wire.

A primary use for the Protocol Tool is emulating an I2C/SPI master or slave device. This is extremely useful for exploring the behaviors of a new slave device, debugging slave devices in-system, or mocking a slave device to validate your embedded system. The Five Wire ships with an I2C Protocol Adapter, but the SPI Protocol Adapter must be purchased from the Five Wire store.

The Protocol Tool also supports the "Trigger Protocol", which provides 3 trigger signal inputs and 3 trigger signal outputs. This protocol is used for automation and coordination purposes. Trigger inputs can be used to generate an event and kick off another tool, and trigger outputs can be set when a trigger event is supplied by another tool. Your imagination is the limit for using triggers. The Trigger Protocol adapter must be purchased from the Five Wire store.

The only downside of this powerful Protocol Tool is that you really must read through the User Manual to understand it. I tried poking around to see if I could figure it out. I quickly gave up. Once I read the manual, I was up and running in no time.

To test out the Protocol Tool, I used the I2C probe and attached it to a proto board populated with a VL53L1X time-of-flight sensor. I programmed a simple transaction which reads the model ID (held in register 0x010F) from the device (the value 0xEA shown in the image is correct).

For most I2C purposes, this tool works well. However, each write transaction can only send a maximum of 8 bytes. This can be limiting for some systems. For example, I have an OLED driver which takes a 384-byte screen buffer payload. But these scenarios are fairly uncommon.

The I2C exchange shown in this image reads the model ID from the ST VL53L1X time-of-flight sensor. The read value (0xEA) is the correct model ID.

Waveform Source

The Waveform Source can program an arbitrary analog voltage waveform with an output range of [0V, 5V]. The tool can handle up to 1020 sequential voltages with 10 bits of amplitude resolution. Waveform durations can span 5 microseconds to 5000 seconds with up to 0.2 microsecond resolution. A preview window is provided so you can see the waveform that will be produced.

The tool provides a variety of built-in waveforms:

  • Sine
  • Square
  • Triangle
  • RC curve
  • Battery discharge curve, with multiple profiles:
    • Alkaline
    • Ni-Cd
    • Li-ion
    • Ni-MH
    • LiPo
  • DC Output

You can also specify an arbitrary waveform profile using a CSV file. With MBScript, you can use looping and conditional branching to generate complex waveforms.

The Waveform Source can also be used as a power supply. The Five Wire can source up to 100mA through the Waveform Source leads. Coupling the power supply capability with configurable waveforms enables hardware designers to evaluate supply-related behaviors, such as simulating brown-outs.

The Waveform Source can be used to configure a battery discharge profile.

Logic Analyzer

The Logic Analyzer sports 9 channels, each with a 100 MHz sampling rate. The Logic Analyzer comes with an associated "Logic Analyzer Probe" that terminates with 9 individual signal wires and 1 ground wire.

The Logic Analyzer supports protocol decoding, and you can enable multiple decoders for a single capture. A variety of decoders are supplied with the tool. You can also write custom decoders using DCD script.

Captured data is displayed in timing diagram format. User-defined labels, protocol data, and time measurements can be superimposed on the signal capture. The display order of the signals can also be modified in the software.

The most powerful feature of the Logic Analyzer is triggering logic. The analyzer supports up to three levels of sequential triggering. You can specify multiple trigger levels at once to create complex triggering logic; each condition must be true in the specified order to trigger a capture. The trigger levels also control the position of the capture (triggering "middle" will capture samples before and after the trigger event, while triggering "start" will only capture samples after the trigger event). Like LiveLogic, the Logic Analyzer also supports time-qualified triggers.

Timeouts can be configured to stop a capture in the event that the triggering condition doesn't occur. You can also manually stop the capture by pressing "Stop" in the application or the Logic Analyzer's "Capture" button on the Five Wire device.

To test the logic analyzer, I connected it to a proto board with a VL53L1X time-of-flight sensor and a SSD1306 OLED display driver. The SCK signal was connected to wire #3, and the SDA signal to wire #4. I then enabled the I2C decoder.

Configuring the I2C decoder is easy: just tell it the position of the SCK and SDA signals.

Configuring the I2C decoder is easy: just tell it the position of the SCK and SDA signals.

I then started a program which reads values from the ToF sensor, updates the OLED screen buffer with a printout of the distance measurement, and writes to the OLED display.

Capturing at a random point in this cycle revealed our I2C data, with decoded values superimposed on the captured waveform.

Our waveform capture with decoded I2C data superimposed.

Zooming in shows the captured output in greater detail.

Here we’ve zoomed in on a specific transfer to see it in greater detail.

A really interesting use case for debugging RTOS thread execution using a custom decoder protocol is presented in this app note: Using the Five Wire Toolset for Real-time Trace of RTOS Execution. This will definitely come in handy in the future.

Logic Source

The Logic Source tool is a pattern generator. Logic Source supports 9 output IO with programmable high/low drive levels.

The tool allows you program up to 1020 vectors with durations in the range of [30ns, 40ms]. Times can be specified in 10 ns increments. Looping and conditional branching support allows for complex logic patterns to be generated. Logic Source output can be single-shot or continuous, and output can also be triggered by an event.

Here I’ve made a 4-bit “counting” pattern which repeats on a loop.

Comparing the Five Wire to My Current Toolset

I think the fairest evaluation of the Fire Wire is in comparison to the suite of tools I have that provides the equivalent functionality. I shared some of them when reviewing my portable embedded travel kit. We'll also compare it to my oscilloscope and benchtop DMM, which do not travel with me.

Here are the items I will be comparing to the Five Wire, with the prices I paid for them:

Price Point

The total price I paid for my equivalent equipment suite is $1570. If you count the original price of the Tektronix DMM, that jumps to $2295. I don't have a signal generator in my lab, which would increase the equipment cost even further.

The Five Wire's price point is right in the ballpark for what I paid for my equivalent toolset. Had I bought all of my equipment brand new, the Five Wire would come in much cheaper. Don't let the Five Wire's price tag scare you away. The value is there.

Capabilities

Now, price isn't the fairest comparison: the Five Wire and my current toolset both provide capabilities not found in the other.

Five Wire provides a Waveform generator, as well as a programmable digital logic output generator (Logic Soure). I don't have any tools in my lab that provide these functionalities.

Oscilloscope Comparison

Now, technically the Five Wire's LiveLogic tool is not an oscilloscope. But since it provides similar capabilities, I will be evaluating it against my HMS1507 oscilloscope.

Five Wire holds several advantages over my HMS1507. Most obvious, my Five Wire's 400MHz frequency beats my HMS1507's 200MHz. My HMS1507's frequency has limited my scoping of high-speed digital signals before, so I am grateful for the higher frequency of the Five Wire. The Five Wire also holds the advantage with protocol analysis and triggering capabilities. Time-based triggering has been especially helpful for honing in on scenarios of interest.

My HMS1507 beats my Five Wire because it can probe analog signals. However, I am primarily a digital engineer working on digital systems, and my analog debugging sessions are extremely rare. When I need the analog capabilities of a 'scope, it's usually to confirm the suspicion of noise on signal causing erroneous digital readings.

DMM Comparison

DMM accuracy varies across measurement devices. To check the Five Wire's accuracy, I used the Waveform Source to generate a 3.3V DC signal. I then took measurements with each DMM. My Tektronix DMM 4020 is the most accurate of the bunch, so we'll use it as the reference.

  • Tektronix DMM 4020: 3.291 V
  • Five Wire DVM: 3.26 V (0.94% error)
  • Mastech MS8268 DMM: 3.286 V (0.15% error)

We can't expect the Five Wire to be as accurate as the Tek DMM 4020, and < 1% error satisfies this engineer. The Five Wire appears to be more accurate when reading a 5V DC waveform, as it reports 4.98 V (0.4% error, assuming the output is 5.0 V exactly). You won't be calibrating power supplies with the Five Wire, but you don't need to carry around a DMM to serve as a voltmeter.

That isn't to say that the Five Wire eliminates my need for a DMM. I frequently use my DMM's continuity mode to check for shorts. Resistance and capacitance readings are also useful.

Logic Analyzer Comparison

The Five Wire and Salae logic analyzers operate very similarly. Both enable you to decode multiple protocols. Each one holds a slight advantage over the other in different areas.

The Five Wire has superior triggering capabilities, which can be quite helpful when attempting to capture a tricky scenario. The time-based triggering has already proved useful to me, and being able to set multiple trigger conditions before executing a capture is immensely helpful.

The Salae wins in terms of maximum duration of capture. The Five Wire capture maxes out at 2048 samples. Since the Five Wire only records signal deltas, this is sufficient for most debugging. However, I tried to capture a 384-byte I2C transfer using the Five Wire, and the logic analyzer capture ends before the transfer completes. The Salae can capture that transaction with no problem. That being said, the Salae logic does have a limited device-side buffer, and we have had our device complain that it was not able to keep up with the sample rate. The Five Wire will not report such a problem during capture.

As a purely personal preference, I find it more natural to use the Five Wire's physical knobs to navigate the captured waveform. Even after 8 years of using a Salae logic analyzer, I haven't gotten use to the app's click/zoom behavior.

Protocol Comparison

From a debugging perspective, the Five Wire and Aardvark I2C/SPI debug adapter provide almost equivalent functionalities. The Aardvark has the advantage over the Five Wire in two aspects:

  1. The ability to send larger payloads (the Five Wire is limited to 8 bytes per write)
  2. The API and library which allows you to interact with the Aardvark adapter from a program

These features aren't crucial for in-field debugging. I could safely leave my Aardvark adapter at home and accomplish everything I need with the Five Wire.

From a test automation perspective, the Five Wire has greater potential, especially because we can use events to script complex behaviors.

From a system bring-up perspective, however, the Aardvark APIs have been invaluable. When I need to write a new driver, I put the slave device onto a proto board and connect the I2C/SPI signals to the Aardvark adapter. I can write and test my slave driver by talking to actual hardware using the APIs. When the driver is complete, I can port it over to the target platform with little-to-no modifications.

Luckily, I have another tool in my kit which can be used for this purpose: the TUMPA debug adapter. While I normally use it as a JTAG device, the TUMPA can also interface to I2C and SPI devices. Technically the Aardvark has won over on the Five Wire due to the APIs, but I can make up for that with another tool.

Portability

Having a portable toolkit has been important to me throughout my career. As an employee, I frequently travelled for field testing and to support manufacturing builds. As a consultant, I regularly travel to my client's offices. On many trips, debugging tools aren't available on-site, so having a toolset I can travel with is crucial.

Five Wire handily beats my current toolset in terms of portability. I currently need to travel with 4 different devices and a USB hub, and those tools don't match the capabilities provided by the Five Wire.

Five Wire augments my current travel kit's capabilities with a digital oscilloscope and waveform generator. My new kit can be reduced to two USB devices: the Five Wire and the TUMPA debug adapter. The Five Wire and its accessories do increase the physical size of my current kit, but that is offset by the additional capabilities. The Five Wire is also slightly heavier than the replaced tools, but the weight is still negligible.

Verdict

The Five Wire is a worthy tool and has a new home in my toolset. It will reduce the number of devices I travel with, while simultaneously increasing my debug capabilities.

The Five Wire provides great value for the price point. I spent the equivalent amount on my current tools and still don't have all of the capabilities that the Five Wire provides. I rarely need the capabilities that are not covered by the Five Wire. I think it's a valuable debugging tool for developers.

My Five Wire Wish List

I think the Five Wire is a powerful device, but I promised to share the warts too. Here is my Five Wire wish list:

  • • I am able to use this tool with my Mac via Parallels, but I really wish the program also ran on OS X and Linux.
  • • The LEDs are too bright, and thus distracting. They should be tuned down. I've taped over them for now.
  • It's not immediately obvious that "update waveform" doesn't change the waveform output if the tool is already is running. If you click "Update" while a waveform is running, the graph updates but the output does not. You have to stop, update, and start. It would be great if the output would automatically update.
  • I really like the grabbers that come with the Salae Logic Analyzer, and I think they would be a great addition to the Five Wire. The wire leads on the connectors are the same type as the Salae so luckily, I can use the ones I have.
  • I wish there was an API like the Aardvark provides, so I could use the Five Wire as a I2C/SPI master from a program.
  • I wish there was a way to execute scripts from the command line, so I could use the Five Wire for hardware-in-the-loop tests with my CI server when I don't need it for debugging.

Closing Thoughts on the Device

There's always trepidation and resistance to learning new tools, but I surprised myself with how much I enjoyed using the Five Wire. I have my wish list of features and modifications, but that is true of every tool that I use. I think that the value provided by the Five Wire significantly offsets my wishlist.

I really enjoy using the Five Wire because of the combined hardware-software interaction. It's extremely satisfying to press buttons and turn knobs. It's also extremely useful when coordinating activities; it can be quite difficult to start two different software programs in tandem. I've barely scratched the surface of its capabilities, especially with automating hardware tests through triggers and events.

I think the Five Wire is a valuable debugging tool that is worth the price.

Further Reading

My Favorite Debugging Tip: Get Up and Take a Walk!

We've all experienced the mounting frustration that arises when we've spent multiple hours trying to solve a problem. You have a sinking suspicion that there's something trivial that you're missing, something which would make everything click and start working correctly again.

In these kinds of debugging situations, it's easy to enter a tail spin. The Wise Ones recognize that in this frustrated mental state we are impaired and not likely to solve the problem. We need to give our brains a chance to reset and to consider the problem in a new light.

In such situations, common advice is to utilize Rubber Duck Debugging. However, our faithful duck companions also have bad days, leaving you no better off than before you explained your problem in detail.

At this point, there is only one tool left in the toolbox: get up and take a walk.

A problem with a piece of writing often clarifies itself if you go for a long walk.

--Helen Dunmore

Taking Walks, a Common Cure

In my post How I Schedule My Day as a Consultant, I emphasize the importance I place on taking a break:

You cannot be effective if you are wrapped up in a frustrating task. Frustration clouds are thinking, and inevitably you waste time on that activity.

If you recognize that you are frustrated, stuck on a tricky problem, or running around in circles, take a break. A five to fifteen minute walk will help re-energize you and reset your physiological state. In many cases, you will return to your work with solutions or new ideas to try.

Sometimes all we need is a little fresh air and separation from our problems.

I first started pondering the importance of taking walks while reading Seneca, the ancient stoic master. Seneca believed we should take frequent walks to refresh ourselves, because constant work will fracture our mind:

"The mind must be given relaxation - it will rise improved and sharper after a good break. Just as rich fields must not be forced - for they will quickly lose their fertility if never given a break - so constant work on the anvil will fracture the force of the mind. But it regains its powers if it is set free and relaxed for a while. Constant work gives rise to a certain kind of dullness and feebleness in the rational soul.

Seneca also righty points out that we are refreshed by the open air and deep breathing afforded to us by walking:

We should take wandering outdoor walks, so that the mind might be nourished and refreshed by the open air and deep breathing.

But it is not just ancient philosophers who spout recommendations to walk. Many writers have been known to love long walks, including William Wordsworth, Charles Dickens, Nassim Taleb, Soren Kierkegaard, Lewis Carroll, Friedrich Nietzsche, Immanuel Kant.

When a traveler asked Wordsworth's servant to show him her master's study, she answered, "Here is his library, but his study is out of doors."

-- Henry David Thoreau, Walking

Henry David Thoreau dedicated an entire essay to his love of Walking. He is not shy about his disdain for non-walkers:

When sometimes I am reminded that the mechanics and shopkeepers stay in their shops not only all the forenoon, but all the afternoon too, sitting with crossed legs, so many of them—as if the legs were made to sit upon, and not to stand or walk upon—I think that they deserve some credit for not having all committed suicide long ago.

You can afford a break. Even better, make walks a part of your morning and evening routine.

Get outside. Enjoy the scenery. Enjoy being away from your work.

You will return from your walks with a stimulated mind. You may think that you're taking a "break", but you really end up smarter and clearer than you were when you left.

Further Reading

Related Posts