Raspberry Pi Pico - Review

Table of contents

RoadTest: Raspberry Pi Pico

Author: ajayvishaal

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: Arduino Nano, Uno, Micro and other microcontroller development boards

What were the biggest problems encountered?: Actually I planned to use ROS2 in Ubuntu machine and Micro-ROS2 on Pico. But Facing incompatibility with versions.

Detailed Review:

Table of contents:

Introduction

          First of all I wanna thank Element14 for giving the oppourtunity to test this Raspberry Pi Pico Board. And also thanks for the patience. Since I'm not not able to submit the review before the mentioned deadline. Actually I got stucked in a technical issue. Thats the reason. However I managed to resolve the issue and completed the review. I tested this board by implementing it on

Setup

          The Pico arrived in a small packet without headers. If the headers were provided additionally, It will be useful for implementing in applications. However, I already have header pins, so just soldered it with the Pico and started testing the board.

{gallery} Raspberry Pi Pico

image

Pico Package

image

Raspberry Pi Pico (Without Headers)

image

Raspberry Pi Pico (With Headers)

Testing

  • Arduino IDE:

          After soldering the Raspberry Pi Pico, I started programming the board using Arduino IDE.

image

  • Setting up Arduino IDE:

               Since I tested in Ubuntu OS, I'm giving the instructions for setting up the IDE in Linux.

1. Open a terminal and use wget to download the official Pico setup script.

$ wget https://raw.githubusercontent.com/raspberrypi/pico-setup/master/pico_setup.sh

2. In the same terminal modify the downloaded file so that it is executable.

$ chmod +x pico_setup.sh

3. Run pico_setup.sh to start the installation process. Enter your sudo password if prompted.

$ ./pico_setup.sh 

 

4. Download the Arduino IDE and install it to your machine.

5. Open a terminal and add your user to the group “dialout.” This group can communicate with devices such as the Arduino. Using “$USER” will automatically use your username.

$ sudo usermod -a -G dialout "$USER"

6. Log out or reboot your computer for the changes to take effect.

7. Open the Arduino application and go to File >> Preferences.

8. In the additional boards manager add this line and click OK.

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

 

9. Go to Tools >>  Board >> Boards Manager.

10. Type “pico” in the search box and then install the Raspberry Pi Pico / RP2040 board. This will trigger another large download, approximately 300MB in size.

11. Go to Tools >> Board >> Raspberry Pi RP2040 Boards and select Raspberry Pi Pico.

 

12. Connect your Raspberry Pi Pico

13. Run a command to locate the USB device which identifies as a Raspberry Pi Pico. In our case it was ttyACM0.

$ dmesg

14. Open Files >> Examples >> Basics >> Blink to test that we can write code to the Arduino.

 

15. Click on Upload to write the code to the Raspberry Pi Pico. The default Blink sketch will flash the green LED next to the micro USB port on the Raspberry Pi Pico.

  • Micropython:

          After trying Arduino IDE, I thought of using micropython in Pico. So I proceeded using micropython to program the board.

Installing MicroPython on Raspberry Pi Pico:

          Download Raspberry Pi Pico Micropython file form this site.

          Pico BOOTSEL button

          Raspberry Pi Pico has a BOOTSEL mode for programming firmware over the USB port. Holding the BOOTSEL button when powering up your board will put it into a special mode where it appears as a USB Mass Storage Device.

          Pico disk drive

            Drag and drop the downloaded firmware file into this disk drive,  As soon as the file transfers, the drive will disappear and the device will reboot itself.  

Accessing the MicroPython REPL:

        Create and activate a Python virtual environment. If you are using a Mac or Linux computer, do it as follows:

python3 -m venv venv 
source venv/bin/activate

Make sure that the Python virtual environment is activated by checking that your command prompt was modified to include a (venv) prefix.

Next install the rshell tool in your virtual environment:

pip install rshell

 

Make sure the Pico is still connected to your computer with the USB cable (you will not see a disk drive now), and then execute the following command to connect to it from your computer:

rshell -p <your-pico-serial-device> --buffer-size 512

Make sure to replace <your-pico-serial-device> with the serial device name assigned to your Pico in the command above. In my case it is /dev/ttyACM0.

 

Programming the Pico:

Enter the MicroPython REPL and then type the following Python commands to turn the LED on:

from machine import Pin 
led = Pin(25, Pin.OUT)
led.on()

 

Writing a complete application:

  As an example, let’s build a short application that blinks the onboard LED five times. Here is the code, which you can copy into a new file on your computer named led_blink.py:

from machine import Pin 
from utime import sleep 
led = Pin(25, Pin.OUT)
for i in range(5):
led.on()
sleep(1)
led.off()
sleep(1)

 

Now enter into the rshell prompt:

rshell -p <your-pico-serial-device> --buffer-size 512

 

Then in the rshell prompt use the cp command to copy the file to the Pico board:

cp led_blink.py /pyboard/main.py

Conclusion

          Actually I planned to conduct the testing in a different way but due to some issues with ROS2 and gcc compiler, I'm not able to proceed it in that way. However working on it and will be updated here soon ! I wanna thank element14 for this oppourtunity and thank you all for your patience.

Anonymous