Raspberry Pi Foundation is well known for its series of single-board computers (Raspberry Pi series). But in January 2021 they launched their first micro-controller class product know as Raspberry Pi Pico. It is built around the RP2040 Soc, a very fast but yet cost-effective microcontroller chip packed with a dual-core ARM Cortex-M0+ processor. M0+ is one of the most power-efficient ARM processors.
Raspberry Pi Pico is a small, fast, and versatile board that at its heart consists of RP2040, a brand-new product launched by Raspberry Foundation in the UK. It can be programmed using MicroPython or C language.
RP2040 Microcontroller: Heart of Raspberry pi Pico
- RP2040 is a custom-designed processor chip by the Raspberry Pi foundation itself.
- It is a powerful but cost-effective processor, featuring a dual-core Arm Cortex-M0+ processor running at 133Mhz.
- Has 264KB of internal RAM and support for up to 16MB of onboard flash memory.
- A wide range of flexible I/O operations is possible including I2C, SPI, and Programmable general purpose I/O (GPIO).
Why R-Pi foundation named the microcontroller RP2040?
The name of the RP2040 microcontroller is made up of 5 sections:
- RP in RP2040 means ‘Raspberry Pi’.
- 2 signifies the number of processor cores the microcontroller has i.e, 2 cores.
- 0 represents the type of processor core the RP2040 microcontroller has. This processor is called ARM Cortex-M0+ processor. Other microcontrollers of this series by ARM are named as Cortex-M1, Cortex-M3, Cortex-M4, Cortex-M7 etc.
- 4 means the microcontroller has has 264 kilobytes (kB) of RAM. Which is based on a special mathematical function: floor(log2(RAM/16)).
- 0 simply means there is no non-volatile storage on‑board.
NOTE: To download the datasheet of the RP2040 Microcontroller, click here.
Specifications of R-PI Pico:
- Dual-core Arm Cortex M0+ processor running at 133 MHz
- Board comes with 264KB of SRAM, and 2MB of onboard Flash memory
- Comes with the castellated module that allows us to solder it directly to carrier boards
- USB 1.1 with device and host support
- Low-power sleep and dormant modes
- Drag-and-drop programming using mass storage over USB
- 26 × multi-function GPIO pins
- 2 × SPI peripherals, 2 × I2C controllers, 2 × UART peripherals, 3 × 12-bit ADC, 16 × controllable PWM channels
- Accurate clock and timer on-chip
- Temperature sensor
- Accelerated floating-point libraries on-chip
- It features 8 Programmable I/O (PIO) state machines for custom peripheral support
Raspberry pi PICO Pinout:
- The Raspberry Pi Pico comes with a total of 40 pins including GND and Vcc pins. The pin can be categorized as Power, ground, UART, GPIO, PWM, ADC, SPI, I2C, system control, and Debugging pins.
- Unlike the raspberry pi computer board series, GPIO pins present on the Pico board have multiple functions.
- For example, GP4 and GP5 pins can be either used as digital input or digital output or I2C1 (SDA and SCK pins) or UART1 (Rx and Tx). But only one function can be enabled at a time.
GPIO Pins on Raspberry Pi Pico
In Raspberry Pi Pico, out of 40 pins, 26 pins are multi-functional GPIO pins. These 26 GPIO pins can be used both as digital input and digital output. These digital pins are marked from GP0, GP1, and up to GP22. The marked GP23, GP24, and GP25 are not they are exposed on the pinout these GPIO pins are used for internal board functions:
GPIO29: IP Used in ADC mode (ADC3) to measure VSYS/3
GPIO25: OP Connected to user LED
GPIO24: IP VBUS sense – high if VBUS is present, else low
GPIO23: OP Controls the on-board SMPS Power Save pin
ADC or Analog to Digital Converter Pins
The board comes with four 12-bit SAR based analog to digital converters. Hence, we can use these pins to read analog inputs from various sensors. But one out of these four pins(ADC 4) is not provided as a GPIO pin on the board. This fourth ADC pin is internally connected to a temperature sensor.
NOTE: Therefore, to measure the temperature we can directly use this build-in temperature by reading the analog value of ADC4.
ADC Pin GPIO Pins
I2C Pins on Raspberry Pi Pico
I2C is a two-wire, bi-directional serial bus that provides an easy and quick method for transmission of transmission over a short distance between I2C enabled devices. The Raspberry Pi Pico comes with two I2C controllers, both I2C controllers are accessible through GPIO pins of Raspberry Pi Pico.
|I2C Controller||GPIO Pins|
SPI Pins on Raspberry Pi Pico
Serial Peripheral Interface (SPI) is an interface bus that is used to transfer data between the microcontroller and SPI-enabled devices. Raspberry Pi Pico supports two SPI interfaces that are accessible through GPIO pins of the board.
|SPI Controller||GPIO Pins|
UART Pins on Pico
The Raspberry Pi Pico also contains two identical UART peripherals. UART (universal asynchronous receiver-transmitter) pins are used for asynchronous serial communication between the micro-controller and UART devices or other microcontrollers.
|UART Pins||GPIO Pins|
PWM Pins on R-Pi Pico
Image source: www.RaspberryPi.org
- The Raspberry Pi Pico has 8 PWM blocks/slices(1-8) and each PWM block provides up to two PWM outputs(A-B). This means each block can drive up to two PWM outputs.
- Hence, there is a total of 16 PWM output channels available at a time and every GPIO pin on the pico is capable of generating PWM output.
- So all GPIO pins can be configured to get PWM signal output when required but two GPIO pins with the same PWM designation cannot be used at once.
NOTE: The above paragraph may seem confusing, but don’t worry: all it means is that you must keep track of the PWM output signal and block you’re using, making sure not to use two GPIO pins having the same number and letter designation together.
GPIO Interrupts on Pico
All GPIO pins on the board can be configured as an external interrupt if one of the following changes in the state of GPIO pins occur:
- Level high(+3v)
- Level Low(GND)
- Positive edge (transition from active low to active high)
- Negative edge (transition from active high to active low)
Other Pins on Pico board:-
GND: is the Ground pin used to complete the circuit.
VBUS: is the micro-USB input voltage it is connected to micro-USB port pin 1.
VSYS: is the main system input voltage, which can vary in the allowed range 1.8V to 5.5V, and is used by the on-board
SMPS: to generate the 3.3V for the board and its GPIO.
3V3_EN: connects to the onboard SMPS enable pin, and is set to high (to VSYS) connected through a 100K resistor. To disable the 3.3V(which also de-powers the RP2040), short this pin low.
3V3: is the main 3.3V supply to the board and its I/O, generated by the on-board SMPS. This pin can also be used to power external components.
ADC_VREF: is the ADC pin power supply voltage, and is generated by filtering the 3.3V supply coming through the board.
AGND: is the ground reference for GPIO26-29, there is a separate analog ground plane running under these signals and terminating at this pin. If the ADC pins are not used or ADC performance is doesn’t matter, this pin can be connected to digital ground.
RUN: is the RP2040 enable pin, and has an internal (on-chip) pull-up resistor to 3.3V of about ~50K Ohms. To resetRP2040, short this pin low.
Read Similar Articles: