This tutorial explains how to get a functional and cheap scope for debugging your microcontroller busses. This is useful if you want to debug e.g. i2c and have lend your scope to a colleague or student. Of course you could buy a second or even third one, but you can also make a simple one using a Pi Pico and a Raspberry Pi.

Note: While you don’t really need a Raspberry Pi as you could even use your laptop or some other computer. However, a Pi is much more convenient of course as it works as a separate device.

There is a great software for this purpose: ligrok and pulseview.

We let you manage this in following 5 steps:

1. Open a Raspberry Pi terminal.
2. Install sigrok and pulseview.
3. Raspberry Pi Pico Development Environment.
4. Fix the Pico as a Logic Analyzer.
5. Install a development tool to program the Pico.

Step 1. Open a Raspberry Pi terminal

You basically have the following options:

  • A. On the Pi itself: Open the following icon on the Pi. Then go to step 2.
Terminal Icon | Soda Red Iconset | TrySoda
  • B. Using SS: Login to the Pi remotely. Then issue the commands from your normal system and go to step 2.
  • C. Use VNC: Connect to the system in a graphical way. Then follow step 1A.
Step 2. Install sigrok and pulseview.

Apparently there are a lot of ways to do this. I was unsuccessful in compiling pulseview. It is recommended to use a Pi with at least 4Gb memory: mine was a 8Gb RAM model. There were some script issues that stood in the way. But fortunately you don’t even need to compile the binaries. You can simply use following commands instead:

  • sudo apt-get install sigrok
  • sudo apt-get install pulseview
Step 3. Raspberry Pi Pico Development Environment

After that install the development environment for the Raspberry Pi Pico. Fortunately we can download a script that helps to install all what we need:
  • cd ~
  • wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh
  • sudo chmod +x pico_setup.sh
  • ./pico_setup.sh
  • Finally reboot the Pi (sudo reboot)
Step 4. Fix the Pico as a Logic Analyzer

There is a nice tutorial to get one started:
https://www.hackster.io/markkomus/using-a-raspberry-pi-pico-as-a-logic-analyzer-with-pulseview-e12543 Step 5. Install a development tool to program the Pico

Now we will move to the last stap in which we will program the Pico to have scope functionality.

To program the Pico we need some development tool. To do so you could use very simple tools (e.g. Nano and CLI). It is however easier to use a tool like Visual Studio Code. Other stuff
Interesting (related) links: