Saleae Logic Analyser Clone with Ubuntu Linux

The Saleae Logic is an 8 channel 24MHz logic analyser.  Soon after its launch people in China opened them up to find that they are pretty simple inside and, as sure as night follows day, little workshops in Shenzen started producing clones impossibly cheaply and to be sold through eBay, AliExpress, etc. 

The Real Deal from USA has a lovely CNC-machined case and retails for US$149 plus shipping.  The Shenzen version costs about US$8 including shipping. It doesn’t come with a nice cardboard box, a carry-case, an aluminium alloy, CNC-machined enclosure (it’s moulded plastic) and you have to get your own clips to connect to the end of the ribbon cable (figure on another US$5 investment for those). In use the Shenzen version gets a little warm, so you can see some merit of a metal case although CNC-machining from solid billet and then anodising does seem rather over the top. And it’s US$8 including shipping. Eight dollars!

Software support in Linux (sorry, Windows users, this article is not for you) is through packages such as sigrok or even, in theory, the software from Saleae themselves although some have tried that and it’s not working well for them with their clones. Saleae have posted their view (overview: they’re not happy about using their software with clone hardware) of the clones on their website.

Sigrok and PulseView With Ubuntu

Sigrok is a pretty awesome suite of software and supports a wide range of interfaces / instrumentation between your circuit under test and your PC – from little USB logic analysers like the Saleae (and clones) through to digital multimeters and even DSOs.  Apparently support for my Owon SDS7102V oscilloscope is underway – looking forward to that!

Whilst you can install sigrok 0.1 easily under Ubuntu 12.04 with apt-get, the version of sigrok-cli that gets installed from the Ubuntu repository is 0.1. This is not cool – the version of sigrok-cli at the time of writing is 0.5.0 and is also compatible with the associated, new GUI: PulseView. So, you really want to install the complete sigrok toolset from source. I’m not going into exact details – the broad idea is written up on the sigrok site. Here are some notes specific to Ubuntu (12.04) that might help. You may want to install at least the following with apt-get install:

automake
libudev-dev
checkinstall
libglib2.0-dev
libbzip-dev
libftdi-dev
sdcc
python3-dev
qt-sdk
libboost-system-dev
libboost-thread-dev
libboost-filesystem-dev

Note that some of these are quite humungous (like the Qt SDK) – make sure that you have a few GB free before embarking on these package installations.

When building sigrok, you’ll see that in reality it comprises several subprojects that you’ll want to build and sudo checkinstall in order:

libsigrok
libsigrokdecode
sigrok-cli
PulseView

I installed the latest versions using git:

git clone git://sigrok.org/libsigrok
git clone git://sigrok.org/libsigrokdecode
git clone git://sigrok.org/sigrok-cli
git clone git://sigrok.org/pulseview

I also had to download, build and checkinstall the latest libusb-1.0 since it’s required by libsigrok to talk to just about all USB-connected signal sources.

Plug in your Logic clone and do a:

sigrok-cli --scan

Hopefully you will see your Logic clone listed (as fx2lafw):

The following devices were found:
demo - Demo device with 12 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3
fx2lafw:conn=3.67 - Saleae Logic with 8 channels: 0 1 2 3 4 5 6 7

All being well, you should now be have the pulseview binary in your path, so plug in your logic analyser, and connect to your circuit, then start pulseview from the command line. Quick start for pulseview:

  • Select Saleae Logic from the listbox on the toolbar.
  • Click on the red clip toolbar icon to mute unconnected channels
  • Select a decent amount of samples, I chose 1M (million) samples for my SPI example
  • Select a reasonable / appropriate sample rate from the toolbar listbox (I used 1MHz)
  • Click on the channel labels down the left hand side to give them appropriate names if you want to do protocol decoding
  • (Optional) Select Decoders from the menu and choose a protocol decoder that works for your circuit under test (I chose SPI) and you may need to click on the protocol decoder trace to logically connect signal connections to protocol lines.

I connected up one of the standard Nokia 5110 Arduino projects and hooked up a couple of channels as per the above to decode SPI. It took me longer to document this than do it!

pulseviewScreenshot

Conclusion

Whilst getting the software installed for Ubuntu was no walk in the park compared to the usual Ubuntu Software Centre point-and-click affair, the whole package works really well and, for the price, it’s unbeatable. Hats-off to Joel Holdsworth, in particular, for a very fine job on PulseView.

saleaeLogicCloneWithNokia5110