Jump to content
  • 1

Digital Discovery SPI repeating trigger problem


K1MGY

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

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

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.
 

Link to comment
Share on other sites

Right. And that's just exactly what the document says. Essentially no discription of he enable and/or the clock (though clock is self-evident).

Anyways, since I posted my question, I have attempted to use it. First let me say that it works ONLY for "enable" HI or LO. It really does strange things for any of the transition modes, rising, falling or edge. My suggestion is that you remove these modes. I'm not sure what to expect using them, but they don't do anything you might expect. Is it supposed to enable the "chip" only during the transition?  That wouldn't be very useful. But it doesn't do that anyway.

If you're interested, here's my setup. Using a Static IO switch to enable high ore low, it works as expected. It begins accumulating at the clock rate as soon as it sees the HI or the LO and remains enabled until you remove it.

Using the same switch, in UP transition with the switch static at 0 (or 1, for that matter), SYNC just free runs. Then if you toggle the switch slowly, the process is interrupted for a hundred or more clock cycles. The actual number of cycles varies all over the place. The most interesting thing is that you still collect ALL the data, even during these interruptions.  BUT during the interrupted state, there is one looooooooong clock cycle with the appropriate value! And the NEXT displayed value is NOT a RANDOM value, but the very next value from the source. I set up Patterns with a binary 3 bit counter, and you always get the next binary value after this miles long cycle comes by.

Don't fix it. Just delete the transition options and call it a feature.

 

Thanks,

Gary

 

 

The one thing I haven't been able to get much info on is the SYNC mode on the logic analyser instrument. Any hints?

Link to comment
Share on other sites

Thanks! What I'm discovering is that this software is much more powerful and sophisticated than what I first thought. I just need to take time to press every button, tab, and icon on the instrument to see what's there. Even the little arrows, plus and minus signs just sitting there that, when pressed reveals more controls, secrets or whatnot.  And there's a lot of whats and whatnots....

Link to comment
Share on other sites

30 minutes ago, K1MGY said:

I took some screen captures using an older version of a product called Snagit (the new version is not so good).  I suspect Atilla used something similar.

If you're wondering: I believe the user documentation and case examples for this product need a lot of improvement.

I never quite achieved the success I needed from the tool and software, which is unfortunate.

I assume you've seen this. It lacks some explanation of terms but is the best I could find.

https://reference.digilentinc.com/learn/instrumentation/tutorials/ad2-logic-analyzer/start

Link to comment
Share on other sites

7 minutes ago, fgaryamy said:

This is not an answer to the question, but a comment and a question.

WOW this is good simple info that I would expect to be readily available in some document. What is the document and where is it located?

I took some screen captures using an older version of a product called Snagit (the new version is not so good).  I suspect Atilla used something similar.

If you're wondering: I believe the user documentation and case examples for this product need a lot of improvement.

I never quite achieved the success I needed from the tool and software, which is unfortunate.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.


  

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.


 

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...