Jump to content
  • 0

Analog Discovery 2 - Problems with higher SPI rates


MarcusD

Question

I am trying to use the WaveForms SPI Logger function to establish a communication between a STM32 and my PC. Everything works fine if I use slow SPI clockrates (slower than ~1Mhz) but I need rates up to 2.5 Mhz (or at least 1.3 Mhz). Is the Analog Discovery 2 even capabel of reading these fast pin changes? Are maybe my settings incorrect?

I don't have any problems with clockrates of 320 kHz or 640 kHz, but WaveForms is just showing me rubbish at 1.25 Mhz, as you can see in the Screenshot. I would have expected to see the letters "ABC" which I am sending currently from the master.

spi_prob.png.49f0cfc32332b4613dbb1b351913ddb4.png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi @MarcusD

You have set the trigger position far out on the right, -2.3ms. In order to capture with such settings the application is performing digital zoom, reducing the sample rate.
Set trigger position closer to zero or positive, on the left side.

You can select the 4th device configuration to have more buffer:
image.png.38e5d77c2f94c47d45dfaf709dcdef66.png

 

To capture even more data use the record mode:

image.thumb.png.a3825a5e5dadb994120ad2297928efbc.png

 

In case you are not interested in timing you can use the Protocol tool to log SPI data:
image.png.ad3837b32ab65a5ea6562edd186d91f8.png

Link to comment
Share on other sites

Hello attila! Thank you so much! That fixed my problem. In the end I was just too silly to use the program correctly!

It looks like this now:

SPI_LOGIC.thumb.png.4170b803aef352b6e012b2ef8552c26f.png

 

I do not have any further questions. Thank you for your help though! I am very happy with the AD2 and also with the software.

Kind regards!

Link to comment
Share on other sites

I have further questions about the sample rates.

Currently I want to log data from a SPI interface with a SCK of 21 Mhz and I want to save the captured data as a file afterwards.

I don't need a continues stream of the data. A few hundreds milliseconds would be sufficient enough.

I managed to see the correct data with the "Protocol tool", though I had to add a delay into my code, otherwise WaveForms would warn me of "Samples lost.". The delay was 1 ms long and I would like to remove it from my code.

SETTINGS.thumb.png.b5d60fe2ea4495a6a786787a8209e210.png

 

So I thought I should rather use the "Logic Tool" with the "Record Mode" so that the buffer can be filled and then send to my Computer without overwhelming the USB Port, but I just receive rubbish there. Even with the 1ms delay between the SPI messages.

SPI_PROB.png.833b91a24399a969e599eb9632f36a2c.png

 

I am not sure how I can fix this issue and I hope someone can help me here.

Link to comment
Share on other sites

Hi @MarcusD

The recording rate with Analog Discovery is limited to about 1-2MHz due to streaming over USB.
The 4th device configuration increases the Logic Analyzer buffer/fifo from 4 to 16kB, improving the rate.
The "data compression" uses half of the buffer to store sample the other half idle time. The rate with this depends on the line toggle rate, ideal to capture short burst for up to 100MHz.
The Protocol tool uses "sync" capture to store only relevant samples for the protocol, like on spi clock rising/falling edge. This can capture higher frequency signals than the previous ones.

The Digital Discovery has 2Gbit, 256MB DDRAM which can store much more data at highest rates, then transfer it to the application for further processing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...