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.

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.
| Feature | sigrok-pico (Pico, RP2040) | Note |
|---|---|---|
| Digital channels | 21 (D2–D22 = GP2–GP22) | The dig26 and dig32 builds enable more channels |
| Analog channels | 3 (A0–A2 = GP26–GP28) | 7-bit, about 20 mV resolution |
| Maximum digital rate | 120 MS/s | Only for short captures stored on the device |
| Minimum rate | 5 kHz | - |
| Analog rate | 500 kS/s in total | Shared between the enabled analog channels |
| Input voltage | 0–3,3 V | Not 5 V tolerant |
| Connection | USB serial port (CDC) | Usually needs no extra driver |
Flashing sigrok-pico and installing PulseView
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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 channels | Stored capture (max samples) | Rate | Longer capture (USB streaming) |
|---|---|---|---|
| 1–4 | 400 000 | 120 MS/s | 500 kS/s + RLE |
| 5–7 | 200 000 | 120 MS/s | 500 kS/s + RLE |
| 8–14 | 100 000 | 120 MS/s (60 MS/s recommended) | 250 kS/s + RLE |
| 15–21 | 50 000 | 120 MS/s (60 MS/s recommended) | 167 kS/s + RLE |
| 0 digital + 1 / 2 / 3 analog | 200 000 / 100 000 / 67 000 | 500 / 250 / 160 kS/s | 500 / 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.
| Signal | Enabled channels | Sample rate | Samples | Window |
|---|---|---|---|---|
| I2C 100 kHz | D2–D3 | 2 MHz | 400 000 | 200 ms |
| I2C 400 kHz | D2–D3 | 4 MHz | 400 000 | 100 ms |
| UART 9600 baud | D2–D4 | 200 kHz | 400 000 | 2 s |
| UART 115200 baud | D2–D4 | 1 MHz | 400 000 | 400 ms |
| SPI 250 kHz | D2–D7 | 2 MHz | 200 000 | 100 ms |
| SPI 4 MHz | D2–D7 | 40 MHz | 200 000 | 5 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.
Wiring: test circuit and analyzer channels
| Signal | Arduino Uno (5 V, via divider) | Target Pico (3.3 V, 1 kΩ) | Analyzer channel (Pico pin) |
|---|---|---|---|
| I2C SDA | A4 | GP4 | D2 = GP2 (pin 4) |
| I2C SCL | A5 | GP5 | D3 = GP3 (pin 5) |
| UART TX | D1 | GP0 | D4 = GP4 (pin 6) |
| SPI SCK | D13 | GP18 | D5 = GP5 (pin 7) |
| SPI MOSI | D11 | GP19 | D6 = GP6 (pin 9) |
| SPI CS | D10 | GP17 | D7 = GP7 (pin 10) |
| GND | GND | GND | GND (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.
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.
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?

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 analyzer | Meaning | What to do |
|---|---|---|
| Address write followed by NACK | No device at this address | Run an I2C scan and use the 7-bit address |
| No Start at all, SDA and SCL always high | The code never starts I2C or uses the wrong pins | Check Wire.begin() and the pin numbers |
| SDA or SCL stuck low | No pull-ups, or a device is holding the bus | Add 4.7 kΩ pull-ups, power-cycle the devices |
| Decoder shows random addresses | SDA and SCL swapped, or the rate is too low | Swap 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.
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.
Projects to build after reading this
See all projects
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.

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.

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.

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).

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).

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.

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…

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).
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 750+ Arduino, ESP32, ESP8266, Pico, mBot and micro:bit projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

