Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: add support for low-end logic analyzers like the pi pico rp2040 or the Saleae Logic? #796

Open
cdwijs opened this issue Nov 2, 2024 · 1 comment
Labels
enhancement New feature or request support Helping users with problems

Comments

@cdwijs
Copy link

cdwijs commented Nov 2, 2024

I have a circuit with a microcontroller that's talking to a i2c clockchip. In very rare cases, something goes wrong, and the time in the clockchip is wrong. The microcontroller also talks to the outside world via SPI and several uarts.

I would like to use ngscopeclient to monitor and decode the i2c communication to the clockchip. Then, when i see a jump in the time of the clockchip, I would like to see what the i2c, SPI and uarts pins were doing at that time, so i can figure out howto solve it.

Problem is, I don't have a way to capture the digital signals. I don't have one of the devices that are listed [1] as supported.
I do have a pi pico (rp2040) board that talks to sigrok via a serial-over-USB connection, with sigrok at the other end. [2,3].
I also have a Saleae_Logic that talks to sigrok via a USB connection. [4]

Is it possible to build support for such a solution into ngscopeclient?
How can I help that development?

[1] http://www.ngscopeclient.org/hardware.html
[2] https://hackaday.com/2022/03/02/need-a-logic-analyzer-use-your-pico/
[3] https://github.com/pico-coder/sigrok-pico
[4] https://sigrok.org/wiki/Saleae_Logic

@azonenberg azonenberg added support Helping users with problems enhancement New feature or request labels Nov 2, 2024
@azonenberg
Copy link
Collaborator

There are open requests for fx2lafw (ngscopeclient/scopehal#270) and Saleae (ngscopeclient/scopehal#16) drivers but nobody is actively working on either.

We're still working on building out developer documentation, we have an API reference at https://www.ngscopeclient.org/devdocs/ but haven't had time to write a proper "how-to-make-a-driver" guide.

The tl;dr is you'll need to create a new class derived from SCPIOscilloscope (oscilloscopes and logic analyzers are treated the same internally, both can have analog and/or digital channels - a LA is simply a MSO with no analog channels) using an existing driver as a template. Then register it in DriverStaticInit() in scopehal.cpp so it'll be created when ngscopeclient starts up, and implement all of the necessary Oscilloscope methods for your desired functionality.

Note that ngscopeclient is BSD licensed and thus not compatible with GPL contributions (you can use our code in a patch to sigrok, but not the other way around).

if there is already a Sigrok driver for your target instrument, you may find https://github.com/ngscopeclient/scopehal-sigrok-bridge to be useful as a quick way to get things running. It's a dual licensed GPL/BSD tool that links against libsigrok and exposes instruments via a SCPI API over a TCP socket that ngscopeclient then connects to using the dslabs driver (providing both a license boundary and network transparency, allowing you to run ngscopeclient on a computer other than the one the LA is plugged into should you so desire). It was intended for use with DreamSourceLabs USB scopes/LAs like the DScope and DSLogic, and I think has bitrotted a bit, but it's probably closer to where you want to be than starting from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request support Helping users with problems
Projects
None yet
Development

No branches or pull requests

2 participants