Guides · 10 min read

Raspberry Pi Pico Logic Analyzer: sigrok-pico and PulseView

Raspberry Pi Pico logic analyzer: flash sigrok-pico, decode I2C, UART and SPI in PulseView, channel and sample rate table, 3.3 V protection and an I2C bug.

A Raspberry Pi Pico logic analyzer turns a board costing a few dollars into an instrument that records digital signals and shows them on screen. When a sensor doesn't answer, a display stays blank or the serial port prints garbage, a multimeter only tells you the average voltage; a logic analyzer shows every bit on the line together with its timing. A Pico running the sigrok-pico firmware gives you 21 digital channels in the free PulseView software and decodes protocols such as I2C, UART and SPI byte by byte.

In this guide you will flash the sigrok-pico firmware onto a Pico, install PulseView and connect to the device, learn how the number of channels relates to the sample rate and see how to measure a 5 V Arduino without exceeding the 3.3 V limit. Then you will generate test signals with an Arduino Uno or a second Pico, try the I2C, UART and SPI decoders and finally use the analyzer to find out step by step why an OLED display doesn't work.

Raspberry Pi Pico used as a logic analyzer
With sigrok-pico, GP2–GP22 become digital and GP26–GP28 analog channels

What is a logic analyzer and how does it work?

A logic analyzer reads the voltage on every channel at regular intervals and stores only two states: 1 if it is above the threshold voltage, 0 if it is below. The number of readings per second is the sample rate. Sampling at 2 MHz means checking the line every 0.5 microseconds. The captured bit stream is sent to the computer; PulseView draws it as waveforms on a time axis and protocol decoders turn those waveforms into meaningful information such as "I2C start, address 0x3C, write, ACK". Unlike an oscilloscope, it shows timing and content rather than the shape of the signal, but in return it can watch many channels at once at low cost. sigrok-pico reads the pins at a fixed rate with the Pico's PIO block; you can learn how PIO works in the Pico PIO and dual core guide.

Featuresigrok-pico (Pico, RP2040)Note
Digital channels21 (D2–D22 = GP2–GP22)The dig26 and dig32 builds enable more channels
Analog channels3 (A0–A2 = GP26–GP28)7-bit, about 20 mV resolution
Maximum digital rate120 MS/sOnly for short captures stored on the device
Minimum rate5 kHz-
Analog rate500 kS/s in totalShared between the enabled analog channels
Input voltage0–3,3 VNot 5 V tolerant
ConnectionUSB serial port (CDC)Usually needs no extra driver

Flashing sigrok-pico and installing PulseView

  1. Download pico_baseline.uf2 for the Pico, or pico2_baseline.uf2 for the Pico 2, from the pico_sdk_sigrok/release folder of the sigrok-pico project. The baseline build provides 21 digital and 3 analog channels.
  2. Hold the Pico's BOOTSEL button and plug in the USB cable. A drive called RPI-RP2 (RP2350 on the Pico 2) appears on your computer.
  3. Drag the UF2 file onto this drive. The Pico restarts and now shows up as a USB serial port. If the board isn't recognised, make sure you are using a data cable.
  4. Install the current development (nightly, 0.5.0-git) build of PulseView from the sigrok download page. The old stable 0.4.2 release and sigrok-cli 0.7.2 don't include this driver.
  5. In PulseView, open the Connect to Device window, choose RaspberryPI PICO (raspberrypi-pico) as the driver, select Serial Port as the interface and the Pico's port (such as COM5 or /dev/ttyACM0), then click Scan for devices.
  6. Select the device that appears and click OK. Set the number of samples and the sample rate in the toolbar, switch off the channels you don't use and take your first capture with Run.
If the Pico doesn't show up on your computer, the problem is usually the cable or the BOOTSEL sequence; a detailed checklist is in the Raspberry Pi Pico not recognised guide. If the port opens on Windows but no device is found, close other programs that hold the port and unplug and replug the board.

Channel count and sample rate

The Pico's speed is limited by two things: whether the capture fits in the Pico's memory and how much data USB can carry per second (roughly 400–800 kB/s). If a short capture is held in memory, PIO can sample at up to 120 MS/s. When the capture is long or a software trigger is enabled, the data streams live over USB and the rate drops to a few hundred kS/s. In this mode sigrok-pico uses RLE (run-length encoding): if the line doesn't change for a long time, it only sends "the same for this many samples". On sparse signals the effective rate increases several times this way. The rule is simple: switch off unused channels and enable channels contiguously starting from D2; the firmware expects the channels to be enabled without gaps from D2 upwards.

Enabled digital channelsStored capture (max samples)RateLonger capture (USB streaming)
1–4400 000120 MS/s500 kS/s + RLE
5–7200 000120 MS/s500 kS/s + RLE
8–14100 000120 MS/s (60 MS/s recommended)250 kS/s + RLE
15–2150 000120 MS/s (60 MS/s recommended)167 kS/s + RLE
0 digital + 1 / 2 / 3 analog200 000 / 100 000 / 67 000500 / 250 / 160 kS/s500 / 250 / 160 kS/s

To choose the right rate, use this rule of thumb: sample at at least 4 times the fastest clock or bit rate you want to decode, and at 10 times for comfortable reading. A rate that is higher than needed shortens the capture, while one that is too low misses edges and makes the decoder produce wrong bytes. The table below lists settings that work well for the examples in this article; the window shows how many milliseconds of data you will see in one capture.

SignalEnabled channelsSample rateSamplesWindow
I2C 100 kHzD2–D32 MHz400 000200 ms
I2C 400 kHzD2–D34 MHz400 000100 ms
UART 9600 baudD2–D4200 kHz400 0002 s
UART 115200 baudD2–D41 MHz400 000400 ms
SPI 250 kHzD2–D72 MHz200 000100 ms
SPI 4 MHzD2–D740 MHz200 0005 ms

The 3.3 V limit and input protection

The Pico's pins work between 0 and 3.3 V and are not 5 V tolerant. When you measure a 3.3 V circuit (an ESP32, another Pico, 3.3 V sensors), a 1 kΩ resistor in series with each signal line is enough; it limits the current if a pin is accidentally set as an output. When you measure a 5 V board such as the Arduino Uno, put a voltage divider on every channel: the signal goes through 10 kΩ to the Pico pin, and the Pico pin goes through 20 kΩ to GND. The output is 5 × 20 / (10 + 20) = 3.33 V. A high-impedance divider doesn't upset an I2C bus either: with a 4.7 kΩ pull-up the line stays at 4.3 V, the Pico sees 2.9 V, comfortably above the RP2040's logic-high threshold of about 2 V. You can work it out for your own resistors with the voltage divider calculator, and for a bidirectional solution use a logic level converter.

The analyzer's GND must always be connected to the GND of the circuit you are measuring; without a common ground you will see random noise. Never connect RS-232 lines (±12 V), 12 V automotive signals or mains voltage directly to this analyzer. Measure an unknown line with a multimeter first.

Wiring: test circuit and analyzer channels

SignalArduino Uno (5 V, via divider)Target Pico (3.3 V, 1 kΩ)Analyzer channel (Pico pin)
I2C SDAA4GP4D2 = GP2 (pin 4)
I2C SCLA5GP5D3 = GP3 (pin 5)
UART TXD1GP0D4 = GP4 (pin 6)
SPI SCKD13GP18D5 = GP5 (pin 7)
SPI MOSID11GP19D6 = GP6 (pin 9)
SPI CSD10GP17D7 = GP7 (pin 10)
GNDGNDGNDGND (pin 3 / 38)

Note that the channels are wired in order starting from D2: when capturing I2C you enable only D2–D3, for UART D2–D4 and for SPI D2–D7. That keeps the number of enabled channels low in each measurement, so you can use the higher rates in the table. Connect the analyzer Pico to the computer and the test board to another port with its own USB cable; join the GND of both boards with a short wire.

Generating test signals with an Arduino Uno

The sketch below sends data on all three protocols every 100 ms: on the I2C bus it first tries the deliberately wrong address 0x3D, then the correct address 0x3C; it prints the result over UART at 9600 baud and sends the bytes 0xA5 and 0x5A over SPI in mode 0. If an OLED display is on the bus, 0x3C gets an ACK, otherwise both addresses get a NACK; both cases are clearly visible on the analyzer.

C++ (Arduino IDE)
1// Mantık analizörü için test sinyali üreteci / Test signal generator for a logic analyzer
2// Arduino Uno: I2C A4 (SDA) A5 (SCL), UART D1 (TX), SPI D13 (SCK) D11 (MOSI) D10 (CS)
3#include <Wire.h>
4#include <SPI.h>
5
6const uint8_t YANLIS_ADRES = 0x3D;  // Koddaki hatalı adres / Wrong address in the code
7const uint8_t DOGRU_ADRES = 0x3C;   // OLED'in gerçek adresi / The OLED's real address
8const uint8_t CS_PIN = 10;          // SPI yonga seçimi / SPI chip select
9
10// 0 = ACK geldi, 2 = adreste NACK / 0 = ACK received, 2 = NACK on address
11uint8_t adresDene(uint8_t adres) {
12  Wire.beginTransmission(adres);
13  Wire.write(0x00);  // Zararsız tek bayt / One harmless byte
14  return Wire.endTransmission();
15}
16
17void setup() {
18  Serial.begin(9600);     // UART D1 (TX) üzerinden / UART on D1 (TX)
19  Wire.begin();           // I2C ana cihaz / I2C master
20  Wire.setClock(100000);  // 100 kHz standart hız / 100 kHz standard mode
21  SPI.begin();
22  pinMode(CS_PIN, OUTPUT);
23  digitalWrite(CS_PIN, HIGH);
24}
25
26void loop() {
27  uint8_t s1 = adresDene(YANLIS_ADRES);
28  uint8_t s2 = adresDene(DOGRU_ADRES);
29  Serial.print("0x3D:");
30  Serial.print(s1);
31  Serial.print(" 0x3C:");
32  Serial.println(s2);
33
34  // SPI mod 0, 250 kHz, iki bayt / SPI mode 0, 250 kHz, two bytes
35  SPI.beginTransaction(SPISettings(250000, MSBFIRST, SPI_MODE0));
36  digitalWrite(CS_PIN, LOW);
37  SPI.transfer(0xA5);
38  SPI.transfer(0x5A);
39  digitalWrite(CS_PIN, HIGH);
40  SPI.endTransaction();
41
42  delay(100);  // Her yakalama penceresinde en az bir paket / At least one burst per capture window
43}

Test signals with a Raspberry Pi Pico and MicroPython

If you have a second Pico, no divider is needed because both boards run at 3.3 V. Save the code below as main.py on the target Pico running MicroPython. It uses the hardware blocks I2C0 (GP4, GP5), UART0 (GP0) and SPI0 (GP18, GP19, GP16), first scans the I2C bus and then sends the same test packets. The Pico's I2C driver enables the internal pull-ups, but they are weak; if there is no module on the bus, add two external 4.7 kΩ resistors.

MicroPython
1# Hedef Pico: analizör için test sinyalleri (MicroPython)
2# Target Pico: test signals for the analyzer (MicroPython)
3from machine import Pin, I2C, UART, SPI
4import time
5
6i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=100000)  # I2C0: GP4 SDA, GP5 SCL
7uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))  # UART0: GP0 TX
8spi = SPI(0, baudrate=250000, polarity=0, phase=0,
9          sck=Pin(18), mosi=Pin(19), miso=Pin(16))   # SPI0, mod 0 / mode 0
10cs = Pin(17, Pin.OUT, value=1)                       # SPI CS: GP17
11
12while True:
13    # Bulunan adresler / Addresses found on the bus
14    print("I2C:", [hex(a) for a in i2c.scan()])
15    try:
16        i2c.writeto(0x3D, b"\x00")  # Bilerek yanlış adres / Wrong address on purpose
17    except OSError:
18        print("0x3D: NACK")
19    uart.write(b"BG\n")             # UART test metni / UART test text
20    cs.value(0)
21    spi.write(b"\xA5\x5A")          # SPI test baytları / SPI test bytes
22    cs.value(1)
23    time.sleep_ms(100)

Decoding I2C, UART and SPI in PulseView

  • I2C: Pick I2C from the Add protocol decoder icon in the toolbar and assign SCL to D3 and SDA to D2. The decoder shows start (S), address, read or write, ACK or NACK and stop (P) labels. Addresses are shown as 7-bit by default. For the basics, see What is I2C.
  • UART: Add the UART decoder, choose D4 as the RX channel and set the baud rate to 9600, data bits to 8, parity to none and stop bits to 1. If the baud rate is wrong, the decoder shows [ERROR] or garbage characters. Details are in the UART serial communication guide.
  • SPI: In the SPI decoder select CLK = D5, MOSI = D6 and CS# = D7; you can leave MISO empty. For mode 0, CPOL must be 0 and CPHA 0. The decoder shows the bytes A5 and 5A every time CS goes low. The difference between the modes is explained in What is SPI.
  • Triggering: If you put a trigger on the falling edge of a channel (SDA for I2C or CS for SPI, for example), the capture starts exactly at the event. Because a software trigger streams the data over USB, the streaming limits from the rate table apply.
  • Command line: You can take the same measurement with sigrok-cli: sigrok-cli -d raspberrypi-pico:conn=/dev/ttyACM0 --config samplerate=2m --channels D2,D3 --samples 400000 -P i2c:scl=D3:sda=D2. On Windows you write conn=COM5.

A real debugging example: why is the OLED blank?

0.96 inch I2C OLED display module
The 0x78 printed on the back is the 8-bit address; Arduino code uses 0x3C

Here's the scenario: a project with an SSD1306 OLED compiles and uploads, but the display stays blank. The wiring looks right and there are no errors in the Serial Monitor. When you connect the analyzer to SDA and SCL and take 400,000 samples at 2 MHz, the I2C decoder shows: Start, Address write: 3D, NACK, Stop. So the Arduino is talking and the bus is healthy, but nobody answers at address 0x3D. The code contains display.begin(SSD1306_SWITCHCAPVCC, 0x3D), the address the library examples use for 128x64 displays. The back of the module, however, says 0x78. That is the 8-bit address including the read/write bit: shift 0x78 one bit to the right and you get 0x3C. Arduino's Wire library expects the 7-bit address. Change it to 0x3C and the capture shows Address write: 3C, ACK and the display comes on. If the resistor on the back is soldered to the 0x7A side, the correct address is 0x3D.

What you see on the analyzerMeaningWhat to do
Address write followed by NACKNo device at this addressRun an I2C scan and use the 7-bit address
No Start at all, SDA and SCL always highThe code never starts I2C or uses the wrong pinsCheck Wire.begin() and the pin numbers
SDA or SCL stuck lowNo pull-ups, or a device is holding the busAdd 4.7 kΩ pull-ups, power-cycle the devices
Decoder shows random addressesSDA and SCL swapped, or the rate is too lowSwap the channels, sample at least 10 times faster

Common mistakes and fixes

  • Pico is missing from the PulseView driver list: You are using the old 0.4.2 release; install the current development build.
  • The capture stops halfway with an "overflow" or abort error: You exceeded the USB streaming rate. Reduce the number of channels, keep the sample count below the memory limit or lower the sample rate.
  • Channels are unexpectedly empty: You didn't enable the channels contiguously from D2. Enable D2, D3, D4 in order; don't leave a disabled channel in between.
  • Everything is random noise: No common GND, or the wires are too long. Connect the analyzer's GND to the circuit under test and keep the wires under 20 cm.
  • Garbage characters on UART: Wrong baud rate or parity. Enter the value from Serial.begin() in the target code into the decoder.
  • The analog channel looks stepped: That's normal; sigrok-pico sends analog data at 7 bits (steps of about 20 mV). For precise voltage measurements use a multimeter or a real oscilloscope.
To make the analyzer permanent, solder the Pico onto a small piece of perfboard, add 1 kΩ series resistors and coloured clip leads to channels D2–D9, and build a removable 10 kΩ / 20 kΩ divider board for 5 V measurements. That way you can start measuring within seconds on every new project.

You learn the most with a logic analyzer when you look at the signals of a working project and match the code to the waveform. The I2C LCD and Raspberry Pi Pico projects in the BlueGrays app give you the wiring diagram and code step by step, so you can build one, clip the analyzer onto its lines and see with your own eyes how every line of code looks on the wire.

Frequently asked questions

Can a Raspberry Pi Pico be used as a logic analyzer?

Yes. A Pico flashed with the sigrok-pico firmware becomes a logic analyzer with 21 digital and 3 analog channels in PulseView and sigrok-cli. It can sample at up to 120 MS/s for short captures and decode protocols such as I2C, UART and SPI.

Which PulseView version works with sigrok-pico?

The driver was merged into sigrok's main code in 2023, so you need the current development (nightly, 0.5.0-git) build of PulseView. The old stable 0.4.2 release and sigrok-cli 0.7.2 don't recognise the Pico.

How fast is a Raspberry Pi Pico logic analyzer?

The speed depends on the number of enabled channels and the length of the capture. With 1–4 channels, 120 MS/s is possible for up to 400,000 samples; longer captures stream over USB and drop to around 500 kS/s, which RLE multiplies several times on sparse signals.

Can a Pico logic analyzer measure 5 V signals?

Not directly, because the Pico's pins are not 5 V tolerant. Put a 10 kΩ and 20 kΩ voltage divider on each channel to bring 5 V down to 3.3 V, or use a logic level converter. Always connect the grounds as well.

How do I decode I2C in PulseView?

Select I2C from the Add protocol decoder icon and assign SCL and SDA to the channels you wired. Set the sample rate to at least 10 times the I2C clock; 1–2 MHz is enough for 100 kHz. The decoder shows the address, read or write, ACK or NACK and the data bytes.

Is the I2C address 0x78 or 0x3C?

Both refer to the same device. 0x78 is the 8-bit form that includes the read/write bit; shift it one bit to the right and you get the 7-bit 0x3C. Arduino Wire and MicroPython expect the 7-bit address (0x3C), and PulseView shows 7-bit addresses by default.

See all projects
Raspberry Pi Pico Onboard LED Blink (Pico and Pico W)
PI-1Beginner

Raspberry Pi Pico Onboard LED Blink (Pico and Pico W)

The opening project of the Raspberry Pi Pico series! We blink the Pico's green built-in LED to confirm the board works, the classic "Hello World" first experiment. No external parts needed, just the Pico and a USB cable. The code is written in MicroPython, the language officially supported by the Raspberry Pi Foundation.

5.0(1)
11
Raspberry Pi Pico: Controlling an External LED (Breadboard)
PI-2Beginner

Raspberry Pi Pico: Controlling an External LED (Breadboard)

The next step after the Pico's built-in LED: connect an external LED on a breadboard and control it through pin GP14. You'll learn how to use any of the Pico's GPIO pins as an output, the LED's polarity (long leg = anode/+, short leg = cathode/–) and why a current-limiting resistor (220Ω) is a must. Without the resistor, too much current flows through the LED and it can burn out.

4.5(2)
7
Raspberry Pi Pico Button Controlled LED (Push)
PI-9Beginner
Premium

Raspberry Pi Pico Button Controlled LED (Push)

First input project with Pico — button read! LED lights while button is pressed, off when released. This is the big step after LED animations: signal input from the world to Pico. Learn Pin.IN (input mode), Pin.PULL_UP (internal pull-up resistor — standard for buttons), button.value() reading. GP14 LED, GP2 button (internal PULL_UP). Pressed = LOW (0), released = HIGH (1) — reverse logic seems confusing at first but is industry standard.

11
Raspberry Pi Pico Button Toggle LED
PI-10Beginner

Raspberry Pi Pico Button Toggle LED

Button + LED — next level! Unlike the basic button project, there is no need to hold the button. Press and release → LED on. Press and release again → LED off (toggle). Same circuit (LED GP14, Button GP2), but big code difference. Learn edge detection (capturing the 1→0 falling moment), state tracking, debounce (mechanical bounce filter). MicroPython's led.toggle() swaps state in one line. Foundation of all interactive button projects (mode switcher, IRQ, double-click).

13
Raspberry Pi Pico Button Debounce: IRQ vs Software Polling
PI-13Intermediate
Premium

Raspberry Pi Pico Button Debounce: IRQ vs Software Polling

If one press of a button made your code count 3-4 times, the culprit is contact bounce: the button's metal contacts open and close many times within microseconds as they touch! In this project we count the same button in 2 different ways and compare them side by side in Serial: RAW polling (catches the bounce and miscounts) and IRQ + software debounce (counts correctly).

12
Raspberry Pi Pico PWM LED Fade (Breathing Effect)
PI-14Beginner

Raspberry Pi Pico PWM LED Fade (Breathing Effect)

The LED doesn't just blink anymore, it breathes! With the Raspberry Pi Pico's PWM (Pulse Width Modulation), the LED's brightness slowly rises and then slowly fades, a calm "breathing" effect like a sleeping laptop's light. You'll learn the machine.PWM class, the 16-bit brightness value from 0–65535 with duty_u16() and the PWM frequency.

4
Using LCD Screen with I2C
AR-32Beginner
Premium

Using LCD Screen with I2C

Give your Arduino its own screen and make it write its first message. The two-line LCD screen hooks up with just a few wires; a greeting appears on the top line, then a second message on the bottom…

4.8(53)
71
ESP32 I2C LCD Display (16x2)
ES-17Intermediate
Premium

ESP32 I2C LCD Display (16x2)

In this project we connect a 16x2 character LCD to the ESP32 over I2C and display text. With I2C, just 2 data pins (SDA and SCL) control the screen, instead of the 6+ pins a classic parallel connection wastes. The code prints a fixed message on the first line and a counter that goes up every second on the second. At startup an I2C scanner also prints the display's address to the Serial Monitor (usually 0x27 or 0x3F).

4.9(23)
40