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

Support ultra cheap Logic Analyzer USB 2.0 HS with 24MHz 8 Chan based on Cypress FX2/FX2LP chips #270

Open
bvernoux opened this issue Sep 25, 2020 · 7 comments
Labels
driver Hardware drivers
Milestone

Comments

@bvernoux
Copy link
Contributor

bvernoux commented Sep 25, 2020

Support ultra cheap Logic Analyzer USB 2.0 HS with 24MHz SMSP 8 Chan based on Cypress FX2 chips
More details here: https://sigrok.org/wiki/Fx2lafw

Example of what we can find on Internet for less than 10USD

The same but more expensive less than 20 USD

@bvernoux bvernoux changed the title Support ultra cheap Logic Analyzer USB 2.0 HS with 24MHz SMSP 8 Chan based on Cypress FX2/FX2LP chips Support ultra cheap Logic Analyzer USB 2.0 HS with 24MHz 8 Chan based on Cypress FX2/FX2LP chips Sep 25, 2020
@azonenberg azonenberg added the driver Hardware drivers label Sep 25, 2020
@azonenberg
Copy link
Collaborator

We can probably use FX2LA firmware as is. It's GPL but that's a non-issue since none of our code is linking to it, we can just redistribute it as as a separately licensed blob.

My understanding is it just spits out a firehose of 24 Msps sample data over USB.

Proposed architecture: create a custom TCP server under scopehal-apps that listens to the USB stream, runs software based triggering, then pushes waveforms to glscopeclient. Use a 2-socket protocol with SCPI data + raw binary waveforms, maybe somewhat compatible with the proposed MAXWELL and PicoScope socket protocols.

We can add arbitrarily complex protocol triggering in the future.

@azonenberg azonenberg added this to the v0.1 milestone Apr 24, 2021
@thirtythreeforty
Copy link

I am interested in this not because I'm a big fan of the FX2LAs, but because my custom scope will have most of the control logic on PC and send low level control commands to the hardware over USB.

This also provides a nice license boundary if I want to make the control software GPL.

Any opinions on the TCP server architecture, protocols, etc? Could you link the MAXWELL socket protocol you're mentioning?

@electroniceel
Copy link
Contributor

I am interested in this not because I'm a big fan of the FX2LAs, but because my custom scope will have most of the control logic on PC and send low level control commands to the hardware over USB.

Did you see https://github.com/azonenberg/scopehal-pico-bridge ?

That implements something like what you are mentioning, but for Oscilloscopes from Pico Technology instead of FX2 LAs. Maybe you can get some ideas about protocols from there.

@thirtythreeforty
Copy link

I see. Normal SCPI over the control channel. Is the data plane format standardized?

@azonenberg
Copy link
Collaborator

azonenberg commented Jun 18, 2021

The data plane format for the Pico bridge isn't officially documented as it's subject to change at this point.

Informally, it's (as of this writing)

uint16 num_channels
uint64 sampleInterval //femtoseconds
for i = 1 to num_channels
    uint64 channelID
    uint64 numSamples
    if channel is analog
        float32 gain
        float32 offset
        float32 phase //offset in fs from trigger event to sample clock
        uint16 rawADCValues[numSamples]
    if channel is a digital bank
        float32 phase //offset in fs from trigger event to sample clock
        uint16 rawDigitalPortValues[numSamples] //data for up to 8 channels in LSB, MSB unused (pico native data format)

I would recommend using something similar as a guideline, perhaps without wasting half the data in the digital banks, but operate under the assumption that you'll be making your own driver in libscopehal. You can probably copy a lot of code from the Pico driver but it will have to be a separate class.

@thirtythreeforty
Copy link

operate under the assumption that you'll be making your own driver in libscopehal

Got it. Wasn't sure if you wanted to unify this protocol. If not, perfectly fine!

@azonenberg
Copy link
Collaborator

The protocol will probably get unified eventually but it's too early to think about doing so now, since we haven't made enough of them to have a good idea of what the needs of different instruments will be.

But the driver side will be different per instrument at least to some extent due to all of the quirks of particular hardware. A sizeable amount of the code in the Pico driver, for example, is implementations of all the rules to see whether a given sample rate is valid for a particular set of enabled channels.

@azonenberg azonenberg modified the milestones: v0.1, v0.2 Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver Hardware drivers
Projects
None yet
Development

No branches or pull requests

4 participants