Hla spi

Sounds like an interesting approach, which I have thought of wanting for awhile, who knows maybe at some point will take a look. Wonder how common it is for devices to use this… As I mentioned earlier have seen it on many displays.

New user to Saleae. First use case is exactly what’s being described here. Analyzing SPI communications for TFT LCD and e-paper displays.

In addition to the MISO, MOSI, CS and CLK signals, most displays also use D/C and RST (reset) lines for control. E-paper displays also output a BSY (busy) signal when they are updating the contents of the display (shouldn’t try to access the display when it’s busy).

Being able to separate out commands and data in the trace and data tables would be a very good add, either by extending the existing SPI analyzer or creating a “Displays” extension on top of it that would qualify the data.

Right now I’ve kind of faked it by defining the DC line as the MISO signal so it shows up in the the data table, but it’s be nice to be able to include any other signal as part of the SPI group and send that directly to the table.

Thanks.

@xylopyrographer Since you brought up your workaround of defining the DC line as a MISO signal, I’m now wondering if it may be possible to simply add 2x SPI analyzers while configuring both to take a look at the DC line as the EN line. One SPI analyzers would be configured with an active low EN, and the other configured as an active high EN like in the image below.

Channel 3 is acting as the DC line in this case. This would allow separating out the data and command signals in 2 separate rows above the waveform as well.

I could be missing a pretty critical detail here though, but if this works, it could be way simpler than having to add a DC line to our SPI analyzer by using our protocol analyzer SDK.

2 Likes

Actually I am playing with a hacked up version of your SPI analyzer to add the DC… Have it building and running, but, issue restoring settings and minor issue of crashing the analyzer… :wink:

I have the wip up at: https://github.com/KurtE/spi-analyzer/tree/SPIEx

But will hopefully debug some.

Running into some questions to self like:

How to hold the DC state in a frame:

class LOGICAPI Frame
{
  public:
    Frame();
    Frame( const Frame& frame );
    ~Frame();

    S64 mStartingSampleInclusive;
    S64 mEndingSampleInclusive;
    U64 mData1;
    U64 mData2;
    U8 mType;
    U8 mFlags;

    bool HasFlag( U8 flag );
};

You stores miso and mosi in data1 and data2.

So question to self or others:
a) Can I store it as a bit in mFlags (That is what I am trying now),
b) store as lets say high bit in data1 or 2… and punt on handling 64 bit transfers working with DC… But I never do that anyway so…

Also is there a way to run this under debugger these days? Running on Windows 10.

Working a little better now… May change the results for DC, but…

Again it is up in my SPIEx branch…

I encoded the data in mData2…

Now maybe need to learn enough of the HLA stuff to try…

Hey @KurtE, we haven’t documented nor fully verified the ability to debug custom analyzers on Logic 2. We only have this documented for the older Logic 1.1.18 software, which unfortunately can’t be used with our Gen2 hardware (Logic 4, Logic 8, Logic Pro 8, and Logic Pro 16).
https://support.saleae.com/saleae-api-and-sdk/protocol-analyzer-sdk/debug

However, a community user seems to have found some success with getting debugging working on Logic 2. Their forum post on this topic can be found below:

Thankd @timreyes

Yes I remember debugging the Dynamixel stuff earlier on the old IDE (real old).

As you can see in my previous post, I fixed the fault and save/restore setting…

Now to see if I can hack up partial HLA and talk to it…

Need to look at docs to see what constraints…

Opps, looks like I started from Master branch… Probably need to work from alpha…

Will see how hard to migrate over…

put up new branch: alpha_spiex

This one at least talks to the spi transaction framer. So I know that it talks somee to HLA

Ah! Clever. :+1: Let me play around with that and see how it goes. Thanks.

I started playing around with maybe an ILI9341 example HLA using my SPIEx code…

It is coming along sort of, but python is not a language I have done anything in, other than try to get rid of Ros Python code a few years ago :wink:

So I am stumbling along:


But making some progress… If the DC is 0 I try to look it up in a table… The table also has an indication of why data might follow, more simple in 1 or 2 byte chunks from MOSI or MISO…

As you can see in picture it is showing that the command is the CASET, which the table shows 2 bytes for entries.

And it then shows the range for columns is 0 319…
But I am not sure if I should be displaying 319…

I have hacked in there:

            elif self.last_from == 2:  # mosi 2 bytes
                if self.data_packet_count == 0:
                    self.frame_start_time = frame.start_time
                    self.data_packet_count = 1
                    self.data_packet_value = mosi[0]
                else:
                    self.data_packet_count = 0
                    self.data_packet_value =  (self.data_packet_value * 256) + mosi[0]
                    frame_data["command"] = self.data_packet_value
                    frame_type = "result_packet"

But if I click on the 3 dot it shows that I should be outputting HEX… so question is do I
need to encode the values: to a hex string, and where do I in the Python code get what the
user wants the output format to be?

Also side comments. I started the python code in one directory… Can I move it to another directory? If so How do I update the list?

Also side question, If I look at some published HLAs, they may mention to customize it, clone the project… And then click the local button… Not sure how to do that…

Back to playing

Quick update:
The extended SPI code is currently up in my fork/branch

Wondering at times if it should just be incorporated into SPI…

The ILI9341 experiment code is up at:

If you mean “How do I manage user options” you may be interested in User settings for measurement extensions - #8 by timreyes - I have the same issue. My “Burst Stats” extension has two “user” parameters at the top of the Python source.

Thanks, I was able to roll my own as you can see in:

Edit: where you can see my: option default, which is sort of a kludge, but for caset ans paset it shows in decimal, but others show in hex…

I guess my question in this case was if you look at the context menu for the Extension you see:

And was wondering if this setting was available to the python extension

Ah, Monday morning pre-coffee: I’d forgotten you were working with a LLA. The options issue is an HLA problem. Sorry for butting in. I haven’t ventured into LLA land so can’t help :-(.

Not a problem… Actually was wondering that on the HLA…

Luckily with the LLA, that is built in and I was only adding an extra signal to keep track of, which appears to be working.

Hey @KurtE - I wanted to cover your questions below:

Also side comments. I started the python code in one directory… Can I move it to another directory? If so How do I update the list?

You’ll need to uninstall the extestion > move the source code > reload the extension into the Logic 2 app. Sadly, we don’t have a way of quickly setting a new directory location for local extensions.

Also side question, If I look at some published HLAs, they may mention to customize it, clone the project… And then click the local button… Not sure how to do that…

Clicking the local button simply opens the folder location for the source files of that particular extension.

1 Like

@KurtE

I guess my question in this case was if you look at the context menu for the Extension you see:

And was wondering if this setting was available to the python extension

At first glance, I don’t think the display radix setting is accessible via an HLA. Let me check with the software team and get back to you on this.

Thanks @timreyes

Sorry, it may be obvious, but unclear to me on where the local button is for extensions that I install but are not mine.

For example earlier I had downloaded the LSS protocol one. I don’t see a local button, to view or edit the sources.

I can click on the repository button, and get to the github project.

Oops, sorry it’s a bit confusing. The local button is only available for extensions that are “local” to the PC and that have been manually installed (i.e. not downloaded via the extensions marketplace).

If you wanted to modify the behavior of an existing extension in the marketplace, you’ll need to navigate to their repo, clone/download it, then install the extensions manually per the instructions below: