Using the USB Logic Analyzer with sigrok PulseView

Pages
Contributors: jimblom
Favorited Favorite 3

Exploring the Capabilities

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

Here's a fun, tormenting Arduino sketch you can load to help familiarize yourself with PulseView's capabilities:

language:c
void setup() {
  // put your setup code here, to run once:
  randomSeed(analogRead(A0));
  Serial.begin(random(1, 115200)); // Set the baud rate to a random value between 1 and 115200 bps
}

void loop() {
  Serial.println(millis()); // Print the time
  delay(250);
}

Load that onto an Arduino, then connect the logic analyzers "CH0" to your Arduino's TX pin (pin 1). Also connect on of the GND wires to GND.

Hardware connection

Before scanning, bump up the sample rate to 1MHz and change the sample quantity to 1 M samples. Depending on what you're trying to analyze, these dropdowns may get a lot of use. With those values set, hit Run.

You should be greeted with a seconds worth of samples, and a few blips on the D0 channel every 250ms.

Results of our mystery baud scan

You can use your mouse's scroll wheel to zoom in and out, or use the "+" and "-" buttons on the toolbar. Zoom into one of the blips. Now it's your job to guess the baud rate!

The Show cursors (pair of blue flags icon) tool can be useful for measuring time. Click that, then try to place the cursors around one bit of the transmission. The measured frequency should be our mystery baud rate!

Mystery baud measurement

To decode the string, use the Add low-level, non-stacked protocol decoder tool (looks like yellow and green decoded signals). Then select UART -- note that a huge list of protocols pops up here, including I2C, I2S, SDIO, and SPI.

Assortment of protocol analyzers

Click the green "UART" icon that appears towards the bottom-left and change the baud rate to your measured frequency. You can also change the data format to ascii to make the data easier to parse.

Decoding the UART traffic

Now if you zoom out you should see your serial prints decoded!