Capture 2 minutes SPI traffic and save it - Page 1
Forum section: electronics / testgear

author: pilot5599
author_rank: Newbie
timestamp: June 24, 2024, 11:53:33 pm
content: Hello,I have a Rigol MSO5204 oscilloscope. I'm trying to figure out if it's possible to capture a 2 minutes SPI trffic and save it to the USB drive. Or the capture can be saved to Windows?I managed to connect the scope to my Windows via LAN. I'm able to do remote control from the web browser in my Windows. But I don't know if it's possible to save a relative long period of captures directly to Windows. I tried the USB drive. But it can save the current screen.I understand I can decode those 4 analog channels. If I connect my device via the digial channels to the scope. Can I decode those digital channels?Thanks in advance!

author: thm_w
author_rank: Super Contributor
timestamp: June 25, 2024, 12:05:20 am
content: Its much easier to do this with a $10 sigrok USB logic analyzer. Depending on the speed of your SPI bus.Yes you can decode on either the analog or digital inputs.

author: Someone
author_rank: Super Contributor
timestamp: June 25, 2024, 12:16:08 am
content: Quote from: pilot5599 on June 24, 2024, 11:53:33 pmScope has 200Mpts of memory, can capture >2min at 1M sample per second.Where is the problem?

author: thm_w
author_rank: Super Contributor
timestamp: June 25, 2024, 01:20:45 am
content: OP says they are only getting the current screen data, so maybe the file format or settings they use to export are incorrect.Either way its a bit of a hassle, as mentioned here:https://www.eevblog.com/forum/testgear/rigol-mso5000-unrecorded-memory-garbage/https://github.com/ngscopeclient/scopehal-apps/issues/287

author: dietert1
author_rank: Super Contributor
timestamp: June 25, 2024, 10:11:31 am
content: I would try a STM32 nucleo board with 2 SPIs to sniff transactions on both MOSI and MISO and send it to a windows or linux host via USB continuously. Everybody uses what they are familiar with.Regards, Dieter

author: TizianoHV
author_rank: Regular Contributor
timestamp: June 26, 2024, 05:42:49 am
content: +1 for sigrok, it is easy to use and you can save directly logs to your pc and review them later.

author: tooki
author_rank: Super Contributor
timestamp: June 26, 2024, 07:02:56 am
content: Another useful tool, if one does SPI/I2C bus debugging a lot and can afford it, is a tool like the Aardvark, whose software is designed around bus debugging. In particular, compared to a pure logic analyzer, you can also write things to the bus as needed. But there are many, many ways to skin this cat, including DIY solutions like the Nucleo board dieter1 mentions (or any other fast MCU with enough buses for your situation).

author: nctnico
author_rank: Super Contributor
timestamp: June 26, 2024, 07:38:27 am
content: Quote from: Someone on June 25, 2024, 12:16:08 amThe problem is decoding only what is on screen instead of full memory. Then the question is how many SPI messages need to be captured; the number of decoded messages is typically limited as well. Last but not least, 1MS/s may not be enough. OTOH, if there is a lot of dead time between the SPI messages, segmented recording can be an option and requesting each (decoded) segment through a piece of software (Python script).

author: Someone
author_rank: Super Contributor
timestamp: June 26, 2024, 09:39:37 am
content: Quote from: nctnico on June 26, 2024, 07:38:27 amPerhaps, lots of guessing/imagination on your part. The OP needs to explain what limitations they are coming up against.Can it record 2 minutes of data and off load that to usb or PC? yes. That was the question posed.

author: kripton2035
author_rank: Super Contributor
timestamp: June 26, 2024, 10:07:21 am
content: sigrok pulseview and this :https://www.aliexpress.com/item/1005005698409712.html

author: dietert1
author_rank: Super Contributor
timestamp: June 26, 2024, 11:04:50 am
content: The scope variant will be limited to 200 MSamples. In order to log 2 minutes that is about 1 MHz sampling, which isn't good enough for most SPI. Often SPI works at clock frequencies of several MHz up to 50 MHz or so.That's why i thought about making a SPI sniffer, that can handle those higher clock rates without producing a vast overhead.It could use some GPIOs as inputs for the nCS signals to tag recorded SPI transactions per bus device.Regards, Dieter

author: TomKatt
author_rank: Frequent Contributor
timestamp: June 26, 2024, 11:24:39 am
content: The $149DSlogic Plus LAcan stream 3 channels at 100MHz (or 6 channels at 50MHz) sampling rate over usb to pc for ~160 seconds. The $299 DSLogic U3Pro16 is USB3 and can stream 6 channels at 500MHz. Their DSview software is based on Sigrok Pulseview and has basically the same feature set, including SPI decoding.Depending on the task, I often switch between scope and LA for serial comms work. The LA is great for decoding, but only the scope can identify signal issues (timing, missing or runt pulses, etc).

author: pilot5599
author_rank: Newbie
timestamp: June 28, 2024, 10:48:20 pm
content: Thanks everyone!I figured out the way to save the memory in csv format. I also found out how to configure the scope to decode the digital channels.Thanks again!