PIO vs RMT: Custom Protocol Peripherals
The RP2040's PIO (Programmable I/O) state machines and ESP32's RMT (Remote Control Transceiver) peripheral both allow hardware-timed GPIO signals without CPU involvement ā but they are architecturally very different.
PIO is a general-purpose parallel state machine with its own 32-instruction RISC instruction set. You can implement any protocol from scratch: push/pull operations between PIO FIFO and CPU, conditional branching, bit manipulation. It is Turing-complete within its instruction space. You can run 8 independent protocols simultaneously.
RMT is purpose-designed for IR remote control timing ā it generates pulses from a table of durations. It works well for WS2812 LEDs and IR transmitters, but is not programmable like PIO. ESP32 also has the I2S peripheral which is commonly repurposed for WS2812/SK6812 LED protocols.
Memory Architecture: SRAM Banks vs Heap Fragmentation
The RP2040's 264 KB SRAM is divided into 6 independent 32-bit wide banks. The two Cortex-M0+ cores and DMA controllers can access different banks simultaneously without stalling. This eliminates the bus contention that degrades dual-core performance on chips with shared single-port RAM.
The ESP32's 520 KB SRAM is larger total, but parts of it have access restrictions ā DRAM (data) and IRAM (instruction) are separate. The 8 KB RTC SRAM survives deep sleep. In practice, the ESP32's WiFi stack alone reserves ~60ā100 KB of heap, leaving ~400 KB for application code. String operations and JSON parsing in Arduino WiFi projects frequently cause heap fragmentation, leading to mysterious crashes after hours of runtime.
Wireless & Power: The Decisive Trade-off
This is where the comparison tips decisively. The standard Pico has zero wireless connectivity. The Pico W adds WiFi/BT but at a power cost: the CYW43439 adds ~100 mA peak current during WiFi TX, similar to ESP32. The Pico W's DORMANT deep sleep is ~0.8 mA ā much worse than ESP32's 10 µA.
For battery-powered IoT sensorsthat sleep for 60 seconds and wake to send a reading: ESP32 wins decisively. 10 µA sleep for 58 seconds + 200 mA for 2 seconds (WiFi TX + receive) = ~17 µAh per cycle. At that rate, a 1000 mAh battery lasts ~59,000 cycles (~40 days with 1-minute wakeup). Pico W's 800 µA sleep would consume 773 µAh in 58 seconds alone ā reducing battery life to ~3 days.
Decision Guide
ā Choose Raspberry Pi Pico when:
- Custom serial protocol generation (PIO)
- Native USB HID/MIDI/CDC device
- Audio generation or DVI/VGA video output
- No wireless required (wired-only project)
- MicroPython with PIO programming
- Tightest possible timing determinism
ā Choose ESP32 when:
- WiFi or Bluetooth required
- Multiple analog inputs needed (5+ channels)
- Ultra-low-power battery sensor (µA sleep)
- Large ecosystem: MQTT, HTTP, TLS, OTA
- Higher drive current GPIO needed
- ESP-IDF or Arduino ESP32 framework preferred
Frequently Asked Questions
Why does Pico have better USB than most ESP32 dev boards?
The RP2040 has a native USB 1.1 Full Speed (12 Mbps) controller built into the chip. It can present itself as a USB HID device (keyboard, mouse, gamepad), CDC serial port, MIDI interface, or Mass Storage device ā all in firmware, with no extra chip. Most ESP32 dev boards (WROOM-based) use a CH340 or CP2102 USB-to-UART bridge chip, which is only a serial port to the host computer. The ESP32-S2 and S3 do have native USB, but the classic ESP32 does not.
Can I replace ESP32 with Pico W for a WiFi project?
Technically yes, but there are trade-offs. The Pico W's CYW43439 WiFi chip communicates with the RP2040 over SPI ā Infineon's driver on the Pico W is not as mature as ESP-IDF or Arduino WiFi for ESP32. TCP/IP stack (lwIP) is available, but HTTPS, MQTT, and OTA update libraries are less battle-tested on Pico W than on ESP32 with its 10-year ecosystem.
Which is better for MicroPython: Pico or ESP32?
Both run MicroPython well. The Pico's official MicroPython port is maintained by Raspberry Pi Ltd and is exceptionally stable. ESP32's MicroPython is also mature with better WiFi/BLE support. Pico MicroPython uniquely exposes the PIO state machines via the rp2 module ā a feature with no equivalent on any other MicroPython platform.
Is RP2040 faster than ESP32?
The ESP32's Xtensa LX6 at 240 MHz is faster clock-for-clock for floating point (both lack FPU on standard variants, but ESP32-S3 has one). For integer-heavy code, the ESP32 at 240 MHz vs RP2040 at 133 MHz gives roughly 1.8Ć more raw throughput. However, the RP2040 can be overclocked to ~250ā300 MHz (unofficial) and its 264 KB of low-latency SRAM in 6 independent banks gives better memory bandwidth for DSP-style algorithms.
Verdict
These are complementary chips, not direct substitutes. If your project needs wireless, ESP32 is the engineering default ā its ecosystem, deep sleep current, and 18-channel ADC make it the most versatile sub-$5 IoT chip available. If your project involves custom digital protocols, native USB device functionality, or audio/video generation, RP2040's PIO state machines are genuinely unique and justify the choice. For a broader comparison that includes the Arduino Uno, see our 3-way MCU shootout.