Reference

Last revision 2026/01/18

Library

Communication Protocol Description

UART Communication

In Arduino development environment, Beetle RP2040 defines 3 groups of UART communication interfaces: UART0, UART1, UART2. USB-to-serial port is defined as UART0, which does not conflict with UART1 and UART2.

NO. UART Functions Other Functions
GP4 Serial2 / RX SDA0
GP5 Serial2 / TX SCL0
GP28 Serial1 / TX A2
GP29 Serial1 / RX A3
USB Serial

The following is the definition of the UART interface in "pins_arduino.h" file:

#define PIN_SERIAL1_TX (28u)
#define PIN_SERIAL1_RX (29u)

#define PIN_SERIAL2_TX (4u)
#define PIN_SERIAL2_RX (5u)

I2C Communication

The Beetle RP2040 provides two groups of I2C communication interfaces: I2C0 and I2C1. The pinouts are as follows:

NO. I2C Function Other Functions
GP2 I2C1/SDA SPI0/SCK
GP3 I2C1/SCL SPI0/MOSI
GP4 I2C0/SDA0 RX2
GP5 I2C0/SCL0 TX2

The default I2C interface is I2C0 in Arduino because I2C1 overlaps with some pins of SPI while I2C0 is only multiplexed with the seldom-used UART1.

SPI Communication

Beetle RP2040 supports full-duplex SPI communication. The pinouts are as follows:

No. SPI Function Other Functions
GP0 SPI0/MISO
GP1 SPI0/CSn
GP2 SPI0/SCK SDA1
GP3 SPI0/MOSI SCL1

Other Supplementary Information

Was this article helpful?

TOP