Day: July 19, 2015

Sigrok and a “cheap” Saleae clone can save your life (I meant your time)

An affordable, inexpensive and “cheap” Saleae clone could save your day (really).

You could find it for less than U$ 10:
http://www.electrodragon.com/product/saleae-usb-logic-analyzer-24m-8-channel/

I was implementing a NuttX driver for BMP180 over I2C, but was failing to get it working and it was difficult to discover what was going on.

I decided to test my cheap Saleae clone for the first time. The Sigrok tool installation from source code is explained here:

http://marcusjenkins.com/linux/saleae-logic-analyser-clone-with-ubuntu/

Then compared my driver command:

bad_i2c_command

against Adrafruit BMP085/BMP180 commands:

good_i2c

Imediately I noticed I forgot to write the register address that I need to read before issuing the read command.

Just an I2C_WRITE before a I2C_READ fixed the issue!

Related: How to use sigrok to measure real-time signal latency http://blog.savoirfairelinux.com/en/2014/logic-analyzer-visualize-latency-with-sigrok-and-matplotlib/

Update: You need to copy the firmware to Sigrok work:

cp fx2lafw-saleae-logic.fw /usr/local/share/sigrok-firmware/fx2lafw-saleae-logic.fw

I got the firmware from sigrok-firmware-fx2lafw-bin-0.1.3.tar.gz