Raspberry Pi Pico: Tutorial, pin assignments, and everything you need to know

[ad_1]
Raspberry Pi Pico has undergone a fundamental change from the previous Pis because it is not a Linux computer, but a microcontroller board like Arduino. The biggest selling point of Raspberry Pi Pico is the price of 4 dollars and the RP2040 chip, which provides sufficient power for embedded projects and enables users of any age or ability to learn coding and electronics.If you have a Windows, Apple, Linux computer or even different raspberry pie, Then you are ready to use Raspberry Pi Pico in your next project.
Getting started with Raspberry Pi Pico
The Raspberry Pi Pico is very different from any previous model. It is the first device to use RP2040 “Pi Silicon”, which is a custom system on chip (SoC) developed by the Raspberry Pi team, with dual-core Arm Cortex M0+ running at 133 MHz, 264KB of SRAM and 2MB of flash memory Use to store files.
One disadvantage of Raspberry Pi Pico is that there is no wireless connection. RP2040 is the first microcontroller in the Pi series, which brings a new way of working. Pico is not a computer, but we need to write code in an external application on another computer, and then “flash” the code to the microcontroller via USB.In our tutorial How to start using Raspberry Pi Pico, We explained how to connect a PC to Pico and use it to upload MicroPython code.
Coding with Raspberry Pi Pico
Pico and third-party RP2040 boards can use multiple programming languages, including MicroPython, CircuitPython, C/C++ and Arduino languages.Even Piper game, The block-based Python version for Pico.
MicroPython and C/C++ are languages ​​officially supported by the Pi Foundation, but similar CircuitPython has certain advantages, such as its built-in support for USB HID, which means you can turn Pico into a keyboard, mouse, or PC-recognized joystick.
MicroPython on Raspberry Pi Pico
MicroPython is the Python 3 version for microcontrollers. It was created by Damien George and used with the PyBoard development board for the first time in 2014. Since then, more and more devices have adopted this easy-to-use language, and MicroPython created by Adafruit, further branches of CircuitPython have added further enhancement boards to their range. You can use Thonny Python IDE for all major operating systems to write MicroPython code for Raspberry Pi Pico. This is the easiest way to start using Pico.
A branch of MicroPython, CircuitPython has been released for the R​​P2040 boardCreated by Adafruit, CircuitPython has an impressive library of pre-written modules for sensors, LCD/OLED/LED screens and output devices (such as thermal printers). Flash CircuitPython into Raspberry Pi Pico It is as simple as flashing MicroPython, if you wish to revert to MicroPython or C/C++, it is reversible.
C/C++
There are two ways to write code in C/C++. First, we can write the code directly in the text editor of our choice, then follow the workflow to build the files, and then flash these files to Pico. Or, we can use a graphical workflow to let Microsoft’s Visual Studio Code handle the creation, build, and flashing process in one application.
You can now
The Arduino language is a version of C/C++, so this may be an easier way to write and upload code.
Raspberry Pi Pico GPIO pins
- 26 × multi-function 3.3V GPIO pins
- 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × controllable PWM channels
- 8 × Programmable I/O (PIO) state machine for custom peripheral support.
- Castellated modules allow direct soldering to the carrier board.
The Raspberry Pi Pico runs at 3.3V and has a 40-pin GPIO, but it has a different appearance from the previous Raspberry Pi. We have GPIO pins for digital input/output, pulse width modulation (PWM), and professional communication protocols (such as I2C, SPI, UART/serial). GPIO also has three analog inputs, which other Raspberry Pis do not have. They use variable voltage to connect to, for example, potentiometers, joysticks, or photoresistors.
The GPIO pins themselves have castle-shaped, small cutouts, allowing the Raspberry Pi Pico to be soldered to the project or carrier board.
More importantly, we can also solder the plug pins to Pico and use it for breadboards. For more details, please refer to the tutorial on how to solder Raspberry Pi Pico pins.
What do you use Raspberry Pi Pico for
The Raspberry Pi Pico retails for US$4 and is a cost-effective way to repair electronic projects and study physical computing.
We can use Pico’s powerful functions at the core of robotics and maneuvering projects, collect data using temperature, humidity, light and pollution sensors, and we can learn the basics of programming and electronics.
RP2040: Raspberry Pi Silicon
Raspberry Pi Pico is the first but not the only board to use RP2040. About a dozen third-party boards have been announced, and so far, we know that three have entered the market.
Our favorite third-party RP2040 board is Adafruit’s Feather RP2040, With 16MB of storage space (2MB on Pico), 4 ADC channels (3 on Pico), an RGB light, a built-in Lipo battery connector, and most importantly, it can be connected to Adafruit’s huge ecosystem Additional board.
We also tested Pimoroni Tiny RP2040, This is a very small board with 4 ADC channels, 8MB of storage space and an RGB light. SparkFun’s MicroMod RP2040 puts the SoC on a micro M.2 board, which you can plug into various carrier boards with different functions.
Adafruit also released ItsyBitsy 2040, which follows the “ItsyBitsy” form factor and a small QT Py 2040 board. Arduino has announced They are developing the Arduino Nano RP2040 Connect, which is a variant of RP2040 with WiFi and Bluetooth capabilities. In addition to MicroMod, SparkFun also introduced two other RP2040 boards.
RP2040 board comparison
Raspberry Pico | Adafruit Feather RP2040 | AdafruitItsyBitsy RP2040 | Adafruit QT Py RP2040 | Adafruit Trinkey QT2040 | Arducam Pico4ML | Arduino Nano RP2040 connection | Cytron Maker Pi Pico | Cytron Maker Pi RP2040 | Pimoroni Keybow 2040 | Pimorono Pico Lipo | Pimoroni Tiny 2040 | SparkFun Micro Module | SparkFun Pro Micro | SparkFun Thing Plus | |
Universal input and output interface | 26 × multi-function GPIO pins 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 8 × Programmable I/O (PIO) state machine, used for custom peripherals to support the card Star module allows Solder directly to the carrier board. | 21 × multi-function 2 × SPI, 2 × I2C, 2 × UART, 4 × 12-bit ADC, 16 × controllable PWM channel 8 × programmable I/O (PIO) state machine for custom peripheral support. Castellated modules allow direct soldering to the carrier board. | 23 GPIO pins, 16 PWM outputs, 10 digital I/Os, 4 analog 12-bit ADCs, 2 I2C, SPI, 2 UARTs, 10 programmable IOs | 11 GPIO pins. 7 x digital I/O, 4 x analog 12-bit ADC, 2 x I2C (including Stemma QT), SPI, UART, 6 x programmable IO. | Stemma QT / Qwiic connector | 26×multi-function GPIO pins 2×SPI, 2×I2C, 2×UART, 3×12-bit ADC, 16×controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support | 20 multi-function 3.3V GPIO pins, 1 SPI, 1 I2C, 1 UART, 8 12-bit ADCs, 20 controllable PWM channels, 8 programmable I/O (PIO) for custom peripheral support ) state machine. 1x User LED (GPIO 13) | 26×multi-function GPIO pins 2×SPI, 2×I2C, 2×UART, 3×12-bit ADC, 16×controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support | No direct GPIO access, 7 Grove connectors provide GPIO access 4 servo connectors, which can be used as GPIO | A small number of GPIOs are available for use. I2C, serial/UART. Access to these pins requires soldering. | 26×multi-function GPIO pins 2×SPI, 2×I2C, 2×UART, 3×12-bit ADC, 16×controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support | 12 GPIO pins. 7 x digital I/O, 4 x analog 12-bit ADC, 2 x I2C, SPI, UART, debug | 30 × multi-function GPIO pins 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × PWM controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support | 20 × multi-function GPIO pins 1 × SPI, 1 × I2C (Qwiic), 2 × UART, 4 × 12-bit ADC, 10 × PWM controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support | 18 × multi-function GPIO pins 2 × SPI, 2 × I2C (Qwiic), 2 × UART, 4 × 12-bit ADC, 8 × PWM controllable. 8 × Programmable I/O (PIO) state machine for custom peripheral support |
Flash memory | 2MB | 8MB | 8MB | 8MB | 8MB | 2MB | 16MB | 2MB | 2MB | 2MB | 4/16MB | 8MB | 16MB | 16MB | 16MB |
Wi-Fi/Bluetooth | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | Nina W102 uBlox Wi-Fi module Bluetooth/BLE 4.2 | Pass ESP01 / ESP8266 | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable | not applicable |
Extra features | not applicable | 1 x WS2812B Neopixel STEMMA QT / Qwiic connector has onboard battery charging and supports hot-swappable LiPo and Lilon batteries. | 1 x WS2812B NeoPixel | 1 x WS2812B NeoPixel Stemma QT / Qwiic connector | USB A connector Stacking Stemma QT board | HiMax HM01B0, up to QVGA (320 x 240 @60fps) 0.96 inch LCD SPI display (160 x 80, ST7735) 3 axis gyroscope 3 axis accelerometer 3 axis compass Mems microphone | ST LSM6DSOXTR 6-axis IMU ST MP34DT06JTR MEMS microphone ATECC608A-MAHDA-T cryptographic coprocessor | Micro SD card reader 6 x Grove connector On-board test LED audio output through 3.5mm jack and buzzer RGB LED user button | MX1508 motor controller with two DC motor outputs and motor test button LiPo charging 2 WS2812B NeoPixel RGB LEDs | 16 Kailh hot-swappable buttons 16 RGB LEDs | MCP73831 charger with a charging current of 215mA. XB6096I2S Battery Protector Stemma QT/Qwiic Connector Power Button LED Status Indicator | User controllable RGB LED | MicroMod follows the M.2 form factor, so it is designed as a carrier board for adding additional functions. | WS2812 Addressable LED Qwiic / Stemma QT breakthrough | LiPo battery charging charging and status LED WS2812 addressable LED |
USB port | Micro USB | USB-C | USB-C | USB-C | USB-A | Micro USB | Micro USB | Micro USB | Micro USB | USB-C | USB-C | USB-C | Depends on the carrier board | USB-C | USB-C |
aspect | 51 x 21 mm | 50.8 x 22.8 mm | 36 x 18 mm | 22 x 18 mm | 2.54 x 17.8 mm | 51 x 21 mm | 45 x 18 mm | 94 x 68 mm | 88 x 64 mm | 76 x 76 mm | 53 x 21 mm | 22.9 x 18.2 mm | 22 x 22 mm | 33 x 17.8 mm | 58.4 x 22.8 mm |
Accessories and add-ons
The first and third parts are the lifeblood of Raspberry Pi and the maker community. They bring additional functionality and make the project easier to implement.
With the new dimensions of the Raspberry Pi Pico, new accessories are needed and are the first to be listed on Pimoroni, the official Raspberry Pi distributor in the UK. They released 12 new accessories Suitable for Pico, ranging from simple breakout boards that allow multiple plug-ins to be used at the same time to advanced audio output devices and VGA demo boards that use RP2040’s programmable IO to create DVI video signals. If you are more interested in LEDs, then Unicorn Pack will see 112 RGB LEDs, ready to dazzle you.
We had the opportunity to review several Pico accessories, including:
Tutorials and support
The best thing about Raspberry Pi is that it has a strong community and thousands of tutorials that have been created. From basic to complex, there are great tutorials to help you learn new skills.
In the relatively short period of time when Pico went public, the Raspberry Pi community has developed a lot of resources. At techy’s points, we have been publishing our fair sharing of Pico operating guidelines, which you can find below.
[ad_2]