Raspberry Pi Pico: let’s discover the “cheap” microcontroller!

Raspberry Pi Pico is the first board to feature a microcontroller designed entirely by the Raspberry Pi Foundation . Obviously what caused a sensation is the price of the latter: it costs only $ 4 (in Italy 4.20 – 4.50 €) . But let's start by talking about some technical characteristics. The board features an RP2040 microcontroller chip ( Arm Cortex-M0 + dual core processor with 264KB of SRAM memory and 16MB of off-chip FLASH memory).

The board size is 51x21mm, but despite its small size it offers many applications : it will be possible to control I / O peripherals through its PIO interface ( Programmable Input Output ), or manage serial communication through the I2C and SPI ports. It obviously also has 26 GPIO ( General Purpose Input Output ) pins , three of which for Analog Inputs. There are also 2 UART channels ( Universal Asynchronous Receiver-Transmitter ) for the conversion from parallel to serial format and vice versa, 16 channels for PWM control and 3 ADC ( Analog to Digital Converter ) of 12 Bit each. Finally, it is important to note that there are 1 Timer and 1 Real Time Counter for counting time and events.

Raspberry Pi Pico Pinout. Source: raspberrypi.org
Raspberry Pi Pico Pinout. Source: raspberrypi.org

How does Raspberry Pi Pico power and program?

Obviously in this article you will not find a guide on how to use a Pico since there is an official documentation provided by the Raspberry Pi Foundation (datasheet and official guide) certainly more detailed, but we will give you guidelines to power and program one. The power supply takes place via the microUSB port or via the VSYS GPIO Pin . The microcontroller has an integrated buck-boost SMPS that outputs the 3.3 V required by the RP2040 chip by taking input voltages in the range from 1.8 – 5.5 V (this certainly provides great power flexibility). Furthermore, recommended operating conditions of temperature and VBUS voltage (the input voltage from microUSB) are also provided: the temperature must remain in the range [-20 ° C, 85 ° C], while the VBUS voltage at 5V +/- 10% .

Illustration projects for a Raspberry Pi Pico, from controlling an LED, to emulating video games, to controlling the temperature or a display etc. Source: raspberrypi.org
Illustration projects for a Raspberry Pi Pico, from controlling an LED, to emulating video games, to controlling the temperature or a display etc. Source: raspberrypi.org

The Flash memory can be reprogrammed via microUSB or via the Serial Wire Debug port through a " drag and drop " programming. The programming languages ​​available are the C language and the MicroPython language . The Raspberry Pi Foundation provides a SDK C ( Software Development Kit ), a GCC-based Toolchain and of course a great Get Started with MicroPython on Raspberry Pi Pico ” guide to get started . Obviously it is not possible to install any operating system, but the use of the Raspberry Pi Pico is precisely that of an alternative microcontroller to the usual Arduino .

Why choose it?

This microcontroller certainly lends itself to many applications, from the simplest such as the control of an LED, display or PWM electric motors, to the more complex ones such as the training of Machine Learning networks through the use of Google's TensorFlow Lite Framework. The goal of TensorFlow is that of Edge AI , that is to bring Machine Learning algorithms to devices with limited computational capabilities (such as the RP2040 Chip). These become data acquisition sources and the processing is done directly on the Raspberry Pi Pico, so as to at least partially eliminate bandwidth / latency and privacy / security problems.

Programmer and gamer Ben Stragnell enjoyed using the Raspberry Pi Pico as the NES emulator , obtaining excellent performance from the RP2040 chip . This microcontroller is therefore versatile, very economical and with low power consumption . It could be a valid solution to combine our Raspberry Pi Pico with another board that performs the heaviest calculations acting as a Master (for example connected to the Internet), while the Pico would perform the control from a low latency Slave towards sensors and actuators. on the field. In short, all that remains is to try the Raspberry Pi Pico for yourself to have fun with many projects!

Article by Massimo Romano

The article Raspberry Pi Pico: let's discover the "4 penny" microcontroller! comes from Tech CuE .