The Raspberry Pi association entered the microcontroller market with a card that attracted attention with its price of $ 4 called Pico.
At the heart of Pico, we see RP2040, the SoC developed by Raspberry Pi for this platform. We’ll go into the details of this chip in detail in a moment, but first let’s look at what you can do with this board and the differences with previous Raspberry Pi versions.
First of all, the Raspberry Pi Pico is not a complete computer. So it is different from previous Raspberry Pi models. It is not a device that we see in many mini computers, where we can connect keyboards, mice, monitors, use old game console games with an emulator, connect it to a television and make a player for our home theater system.
Just like an Arduino, you connect it to another computer via USB, write the code you want to run on it and upload it to it, and you can control electronic components such as LED, screen, motor driver and sensor that you can connect to the input / output pins on it.
How is it programmed?
For those who are wondering, Pico can be programmed with MicroPython and C / C ++. However, for those who want to start programming quickly and practically, we recommend MicroPython because it is much simpler to set up. Soon we will plug in Pico to our computer and write a sample code.
Silicon that makes Pico possible: RP2040
RP2040 does not use the AVR architecture chips found in Arduino’s Uno models. Instead, it has a dual-core processor running at 133Mhz using Arm’s Cortex M0 + architecture, which has a very low power consumption. When you think of the 16Mhz Atmega 328p found in Arduino’s most popular models, the Pico’s processor is unnecessarily powerful. Indeed, if your goal is electronic prototyping, a 133Mhz processor will be more than enough.
The M0 + is produced with modern 40nm production technology for such usage scenarios and has ultra low power consumption. However, since it is a 32bit processor, the AVR-based Arduino is now quite modern compared to the 8-bit and 16Mhz Atmega 328p, which we can call antique.
Of course, there is a reason the Raspberry Pi association made this processor so fast. Because this platform supports even the works of our age such as machine learning.
In addition to the processor, the board has a 264kb code memory and a 2MB flash for code storage. Arduino Atmega 328p has 2kb of code memory and 28KB of usable code storage. For this reason, old Arduino models were a big limitation for projects with long codes. But let’s not be unfair to Arduino either. Because they also adopted the Arm architecture and issued a card named Zero. This board uses the old version M0 of the processor M0 + in Pico.
Arduino Zero vs Pico
However, when we look at the price of Zero, we see that it is $ 43. So it’s 10 times more expensive than Pico. And as if it wasn’t enough, its features are also very low compared to Pico. For example, its processor has 48Mhz, memory 32kb and 256kb of code storage. In the light of all this information, we can say that the Raspberry Pi Pico is a revolutionary card in hobby electronics. Indeed, squeezing a powerful microcontroller that consumes so little energy into such a small space and selling it for $ 4 is to dethrone Arduino a little.
Pico can be purchased both with the feet not soldered in this way and with ready-to-solder. If you do not have a soldering iron at home, or if you are not experienced in soldering, we recommend you buy a version with solder feet.
Input & Output Pins
When we look closely, we see that the card has 26 input / output pins open to us. We can use 3 of them as analog inputs and these pins are connected to an analog-to-digital converter with a resolution of 12 bits. In addition, 16 of these pins have the ability to output PWM. We see that these features are much better than the average Arduino.
Programming with MicroPython
Now let’s see how we can connect Pico to a computer running Windows 10 and write and run a sample code. First, connect it to your computer using the micro usb slot on the Pico. When you first run it, you should see it in My Computer as a 128MB flash drive. This indicates that Pico is running in firmware flash mode. If you cannot see this disk drive in My Computer, disconnect the usb cable and reconnect it by holding down the button labeled “Bootsel” on the Pico. This will start the Pico in firmware flash mode.
The language we recommend for programming is Micro Python and the IDE we recommend for this language is Thonny. After downloading Thonny and installing it on our computer, we go to the Tools menu and from there to the interpreter. We select the Raspberry Pi Pico option in MicroPython brackets from the list above.
If you can see it in the list below, you can choose Pico from the Port section. If you can’t see it, it’s okay. Then we need to click the Install or update firmware text at the bottom and install the firmware to Pico to work with MicroPython. You will see the directory of the driver that appears in My Computer in the target device section and it will write “Raspberry Pi RP2” against the target device model.
As soon as you hit the Install button. The Pico will be automatically recognized and the latest MicroPython firmware will be downloaded from the internet and installed on the Pico. Pico will then restart. When it restarts, you will notice that the firmware is out of flashing mode, so you will no longer see a disk drive in My Computer, this is normal.
Now restart the Thonny app. We are ready to write our first code. Let’s not break the tradition and let’s write print and open parentheses and then open quotes and write hello world and close the claws and brackets. When we click the run code button, Thonny will ask where we want to run this code. We can choose either this computer or the Raspberry Pi Pico. When we select Pico, we will be asked with what name we want to save the code in Pico. Here we write trial.py and save. And you can see that our article Hello World is printed on the console. Of course, this is the simplest code you can write in MicroPython, but it is useful to show that the system works and how programming works in Pico.
You can find plenty of guides for more advanced projects on the Raspberry Pi association website. With feet soldered to the pins of the Pico, you can place it on a circuit board, connect keys, leds and other electronic components and enter hobby electronics in no time.
As you can see from the review, it is not a device that the buyer will regret to buy with its cheap price. You can learn and discover brand new things thanks to Pi Pico with the hobby electronics, programming world it will open to you.
You can access the official website of the Pi Pico model, which is more like Arduino than previous Raspberry Pi devices: https://www.raspberrypi.org/products/raspberry-pi-pico/