Using Raspberry Pi Pico as a logic analyzer

MCU boards, including the $1.5 BluePill board, have been used as cheap logic analyzers for years, notably with Sigrok open-source software. So it should come as no surprise the $4 Raspberry Pi Pico board can also be used as a logic analyzer, with one developer claiming it can deliver 100 Msps, or the performance obtained with a 1.6 GHz CPU, thanks to the PIOs from the Raspberry Pi RP2040.

Hackaday reported about a Sigrok driver for the Pico last March, but the topic was brought to our attention via a post on about an open-source Windows program developed from scratch to transform the Raspberry Pi Pico board into a logic analyzer capable of 100 Msps.

Raspberry Pi Pico Logic Analyzer

Agustín Gimenez Bernad (aka gusmanb)’s LogicAnalyzer program offers up to 24 digital channels, pre, and post-trigger sampling, edge trigger and pattern trigger up to 16 bits. It can work with the Raspberry Pi Pico hardware alone, where you’d just need to short GPIO0 and GPIO1, upload the UF2 firmware and that’s it. But you would be limiting yourself to 3.3V IOs, so Agustín also designed a fast level shifter board based on TXU0104 for 5V I/Os in KiCAD.

Raspberry Pi Pico Level Shifter board

The program is built with a .Net for Windows only, but if enough people are interested, a .Net MAUI version that runs in Windows, macOS, and Linux will be developed. The LogicAnalyzer program allows you to visualize the captured data, highlight sampling ranges, name channels, export the captured data while preserving the capture settings and ranges, and implements protocol analyzers as well as an easy-to-use system to include your own ones.

Currently, only the SPI protocol analyzer, but I2C, RS-232, and system bus analyzers (16 address bits and 8 data bits) are being worked on, but developers with knowledge of C# can add their own protocol. You’ll find everything you need to get started on Github including the software, firmware, and hardware design files for the LevelShifter board.

LogicAnalyzer configure capture

Agustín also explains why he did not go the Sigrok route:

I have been reading some comments about why create my own application and why not use Sigrok as it would have been developed faster. First of all, the full project including firmware, PCB’s and Windows client took me less than a week of development, I have been creating Windows apps for more than 20 years and it takes me less time to implement a rendering system, plugins and so on than implementing a third-party driver…

He also explains he had stability issues with cheap logic analyzers in Sigrok/PulseView. But in any case, it’s still possible to use Raspberry Pi Pico with Sigrok, which works on more operating systems, thanks to the “sigrok-pico” driver mentioned in the introduction. Work is also in progress to have it merged into the main Sigrok/PulseView project, but things are slow especially since Uwe Hermann, the creator and main maintainer of the project, has not been active for a while, although another person has taken over.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

5 Replies to “Using Raspberry Pi Pico as a logic analyzer”

  1. Is it any better than the saleae clones in real world usage?
    The problem I had with all of the USB LAs I’ve tried so far is that they don’t have enough memory to be useful in a lot of cases.

    I picked up a massive Tek windows based LA on the cheap because it got so annoying trying to debug stuff with the small amount of data that USB LAs could capture.

    1. Those cheap Saleae clones are just EZ-USB FX2 MCU with additional level shifter added. EZ-USB is capable of pumping data at full USB high-speed rates, though the sigrok firmware I’ve seen is limited to 24MHz.

      If 24MHz is all you need, those cheap clones have virtually unlimited memory.

      1. There are also slightly more expensive clones of the old Salea16 which allow to sample up to 100 MS/s, though with a reduced channel count (limited by the USB 2.0 bandwidth – about 300 MBit/s is the maximum reliable throughput).

  2. I used this to debug my I2S implementation in my current project. I got it set up quickly with a pico I had on hand and it worked well.

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC