Author Topic: Continuous logic analyzer for UART, I2C, SPI?  (Read 3972 times)

0 Members and 1 Guest are viewing this topic.

Offline guillep2kTopic starter

  • Contributor
  • Posts: 24
  • Country: ar
Continuous logic analyzer for UART, I2C, SPI?
« on: May 14, 2018, 12:48:39 am »
Hi! I own one of those cheap USB logic analyzers and it's very lacking in the software department. It's compatible with Sigrok, which is nice, but all I was able to do is "after the fact" buffer analysis. I have a project where I have several chips talking to each other, like three CPUs, communication modules, etc. The protocols involved are UART, I²C and SPI. To debug my programs properly, I'd like to log everything they interchange, like a text log with all their talking, plus a couple more of digital signals. No fancy decoding. Just bytes and timestamps.

Do you guys know of any software (Open Source or cheap) that could do that in real time with this kind of USB interface? I mean to log at least one hour of interaction in a way that I can check it while it's happening (and after the fact as well, of course). I know I'm short on signals, but at least one I²C plus two UARTs should be of great help.

Thanks!
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #1 on: May 14, 2018, 01:42:07 am »
If it's a Salae clone you have, I believe sigrok-cli - the command line tool - can do continuous capture with those. You can also directly apply protocol decoding and log the output to a file.
 

Offline guillep2kTopic starter

  • Contributor
  • Posts: 24
  • Country: ar
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #2 on: May 14, 2018, 01:47:42 am »
Intresting... I'll check that out. Thanks.
 

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #3 on: May 14, 2018, 01:55:17 am »
They give an example command on a page in the sigrok wiki:

sigrok-cli --config samplerate=1M --driver=fx2lafw --continuous -P spi:mosi=1:clk=3:cs=4

https://sigrok.org/wiki/Getting_started_with_a_logic_analyzer
 
The following users thanked this post: nugglix

Offline IonizedGears

  • Regular Contributor
  • *
  • Posts: 248
  • Country: us
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #4 on: May 14, 2018, 06:42:04 am »
I believe the beta version of saleae's software does real time capture.

Sent from my Pixel XL using Tapatalk

I am an EE with interests in Embedded, RF, Control Systems, and Nanotech.
 

Offline guillep2kTopic starter

  • Contributor
  • Posts: 24
  • Country: ar
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #5 on: May 17, 2018, 02:02:59 am »
Yes, sigrok-cli is exactly what I was looking for, thank you.

Unfortunately, my el-cheapo USBee AX clone does not seem to fully support it and interrupts the parsing after a short while (also the parsed output doesn't look right).

But I've got the answer I was looking for. Now it's a matter of finding a less-sucking device, picking from the sigrok's supported hardware list.

Thank you, guys!
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #6 on: May 17, 2018, 06:55:20 pm »
As of now, sigrok-cli doesn't do much buffering at all, so the interruption you describe could be caused by sigrok-cli spending too much time processing the data and being unable to pull data from the device. The FIFO in the FX2 then overflows and data acquisition ends.

Can you tell us what parameters you used and show the output of "sigrok-cli -V"?
 

Offline guillep2kTopic starter

  • Contributor
  • Posts: 24
  • Country: ar
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #7 on: May 17, 2018, 08:44:19 pm »
AFAIK it's the latest:

Code: [Select]
c:\Program Files (x86)\sigrok\sigrok-cli>sigrok-cli.exe -V
sigrok-cli 0.8.0-git-690617b

Libraries and features:
- libsigrok 0.6.0-git-cdb134e/4:0:0 (rt: 0.6.0-git-cdb134e/4:0:0).
 - Libs:
  - glib 2.50.2 (rt: 2.50.2/5002:2)
  - libzip 1.1.3
  - libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1)
  - libusb-1.0 1.0.20.11003-rc3
  - libftdi 1.2
  - Host: i686-w64-mingw32.static.posix, little-endian.
  - SCPI backends: TCP, serial, USBTMC.
- libsigrokdecode 0.6.0-git-ef10cea/4:0:0 (rt: 0.6.0-git-ef10cea/4:0:0).
 - Libs:
  - glib 2.50.2 (rt: 2.50.2/5002:2)
  - Python 3.4.4 / 0x30404f0 (API 1013, ABI 3)
  - Host: i686-w64-mingw32.static.posix, little-endian.

I don't remember the exact parameters, but I've used 2 MS/s for a test SPI signal with a clock <400 MHz. I specified my inputs and added CPOL=0 & CPHA=0 accordingly. PulseView shows the signals correctly.
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Continuous logic analyzer for UART, I2C, SPI?
« Reply #8 on: May 17, 2018, 11:44:24 pm »
PulseView is more efficient with high bandwidth usb devices compared to cli (cli starves the usb host even without decoders).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf