Need answer Sigrok several protocol decoder - Page 1
Forum section: electronics / projects

author: SigrokLover
author_rank: Newbie
timestamp: February 11, 2019, 01:57:41 pm
content: Hi,For a project, I will purchase a logic analyzer that is compatible with sigrok. The idea would be to have a SPI sniffer (9 slaves + MISO+MOSI+ CLK) and an I2C sniffer.To do this, I chose a 16-channel logic analyzer (12 for SPI, 2 for I2C). I searched for two days on the internet but I couldn't find an answer to my questions.So I have two questions:1) Can sigrok decode an SPI communication with 9 slaves (CS0, CS1,... CS8)? I have only seen examples where only one slave was involved.2) Can sigrok independently decode I2C and SPI at the same time if the channels dedicated to both protocols are specified?Thank you for your time.

author: tsman
author_rank: Frequent Contributor
timestamp: February 11, 2019, 03:11:54 pm
content: Install the Sigrok software. PulseView has a virtual demo device so you can play about with the interface without having any hardware connected.Quote from: SigrokLover on February 11, 2019, 01:57:41 pmYes. You can have add SPI decoders sharing CLK/MISO/MOSI but separate CS in the Sigrok PulseView software.Quote from: SigrokLover on February 11, 2019, 01:57:41 pmYes.

author: SigrokLover
author_rank: Newbie
timestamp: February 11, 2019, 08:03:12 pm
content: Thank you very much tsman, your answer really helps me!I intend to use sigrok-cli to study the collected data (using a python script for example). Can you confirm that what you told me about pulseview also applies to sigrok-cli?Thank you again in advance, you're helping me a lot!

author: tsman
author_rank: Frequent Contributor
timestamp: February 11, 2019, 08:43:22 pm
content: Sorry. I'm not sure about sigrok-cli as I've never used it. Just playing about with it now and it doesn't seem to like it but the docs say it should be possible?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: February 11, 2019, 11:24:19 pm
content: Some 45 minutes into this video you get some examples on working with sigrok-cli:Manpage of sigrok-cli says:Code:-P, --protocol-decoders <list>This option allows the user to specify a comma-separated list ofprotocol decoders to be used in this session. The decoders arespecified by their ID, as shown in the -L (--list-supported)output.Example:$ sigrok-cli -i <file.sr> -P i2cEach protocol decoder can optionally be followed by a colon-sep‐arated list of options, where each option takes the formkey=value.Example:$ sigrok-cli -i <file.sr>-P uart:baudrate=115200:parity_type=oddThe list of supported options depends entirely on the protocoldecoder. Every protocol decoder has different options it sup‐ports.This reeks very stronly of being able to add as many instances of the protocol decoders as you need.I have not checked, nor used it in this way, but it seems logical that Pulseview exchanges data & commands with sigrok-cli in the background, and if so, this means that anything you can do with Pulseview can also be done with sigrok-cli.But if you have doubts, then use the magic words "24MHz 8ch" and get yourself an EUR 5 box from Ali / Ebay / Banggood / China and start experimenting.

author: SigrokLover
author_rank: Newbie
timestamp: February 12, 2019, 12:09:06 pm
content: To tsman:It doesn't say explicitly that it's possible, but I just assumed like in Pulseview, if the channels are specified it could be possible to decode and export data according to the protocols used (SPI and I2C in my case). For example, Channel 0 to 11 for SPI and channel 12 to 13 for I2C. But once again, I couldn't find a similar case in the Internet, so I'm just assuming.To Doctorandus_P :Thank you for your answer! I hope so. I had already seen the video (many times :p) and read the doc. I have the same feeling as you but couldn't find a proof of that while searching for a similar case as mine.Otherwise, worst case scenario, I could decode the SPI communication and for the I2C communication, I would still be able to export raw data and proccess it using a script.I thought about buying a super cheap logic analyser but the shipping time is super long in Europe and I won't finish the project on time if wait for it. That why, I was super glad to find this community !Anyway, thanks again both of you for your time. If you have any supports (known similar application, example of sigrok-cli + script,...) you think may be interesting for me, don't hesitate to share it with me.