By T.K. Hareendran, contributing writer
The sigrok project is creating a portable, cross-platform, free and open-source signal analysis software suite that supports a wide variety of signal acquisition hardware, including logic analyzers, multimeters, oscilloscopes, and the like. While the suite contains several front-end subprojects, including sigrokcli (a command-line interface to manipulate sigrok), and sigrokqt (a Qt-based GUI to manipulate sigrok), in this article, I am concentrating on sigrok’s PulseView, an oscilloscope, logic analyzer, and mixed-signal (MSO) GUI front end.
Overview, features
The sigrok analysis suite works under a variety of operating system platforms and accepts data from many types of measurement devices. The supported hardware list is pretty extensive (170+), and it’s continually being added to.
In addition to providing graphical data display and measurement capability, the suite offers a variety of protocol decoders for making sense of digital data streams. These decoders are extendable, written in Python, and can be stacked to help decode pipelines.
The sigrock software consists of the following components:
- Libsigrok : a shared library written in C, which contains the general infrastructure for handling logic analyzer data in a streaming fashion. It also contains the individual hardware drivers, which add support for various logic analyzers.
- Libsigrokdecode : a shared library written in C, which contains the protocol decoder infrastructure and the protocol decoders themselves, which are written in Python.
- Sigrokcli : a command-line front end, which uses both libsigrok and libsigrokdecode . It can acquire samples from logic analyzers and output them in various formats into files or to stdout and/or run protocol decoders on the acquired data.
- Sigrokqt : a Qt-based GUI for sigrok, using both libsigrok and libsigrokdecode . This is intended to be a cross-platform GUI (it runs fine and looks native on Linux, Windows, and Mac OS X) supporting data acquisition and protocol decoding.
There is also the PulseView front end, available as a downloadable binary or executable file for a range of environments, including Windows, Linux, Mac OS X, and Android, and the project provides nightly Windows installers for PulseView. PulseView also has quite a good list of supported protocol decoders, and the libsigrokdecode library ships with a collection of popular protocol decoders out of the box. If that is not enough, you can write your own protocol decoders, taking advantage of the code’s open nature.
PulseView under Windows
One of the first things to notice is that the sigrok suite needs some kind of hardware to interface to the signals you want to examine. In order to use libsigrok (via a sigrok front end) on Windows, then, you need to install the proper driver for the desired device. If the device is connected through a (virtual) COM port, libsigrok doesn’t need a special driver; only the driver provided by the manufacturer is required.
USB is a different story, however. The device-specific USB driver shipped with vendor software is, in almost all cases, not going to work. Hence, you will need to install the WinUSB driver using the “Zadig” executable from the libwdi project. Fortunately, the PulseView installers ship with Zadig executable files for total convenience, and they’re accessible via the Windows “Start” menu.
In addition, the Windows installers also come with all the firmware files as well as example dump files from the sigrokdumps repository. The dump files (located in the “examples” subdirectory of the PulseView install directory) are representative data files that can be used to handily test various front-end features, protocol decoders, and the like.
Hands-on testing
I did my maiden test of PulseView using an in-built device that generates a semi-random demo signal that one can look at without needing any hardware.
Next, I opened an example file for a premade capture of DS1307 signaling (actually a conversation between a microcontroller and a DS1307) and used it to test sigrok’s support for signal decoding. After a few seconds of searching with zoom, I had the result shown below. Note that sigrok not only displayed the decoded I²C messages, it deciphered the I²C commands with the support of a stacked “second-level protocol decoder.” This is a huge improvement over watching and counting out pulses on an oscilloscope screen!
In order to work with real-world signals using the sigrok suite, though, it’s crucial that one has external hardware that can capture signals. At the moment, I have only one piece of “compatible” hardware — a 24-MHz, 8-channel Saelae logic analyzer clone based on the Cypress FX2 microcontroller. This Saleae logic analyzer clone can record up to eight channels at 24 MHz ranging from 0 to 5 V. Yet even though it is a clone, Sigrok detected the device automatically when I simply plugged it in and used the pre-installed drivers I had in my laptop.
For my real-world test, I connected the Saleae clone to a temperature logger project I created that’s based on a DS18B20 one-wire digital temperature sensor from Maxim Integrated. The one-wire protocol sends data LSB first, using time slots initiated when the bus master pulls the line low. The master must release the line within 15 microseconds for the line to go high or remain low as needed to represent the data bit. Near the end of the time slot, the line returns high to allow for the bus master to initiate a new time slot.
The captured signal shown in the figure below depicts a communication between the sensor and microcontroller. The bus master issues a “Match ROM” command (55h) followed by the device’s unique 64-bit ROM Code address. As can be seen, trying to decipher the one-wire data stream from just the signal trace is tedious at best. But sigrok and PulseView readily unwrapped the operation, providing a more readable result. I confirmed the result with the help of the “PuTTY” terminal emulator.
Next, I tried to do something with the Xprotolab Plain breadboard oscilloscope that I wrote about earlier. Unfortunately, it’s not among the compatible hardware types supported. I could have written my own driver, but at the time I didn’t want to mess with it. Maybe some later time.
End Note
Sigrok is a pretty awesome software suite that supports a broad range of instruments and their interfaces between our circuits under test and our computer. Together with the PulseView front end, it works with devices ranging from cheap USB logic analyzer clones to professional digital multimeters and oscilloscopes. My salute to the open-source community and to Joel Holdsworth, especially, for the great job on PulseView.
Want more? Here are some of TK’s other hands-on reviews:
Hands-on review: Plug-and-play your way to the IoT with Wio Link
Hands-on review: Sparky single-board computer for media, VoIP, and standalone computing
Hands-on review: Jailbreaking a timer to create an MCU development platform
Learn more about Electronic Products Magazine