Stufin
Home Quick Cart Profile

Raspberry Pi RP2040 IC Microcontroller Chip

Buy Now

Industrial temperature range

-40C to 85C

  • Package:

56-pin QFN package (7mm x 7mm)

  • Software Development:

Supports C, C++, and MicroPython programming languages

Compatible with Raspberry Pi's C/C++ SDK and MicroPython firmware

  • Compatibility:

Pin-compatible with Raspberry Pi Pico and other RP2040-based boards

Benefits and Applications

The Raspberry Pi RP2040 IC Microcontroller Chip is an excellent choice for various applications, including

IoT devices and gateways

Industrial automation and control systems

Robotics and autonomous systems

Wearables and portable devices

Smart home and building automation

Medical devices and equipment

The RP2040 offers a unique combination of performance, power efficiency, and features, making it an ideal choice for developers, makers, and industry professionals.

Pin Configuration

  • Raspberry Pi RP2040 IC Microcontroller Chip Pinout Documentation
  • The Raspberry Pi RP2040 IC Microcontroller Chip is a powerful and feature-rich microcontroller designed for IoT applications. It has a total of 56 pins, which provide a wide range of interfaces and functionality. Here's a detailed explanation of each pin, categorized by function:
  • Power Pins (6)
  • 1. VBUS (Pin 1): Input pin for USB bus power (5V)
  • 2. VIN (Pin 2): Input pin for external power supply (3.3V to 5.5V)
  • 3. 3V3 (Pin 3): Output pin for 3.3V power rail
  • 4. GND (Pin 4, 13, 26, 39, 52, 55): Ground pins
  • 5. VBAT (Pin 28): Input pin for battery power (1.8V to 3.3V)
  • 6. VBUS_SENSE (Pin 29): Input pin for VBUS sense (useful for battery charging)
  • Digital I/O Pins (26)
  • 1. GPIO0 (Pin 5): General-purpose digital input/output pin
  • 2. GPIO1 (Pin 6): General-purpose digital input/output pin
  • 3. GPIO2 (Pin 7): General-purpose digital input/output pin
  • 4. GPIO3 (Pin 8): General-purpose digital input/output pin
  • 5. GPIO4 (Pin 9): General-purpose digital input/output pin
  • 6. GPIO5 (Pin 10): General-purpose digital input/output pin
  • 7. GPIO6 (Pin 11): General-purpose digital input/output pin
  • 8. GPIO7 (Pin 12): General-purpose digital input/output pin
  • 9. GPIO8 (Pin 14): General-purpose digital input/output pin
  • 10. GPIO9 (Pin 15): General-purpose digital input/output pin
  • 11. GPIO10 (Pin 16): General-purpose digital input/output pin
  • 12. GPIO11 (Pin 17): General-purpose digital input/output pin
  • 13. GPIO12 (Pin 18): General-purpose digital input/output pin
  • 14. GPIO13 (Pin 19): General-purpose digital input/output pin
  • 15. GPIO14 (Pin 20): General-purpose digital input/output pin
  • 16. GPIO15 (Pin 21): General-purpose digital input/output pin
  • 17. GPIO16 (Pin 23): General-purpose digital input/output pin
  • 18. GPIO17 (Pin 24): General-purpose digital input/output pin
  • 19. GPIO18 (Pin 25): General-purpose digital input/output pin
  • 20. GPIO19 (Pin 27): General-purpose digital input/output pin
  • 21. GPIO20 (Pin 30): General-purpose digital input/output pin
  • 22. GPIO21 (Pin 31): General-purpose digital input/output pin
  • 23. GPIO22 (Pin 32): General-purpose digital input/output pin
  • 24. GPIO23 (Pin 33): General-purpose digital input/output pin
  • 25. GPIO24 (Pin 34): General-purpose digital input/output pin
  • 26. GPIO25 (Pin 35): General-purpose digital input/output pin
  • Analog Pins (4)
  • 1. ADC0 (Pin 36): Analog-to-digital converter input pin
  • 2. ADC1 (Pin 37): Analog-to-digital converter input pin
  • 3. ADC2 (Pin 38): Analog-to-digital converter input pin
  • 4. ADC3 (Pin 40): Analog-to-digital converter input pin
  • Communication Interface Pins (6)
  • 1. UART_TX (Pin 41): UART transmit pin
  • 2. UART_RX (Pin 42): UART receive pin
  • 3. SPI0_CLK (Pin 43): SPI clock pin
  • 4. SPI0_MOSI (Pin 44): SPI master out slave in pin
  • 5. SPI0_MISO (Pin 45): SPI master in slave out pin
  • 6. I2C_SCL (Pin 46): I2C clock pin
  • 7. I2C_SDA (Pin 47): I2C data pin
  • Debug Pins (2)
  • 1. SWD_CLK (Pin 48): Serial wire debug clock pin
  • 2. SWD_IO (Pin 49): Serial wire debug I/O pin
  • Reset and Boot Pins (2)
  • 1. RESET_N (Pin 50): Active-low reset pin
  • 2. BOOT_SEL (Pin 51): Boot select pin (determines boot mode)
  • Other Pins (2)
  • 1. XIN (Pin 53): External crystal oscillator input pin
  • 2. XOUT (Pin 54): External crystal oscillator output pin
  • When connecting pins, ensure you follow proper wiring and handling practices to avoid damage to the microcontroller or other components. Always refer to the datasheet and relevant documentation for specific pin usage guidelines and electrical characteristics.
  • Pin Connection Structure:
  • When connecting pins, use the following structure:
  • VCC (Power Pins): Connect to a power source (e.g., USB, battery, or external power supply)
  • GND (Ground Pins): Connect to a common ground point
  • Signal Pins (Digital I/O, Analog, Communication Interface, Debug, and Reset): Connect to corresponding peripherals, sensors, or modules, following the recommended signal routing and termination guidelines
  • Shielding: Use proper shielding and decoupling capacitors to minimize electromagnetic interference and noise
  • Remember to consult the Raspberry Pi RP2040 IC Microcontroller Chip datasheet and relevant documentation for specific pin usage, electrical characteristics, and safety guidelines before designing and building your project.

Code Examples

Raspberry Pi RP2040 IC Microcontroller Chip Documentation
Overview
The Raspberry Pi RP2040 IC Microcontroller Chip is a powerful, low-cost, and highly integrated SoC (System-on-Chip) designed for IoT applications. It features a dual-core ARM Cortex-M0+ processor, 264KB of SRAM, and 2MB of on-chip flash memory. The RP2040 is compatible with the Raspberry Pi Pico board and other supported development boards.
Key Features
Dual-core ARM Cortex-M0+ processor at up to 133MHz
 264KB of SRAM
 2MB of on-chip flash memory
 USB 1.1 host and device support
 26 GPIO pins
 2 x UART, 2 x SPI, 2 x I2C, 1 x I2S
 16-bit PWM
 Analog-to-digital converter (ADC)
 Power management unit (PMU)
Code Examples
### Example 1: Blinking an LED using C/C++ and the RP2040 SDK
This example demonstrates how to use the RP2040 to blink an LED connected to GPIO pin 25.
```c
#include <_rp2040.h>
#include <stdbool.h>
#define LED_PIN 25
int main() {
    // Initialize the RP2040
    rp2040_init();
// Set the LED pin as an output
    gpio_init(LED_PIN);
    gpio_set_dir(LED_PIN, GPIO_OUT);
while (true) {
        // Set the LED high (on)
        gpio_put(LED_PIN, 1);
        sleep_ms(500);
// Set the LED low (off)
        gpio_put(LED_PIN, 0);
        sleep_ms(500);
    }
return 0;
}
```
### Example 2: Reading Analog Sensor Data using MicroPython and the RP2040
This example demonstrates how to use the RP2040 to read analog sensor data from a potentiometer connected to ADC channel 0.
```python
import machine
import utime
# Create an ADC object for channel 0
adc = machine.ADC(0)
while True:
    # Read the analog sensor value
    value = adc.read_u16()
# Print the sensor value
    print("Analog sensor value:", value)
# Wait for 100ms before taking the next reading
    utime.sleep_ms(100)
```
Additional Resources
[Raspberry Pi RP2040 Datasheet](https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf)
 [Raspberry Pi Pico C/C++ SDK Documentation](https://raspberrypi.github.io/pico-sdk-doxygen/)
 [Raspberry Pi MicroPython Documentation](https://docs.micropython.org/en/latest/rp2/index.html)
Note: The code examples provided are for illustrative purposes only and may require modification to work with specific development boards and configurations.