• 0
K1MGY

Digital Discovery SPI repeating trigger problem

Question

New Digital Discovery user.  I did not purchase this device for its excellent documentation or thorough applications examples (which are not so great), but because it can capture SPI at 800MHz with the special adapter.  I understand that the Digital Discovery will stream the captured data to memory and I can save it to disk.

I'm debugging a difficult SPI issue, and need to see as much detail as possible (hence the 800MHz).  Out test code captures some 30,000 rows of 14 consecutive 14-bit reads at an SPI clock speed of 27.5 MHz.  This is a whole lot of data.  We need to see the protocol capture results and compare it with what our embedded system is reporting.  We read a very slow, clean R/C ramp (falling), gather all the data, and create a statistical plot which tells us how many "hits" we get on a certain bin value.  Here's a snip:
 

image.thumb.png.966d429961e1a3959b4be881be1be9a6.png

In this example, and despite the fact that our input ramp is changing in a very linear fashion (and therefore we should see equal distribution), decimal 4083 (ending in 100011) has far fewer hits than those adjacent.

Each column (in the green) is a single SPI read of our ADC.  We do 14 through DMA (very fast), and then repeat without much delay.  

I thought Digital Discovery would (a) trigger on the falling chip select, and (b) keep recording the data stream (ignoring subsequent chip select cycles).  It doesn't.  Instead, it captures the first 14 samples and no more data after that.

Hopefully it's possible to trigger on CS (going low) and just keep sampling until I press stop.  (Ideally if there's a timeout value allowing us to stop once CS stays high for a certain duration, that would be ideal).  Finally, I have no idea how to save my data to a file and in a certain format.

My setup:

image.thumb.png.bd0ae05de5b344df98755067a498c380.png



Please help this new user.  I suspect it's simple, but the online docs are not very revealing, and experimentation isn't getting me far.


Thanks!

image.png

 

image.png

Edited by K1MGY

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Hi @K1MGY

You could use the Record mode to capture more samples.

image.thumb.png.ce2aca0a288a72548bf71b0a08b77432.png

 

You can also use the Protocol/ SPI/ Spy which stores only the relevant bits for the given protocol.

image.thumb.png.eaf9f7584f2345e94b2a84cc39ff0bc8.png

Share this post


Link to post
Share on other sites
  • 0

The record mode, I find, gets a lot of data.  It may be good for finding glitches as it does a deep inspection. Unfortunately I need a very accurate capture of the SPI only.

The SPI / SPY does not use the high speed interface.  As I am concerned that my SPI host is not decoding properly, I need Digital Discovery to provide accurate decoding at high host speeds (my host runs up to 30MHz).  And I need to capture a lot of data, so it must stream.

Can I configure the SPI/SPY to stream data it captures?

 

Share this post


Link to post
Share on other sites
  • 0

Hi @K1MGY

The DIO should handle such frequency, it also depends on the driver circuit. You could try SPI/Spy if this interface meets your requirements.

Could you elaborate this question?

2 hours ago, K1MGY said:

Can I configure the SPI/SPY to stream data it captures?

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, attila said:

Hi @K1MGY

The DIO should handle such frequency, it also depends on the driver circuit. You could try SPI/Spy if this interface meets your requirements.

Could you elaborate this question?

To determine if my host processor is properly reading the SPI data stream, I need a device (hopefully Digital Discovery is the right choice!) that will read the SPI accurately and log the interpreted results.  This way, I can compare the result data from Digital Discovery with my host.

Unfortunately I found out that the logic analyzer is the only facility that allows an 800 MHz sample rate capture.  I figured out how to export the data.  Unfortunately the data file is very large, and mostly filled with "X".  When it does capture data, it reports it repeatedly (which I guess makes sense as it is sampling at a high rate).  It would be much better if it reported the data once, and just put a single "X" between each captured packet.

Selecting SPI/SPY, I do not get the option to use the high speed connection.  I will try it with low speed, but would be more assured if it were a higher speed than 100MHz.  Hopefully I can stream SPI/SPY in the same way as the logic analyzer?

--
So I set up using DIO24 (chip select) DIO25 (clock) and DIO26 (data).  Pressed Receive and then caused my host to do SPI.  I get nothing.

How do I set up the triggering?  I see "manual trigger" with no further options.


 

 

Edited by K1MGY

Share this post


Link to post
Share on other sites
  • 0

Hi @K1MGY

You can export the SPI (or any other added interpret events) or the filtered Events view.
You could also use View/ Logging for custom export script.

image.thumb.png.c66fb1e1d05d4720242686c1aff3038d.png

 

The Protocol tool has no triggering option.
Are you somehow driving the DIO signals from StaticIO or Patterns interfaces?

The Manual trigger is an internal trigger signal that can be selected as source in instruments (also as output on Analog Discovery) and activated by that "Manual Trigger" button, Ctrl+T or under Settings.

Share this post


Link to post
Share on other sites
  • 0

Version:  Waveforms 3.12.61  using Digital Discovery

Part of my digital discovery is trying to discover how to make this tool work. :)

I see no Events window.  How do I get that, please?  The help section is of no help unfortunately.

 

image.thumb.png.04cb139acbbbf3b30143a98ad41dee65.png

Share this post


Link to post
Share on other sites
  • 0

Thanks for pointing me to that.  Very obscure.. and I still don't know what it does, but figure I'll learn once I have some data.

Is there something published that can step me through making a simple SPI measurement and capture?  Because I have no data now.

I moved back to the high speed pins and selected 

Here's my setup:

3-wire SPI on host
  SPCK (clock)
  MISO (data)
  !CS      (chip select, active low)

20 MHz SPI baud rate

In the logic analyzer I have attached Select to DIN 15, Clock to DIN 14 and Data to DIN 13.
Rising Sample.  Data is 13 bits, MSB with Ending 1.  Start is set to 0S.

Here are the screens:
image.png.c63944d682aa2298815542776609134b.png

image.png.ecd5fba485c05325c7cd3e2ca8441e2d.pngSelect is set Active LOW.  Clock is set


My SPI consists of repetitive CS followed by 14 bits of data, followed by another CS.. this happens thousands of times. 

When I press Record the screen immediately says "recording".  Shouldn't it wait for a trigger?  I have it set on Select.

When I press Repeated, the screen says "armed" and then a second later it seems to start taking data.

In both cases I get no data.  Flat lines.

I confirmed that my clock and data are on the correct pins.


  

Share this post


Link to post
Share on other sites
  • 0

Record mode works, but doesn't trigger.  It just runs.  That's fine, if it's streaming as I can stop it when my SPI is done.  However, record mode stops on its own after a certain amount of samples.  With my SPI set to 20MHz, and using 200MHZ inputs, a 200MHz rate and 67.109964M Samples, I end up with 603 captured packets.  This seems odd.  Why does it stop?  And why am I seeing only 603 packets, when my SPI consisted of 30,000 packets?

image.png.80db79e5798c4921ff94e48ac8ef0df2.png

I've looked at the documentation several times, hoping to find some solutions.  There are many things called out in the docs that are not available to me in the software.  This is why I must keep asking questions here.
 

Share this post


Link to post
Share on other sites
  • 0

Hi @K1MGY

The captures are based on trigger. 
Like in the above you have the trigger position at 50% of the 300ms capture. The recording will do a prefill for 150ms, wait for trigger condition then stop after 150ms.
If you have Normal trigger it will wait for this forever, if you have Auto trigger and there is no trigger it will timeout after about 2 seconds, for None trigger it will simply do a 300ms capture and stop.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now