I recently came across the combination of Sigrok Pulseview and cheap USB logic analyzer hardware to make a very capable analyzer for the hobbyist. There is a broad range of cheap USB hardware available within the $10 ~ $30 price range and the sweet spot seems to be 8-channel, 24MHz USB logic analyzer.
With parts ordered and patiently waiting a few weeks for delivery I finally got my hands on a LHT00SU1 logic analyzer. The first issue was getting it running with Sigrok Pulseview on Windows 10. Avoid using the software and drivers provided with the analyzer and instead download Sigrok Pulseview and install the Zadig WinUSB driver.
With the analyzer connected to a PC USB port, open Pulseview and connect to the device using the "fx2lafw (generic driver for FX2 based LAs)" firmware. The analyzer should appear as a "CWAV USBee AX" device.
To test the analyzer I set up a simple test circuit with an ESP32 and a DHT12 temperature/humidity sensor connected over the I2C bus. I used a simple I2C bus scanner script to generate some activity on the bus and ran the analyzer to capture the trace.
One of the powerful features of Signok Pulseview are protocol decoders which can be added to decode the captured signal. The I2C decoder simplifies analysis of the logic traces by displaying the value of the bus bits and decoding the I2C protocol. The decoder clearly shows the I2C scanner script scanning through sequential device addresses. The I2C master generates a start condition (S) followed by the slave address and a write bit. If no device is available at an address 'NACK' occurs. When a device is present (address 0x5C in my setup) the slave replies with 'ACK'. Each device address check ends with the master generating a stop condition (P). For more complex protocols, multiple decodes can be stacked to construct a decoding pipeline.
A few useful references:
- An excellent overview of Sigrok and logic analyzers given by the author of Pulseview, Joel Holdworth, is available on Youtube.
- There is a broad range of hardware support so it is worth checking your device is compatible before buying.
- The protocol decoders are written in Python and the modules are in the libsigrokdecode installation directory. You can view, edit existing decoders, write your own and contribute back to the community.
- Sigrok has a command line interface called sigrok-cli. Useful for scripting tests or running on a headless machine.
No comments:
Post a Comment