# Getting Started with Raspberry Pi Pico and CircuitPython

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/098/848/medium800/raspberry_pi_circuitpython_RP_01_top_ORIG_2021_01b.jpg?1611338794)

The Raspberry Pi foundation changed single-board computing&nbsp;[when they released the Raspberry Pi computer](https://www.raspberrypi.org/archives/723), now they're ready to do the same for microcontrollers with the release of the brand new&nbsp; **Raspberry Pi Pico**. This low-cost microcontroller board features a powerful new chip, the&nbsp; **RP2040** , and all the fixin's to get started with embedded electronics projects at a stress-free price.

The Pico is 0.825" x 2" and can have headers soldered in for use in a breadboard or perfboard, or can be soldered directly onto a PCB with the castellated pads. There's 20 pads on each side, with groups of general purpose input-and-output (GPIO) pins interleaved with plenty of ground pins. All of the GPIO pins are 3.3V logic, and are not 5V-safe so stick to 3V! You get a total of&nbsp; **25 GPIO** &nbsp;pins (technically there are 26 but IO #15 has a special purpose and should not be used by projects), **3 of those can be analog inputs** (the chip has 4 ADC but one is not broken out). There are no true analog output (DAC) pins.

![](https://cdn-learn.adafruit.com/assets/assets/000/098/793/medium800/circuitpython_RP_01_quarter_ORIG_2021_01.jpg?1611184210)

On the slim green board is minimal circuitry to get you going: A 5V to 3.3V power supply converter, single green LED on GP25, boot select button, RP2040 chip with dual-core Cortex M0+, 2 MegaBytes of QSPI flash storage, and crystal.

**Inside the RP2040 is a 'permanent ROM' USB UF2 bootloader**. What that means is when you want to program new firmware, you can hold down the BOOTSEL button while plugging it into USB (or pulling down the RUN/Reset pin to ground) and it will appear as a USB disk drive you can drag the firmware onto. Folks who have been using Adafruit products will find this very familiar - we use the technique on all our native-USB boards. Just note you don't double-click reset, instead hold down BOOTSEL during boot to enter the bootloader!

The RP2040 is a powerful chip, which has the clock speed of our M4 (SAMD51), and two cores that are equivalent to our M0 (SAMD21). Since it is an M0 chip, it does not have a floating point unit, or DSP hardware support - so if you're doing something with heavy floating point math, it will be done in software and thus not as fast as an M4. For many other computational tasks, you'll get close-to-M4 speeds!

![](https://cdn-learn.adafruit.com/assets/assets/000/098/794/medium800/circuitpython_RP_01_side_ORIG_2021_01.jpg?1611184252)

For peripherals, there are two I2C controllers, two SPI controllers, and two UARTs that are multiplexed across the GPIO - check the pinout for what pins can be set to which. There are 16 PWM channels, each pin has a channel it can be set to (ditto on the pinout).

You'll note there's no I2S peripheral, or SDIO, or camera, what's up with that? Well instead of having specific hardware support for serial-data-like peripherals like these, the RP2040 comes with the PIO state machine system which is a unique and powerful way to create&nbsp;_custom hardware logic and data processing blocks_&nbsp;that run on their own without taking up a CPU. For example, NeoPixels - often we bitbang the timing-specific protocol for these LEDs. For the RP2040, we instead use a PIO object that reads in the data buffer and clocks out the right bitstream with perfect accuracy.&nbsp;[Same with I2S audio in or out, LED matrix displays, 8-bit or SPI based TFTs, even VGA](https://github.com/raspberrypi/pico-examples/tree/master/pio)! In MicroPython and CircuitPython you can create PIO control commands to script the peripheral and load it in at runtime. There are 2 PIO peripherals with 4 state machines each.

There is great [C/C++ support](https://github.com/raspberrypi/pico-sdk) **,** [Arduino](https://arduino-pico.readthedocs.io/en/latest/)**[support](https://arduino-pico.readthedocs.io/en/latest/) ([guide](https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core)), an official&nbsp;****[MicroPython port](https://micropython.org/download/) ****, and a&nbsp;**** [CircuitPython port](https://circuitpython.org/downloads) ****!** &nbsp;We of course&nbsp;[recommend CircuitPython because we think it's the easiest way to get started](https://learn.adafruit.com/welcome-to-circuitpython)&nbsp;and it has support with most our drivers, displays, sensors, and more, supported out of the box so you can follow along with our CircuitPython projects and tutorials.

While the RP2040 has lots of onboard RAM (264KB), it does not have built in FLASH memory. Instead that is provided by the external QSPI flash chip. On this board there is 2MB, which is shared between the program it's running and any file storage used by MicroPython or CircuitPython. When using C/C++ you get the whole flash memory, if using Python you will have about 1 MB remaining for code, files, images, fonts, etc.

![](https://cdn-learn.adafruit.com/assets/assets/000/098/795/medium800/circuitpython_RP_01_iso_01_ORIG_2021_01.jpg?1611184294)

 **RP2040 Chip features:**

- Dual ARM Cortex-M0+ @ 133MHz
- 264kB on-chip SRAM in six independent banks
- Support for up to 16MB of off-chip Flash memory via dedicated QSPI bus
- DMA controller
- Fully-connected AHB crossbar
- Interpolator and integer divider peripherals
- On-chip programmable LDO to generate core voltage
- 2 on-chip PLLs to generate USB and core clocks
- 30 GPIO pins, 3 of which can be used as analogue inputs
- Peripherals
- 2 UARTs
- 2 SPI controllers
- 2 I2C controllers
- 16 PWM channels
- USB 1.1 controller and PHY, with host and device support
- 8 PIO state machines

## Other Required Hardware

The following list of hardware, or some equivalent thereof, is required to complete this guide.

Featured
### Half Sized Premium Breadboard - 400 Tie Points

[Half Sized Premium Breadboard - 400 Tie Points](https://www.adafruit.com/product/64)
This is a cute, half-size breadboard with&nbsp;400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm&nbsp;x 5.5cm&nbsp;with a standard double-strip in the middle and two power rails on both sides.&nbsp;You can pull the power rails off easily to make the breadboard as...

In Stock
[Buy Now](https://www.adafruit.com/product/64)
[Related Guides to the Product](https://learn.adafruit.com/products/64/guides)
![Angled shot of half-size solderless breadboard with red and black power lines.](https://cdn-shop.adafruit.com/640x480/64-06.jpg)

Featured
### Premium Male/Male Jumper Wires - 40 x 6" (150mm)

[Premium Male/Male Jumper Wires - 40 x 6" (150mm)](https://www.adafruit.com/product/758)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 6" (150mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" male header contacts on either end and fit cleanly next to each other...

In Stock
[Buy Now](https://www.adafruit.com/product/758)
[Related Guides to the Product](https://learn.adafruit.com/products/758/guides)
![Angled shot of Premium Male/Male Jumper Wires - 40 x 6 (150mm)](https://cdn-shop.adafruit.com/640x480/758-04.jpg)

Featured
### Premium Female/Male 'Extension' Jumper Wires - 40 x 6" (150mm)

[Premium Female/Male 'Extension' Jumper Wires - 40 x 6" (150mm)](https://www.adafruit.com/product/826)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 6" (150mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" male header contacts on one end and 0.1" female header contacts...

In Stock
[Buy Now](https://www.adafruit.com/product/826)
[Related Guides to the Product](https://learn.adafruit.com/products/826/guides)
![Angled shot of Premium Female/Male 'Extension' Jumper Wires - 40 x 6 (150mm)](https://cdn-shop.adafruit.com/640x480/826-04.jpg)

Featured
### Tactile Switch Buttons (12mm square, 6mm tall) x 10 pack

[Tactile Switch Buttons (12mm square, 6mm tall) x 10 pack](https://www.adafruit.com/product/1119)
Medium-sized clicky momentary switches are standard input "buttons" on electronic projects. These work best in a PCB but [can be used on a solderless breadboard as shown in this tutorial](https://learn.adafruit.com/adafruit-arduino-lesson-6-digital-inputs?view=all). The...

In Stock
[Buy Now](https://www.adafruit.com/product/1119)
[Related Guides to the Product](https://learn.adafruit.com/products/1119/guides)
![Angled shot of 10 12mm square tactile switch buttons.](https://cdn-shop.adafruit.com/640x480/1119-03.jpg)

Featured
### Diffused 5mm LED Pack - 5 LEDs each in 5 Colors - 25 Pack

[Diffused 5mm LED Pack - 5 LEDs each in 5 Colors - 25 Pack](https://www.adafruit.com/product/4203)
Need some indicators? We are big fans of these diffused LEDs. They are fairly bright, so they can be seen in daytime, and from any angle. They go easily into a breadboard and will add that extra zing to your project.

Now you can get a pack of 25 with 5 different colors

- Pack of...

In Stock
[Buy Now](https://www.adafruit.com/product/4203)
[Related Guides to the Product](https://learn.adafruit.com/products/4203/guides)
![scattered pile of multi colored unlit LEDs ](https://cdn-shop.adafruit.com/640x480/4203-02.jpg)

Featured
### Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25

[Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2780)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 220Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2780)
[Related Guides to the Product](https://learn.adafruit.com/products/2780/guides)
![Angled shot of 25 Through-Hole Resistors - 220 ohm 5% 1/4W.](https://cdn-shop.adafruit.com/640x480/2780-00.jpg)

Any resistors with a value of 220Ω-1.0KΩ will work. The higher the value, the dimmer your LEDs will be!

Featured
### Piezo Buzzer

[Piezo Buzzer](https://www.adafruit.com/product/160)
Piezo buzzers are used for making beeps, tones and alerts. This one is petite but loud! Drive it with 3-30V peak-to-peak square wave. To use, connect one pin to ground (either one) and the other pin to a square wave out from a timer or microcontroller. For the loudest tones, stay around 4 KHz,...

In Stock
[Buy Now](https://www.adafruit.com/product/160)
[Related Guides to the Product](https://learn.adafruit.com/products/160/guides)
![Bread-board friendly Piezo Buzzer](https://cdn-shop.adafruit.com/640x480/160-01.jpg)

Featured
### Breadboard trim potentiometer

[Breadboard trim potentiometer](https://www.adafruit.com/product/356)
These are our favorite trim pots, perfect for breadboarding and prototyping. They have a long grippy adjustment knob and with 0.1" spacing, they plug into breadboards or perfboards with ease.

This is the same pot that comes with our character LCDs and tutorial...

Out of Stock
[Buy Now](https://www.adafruit.com/product/356)
[Related Guides to the Product](https://learn.adafruit.com/products/356/guides)
![Breadboard friendly trim potentiometer](https://cdn-shop.adafruit.com/640x480/356-03.jpg)

Featured
### PIR (motion) sensor

[PIR (motion) sensor](https://www.adafruit.com/product/189)
PIR sensors are used to detect motion from pets/humanoids from about 20 feet away (possibly works on zombies, not guaranteed). This one has an adjustable delay before firing (approx 2-4 seconds), adjustable sensitivity **and** we include a 1 foot (30 cm) cable with a socket so you...

Out of Stock
[Buy Now](https://www.adafruit.com/product/189)
[Related Guides to the Product](https://learn.adafruit.com/products/189/guides)
![Angled Shot of the PIR (motion) sensor.](https://cdn-shop.adafruit.com/640x480/189-04.jpg)

Featured
### Adafruit NeoPixel LED Strip with 3-pin JST Connector - 1 meter

[Adafruit NeoPixel LED Strip with 3-pin JST Connector - 1 meter](https://www.adafruit.com/product/4801)
Plug in and glow, this **Adafruit NeoPixel LED Strip with JST PH Connector** has **30 total LEDs** &nbsp;and is 1&nbsp;meter&nbsp;long, in classy Adafruit Black. It's not too long but has lots of glowing action.[...](https://www.adafruit.com/product/3900)

Out of Stock
[Buy Now](https://www.adafruit.com/product/4801)
[Related Guides to the Product](https://learn.adafruit.com/products/4801/guides)
![Adafruit NeoPixel LED Strip with 3-pin JST Connector lit up rainbow](https://cdn-shop.adafruit.com/640x480/4801-05.jpg)

- [Next Page](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/pinouts.md)

## Guide Products

### Half Sized Premium Breadboard - 400 Tie Points

[Half Sized Premium Breadboard - 400 Tie Points](https://www.adafruit.com/product/64)
This is a cute, half-size breadboard with&nbsp;400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm&nbsp;x 5.5cm&nbsp;with a standard double-strip in the middle and two power rails on both sides.&nbsp;You can pull the power rails off easily to make the breadboard as...

In Stock
[Buy Now](https://www.adafruit.com/product/64)
[Related Guides to the Product](https://learn.adafruit.com/products/64/guides)
### Premium Male/Male Jumper Wires - 40 x 6" (150mm)

[Premium Male/Male Jumper Wires - 40 x 6" (150mm)](https://www.adafruit.com/product/758)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 6" (150mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" male header contacts on either end and fit cleanly next to each other...

In Stock
[Buy Now](https://www.adafruit.com/product/758)
[Related Guides to the Product](https://learn.adafruit.com/products/758/guides)
### Premium Female/Male 'Extension' Jumper Wires - 40 x 6" (150mm)

[Premium Female/Male 'Extension' Jumper Wires - 40 x 6" (150mm)](https://www.adafruit.com/product/826)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 6" (150mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" male header contacts on one end and 0.1" female header contacts...

In Stock
[Buy Now](https://www.adafruit.com/product/826)
[Related Guides to the Product](https://learn.adafruit.com/products/826/guides)
### Tactile Switch Buttons (12mm square, 6mm tall) x 10 pack

[Tactile Switch Buttons (12mm square, 6mm tall) x 10 pack](https://www.adafruit.com/product/1119)
Medium-sized clicky momentary switches are standard input "buttons" on electronic projects. These work best in a PCB but [can be used on a solderless breadboard as shown in this tutorial](https://learn.adafruit.com/adafruit-arduino-lesson-6-digital-inputs?view=all). The...

In Stock
[Buy Now](https://www.adafruit.com/product/1119)
[Related Guides to the Product](https://learn.adafruit.com/products/1119/guides)
### Diffused 5mm LED Pack - 5 LEDs each in 5 Colors - 25 Pack

[Diffused 5mm LED Pack - 5 LEDs each in 5 Colors - 25 Pack](https://www.adafruit.com/product/4203)
Need some indicators? We are big fans of these diffused LEDs. They are fairly bright, so they can be seen in daytime, and from any angle. They go easily into a breadboard and will add that extra zing to your project.

Now you can get a pack of 25 with 5 different colors

- Pack of...

In Stock
[Buy Now](https://www.adafruit.com/product/4203)
[Related Guides to the Product](https://learn.adafruit.com/products/4203/guides)
### Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25

[Through-Hole Resistors - 220 ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2780)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 220Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2780)
[Related Guides to the Product](https://learn.adafruit.com/products/2780/guides)
### Piezo Buzzer

[Piezo Buzzer](https://www.adafruit.com/product/160)
Piezo buzzers are used for making beeps, tones and alerts. This one is petite but loud! Drive it with 3-30V peak-to-peak square wave. To use, connect one pin to ground (either one) and the other pin to a square wave out from a timer or microcontroller. For the loudest tones, stay around 4 KHz,...

In Stock
[Buy Now](https://www.adafruit.com/product/160)
[Related Guides to the Product](https://learn.adafruit.com/products/160/guides)
### Breadboard trim potentiometer

[Breadboard trim potentiometer](https://www.adafruit.com/product/356)
These are our favorite trim pots, perfect for breadboarding and prototyping. They have a long grippy adjustment knob and with 0.1" spacing, they plug into breadboards or perfboards with ease.

This is the same pot that comes with our character LCDs and tutorial...

Out of Stock
[Buy Now](https://www.adafruit.com/product/356)
[Related Guides to the Product](https://learn.adafruit.com/products/356/guides)

## Related Guides

- [PIR Motion Sensor](https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor.md)
- [Programming with Scratch 2 or 3 on Raspberry Pi](https://learn.adafruit.com/programming-with-scratch-on-raspberry-pi.md)
- [Guardian Robot with LEDs](https://learn.adafruit.com/guardian-robot-with-leds.md)
- [PyPortal IoT Weather Station](https://learn.adafruit.com/pyportal-iot-weather-station.md)
- [Annoy-O-Matic Sound Prank Device](https://learn.adafruit.com/annoy-o-matic-sound-prank-device.md)
- [MakeCode Arcade with SAMD51 M4](https://learn.adafruit.com/makecode-arcade-with-samd51-m4.md)
- [Adafruit IO Basics: Analog Input](https://learn.adafruit.com/adafruit-io-basics-analog-input.md)
- [Make an AI Freezer Monitor](https://learn.adafruit.com/ai-freezer-monitor.md)
- [Bass MIDI Stomp Box](https://learn.adafruit.com/midi-bass-synth-stomp-box.md)
- [Feather-based Hue lighting controller](https://learn.adafruit.com/feather-hue-lighting-controller.md)
- [Infinity Mirror Valentine's Candy Box](https://learn.adafruit.com/infinity-mirror-candy-box.md)
- [Circuit Playground Express Sugar Glider](https://learn.adafruit.com/cpx-sugar-glider.md)
- [AdaBox 002](https://learn.adafruit.com/adabox002.md)
- [CircuitPython Libraries on Linux and ODROID C2](https://learn.adafruit.com/circuitpython-libaries-linux-odroid-c2.md)
- [Feather Waveform Generator in CircuitPython](https://learn.adafruit.com/waveform-generator.md)
- [CurieBot: Arduino 101 Mini Robot Rover](https://learn.adafruit.com/curiebot-arduino-101-mini-robot-rover.md)
