6.9. Pin assignments

The table below lists each general-purpose I/O pin on the RP2040 and what it is connected to on the 3pi+ 2040. This table is helpful if you want to add your own electronics to the 3pi+ 2040 or write your own low-level code for interfacing with the hardware.

The “RP2040 functions” column lists the most relevant RP2040 peripheral functions. The peripheral functions commonly used by our example code are shown in bold. For a complete list of these functions, see the “GPIO functions” section of the RP2040 datasheet.

The “3pi+ 2040 functions” column documents the electronics that the pin is connected to on an unmodified 3pi+.

The “3pi+ header” column says which of the expansion headers, if any, include the pin. The locations of these headers are shown in Section 6.8.

Pin RP2040 functions 3pi+ 2040 functions 3pi+ header
GP0 SPI0 RX UART0 TX I2C0 SDA PWM0 A Button C
Display data/command select (D/C)
Display
GP1 SPI0 CSn UART0 RX I2C0 SCL PWM0 B Display reset (RESET) Display
GP2 SPI0 SCK UART0 CTS I2C1 SDA PWM1 A Display clock (SCK) Display
GP3 SPI0 TX UART0 RTS I2C1 SCL PWM1 B Display data (MOSI),
RGB LED data
Display,
RGB (indirect)
GP4 SPI0 RX UART1 TX I2C0 SDA PWM2 A Inertial sensors SDA Mid expansion
GP5 SPI0 CSn UART1 RX I2C0 SCL PWM2 B Inertial sensors SCL Mid expansion
GP6 SPI0 SCK UART1 CTS I2C1 SDA PWM3 A RGB LED clock Mid expansion,
RGB (indirect)
GP7 SPI0 TX UART1 RTS I2C1 SCL PWM3 B Buzzer PWM Mid expansion
GP8 SPI1 RX UART1 TX I2C0 SDA PWM4 A Right encoder A
GP9 SPI1 CSn UART1 RX I2C0 SCL PWM4 B Right encoder B
GP10 SPI1 SCK UART1 CTS I2C1 SDA PWM5 A Right motor direction
GP11 SPI1 TX UART1 RTS I2C1 SCL PWM5 B Left motor direction
GP12 SPI1 RX UART0 TX I2C0 SDA PWM6 A Left encoder A
GP13 SPI1 CSn UART0 RX I2C0 SCL PWM6 B Left encoder B
GP14 SPI1 SCK UART0 CTS I2C1 SDA PWM7 A Right motor PWM
GP15 SPI1 TX UART0 RTS I2C1 SCL PWM7 B Left motor PWM
GP16 SPI0 RX UART0 TX I2C0 SDA PWM0 A Right bump sensor (BR) Front expansion
GP17 SPI0 CSn UART0 RX I2C0 SCL PWM0 B Left bump sensor (BL) Front expansion
GP18 SPI0 SCK UART0 CTS I2C1 SDA PWM1 A Line sensor 5 (DN5, rightmost) Front expansion
GP19 SPI0 TX UART0 RTS I2C1 SCL PWM1 B Line sensor 4 (DN4) Front expansion
GP20 SPI0 RX UART1 TX I2C0 SDA PWM2 A Line sensor 3 (DN3) Front expansion
GP21 SPI0 CSn UART1 RX I2C0 SCL PWM2 B Line sensor 2 (DN2) Front expansion
GP22 SPI0 SCK UART1 CTS I2C1 SDA PWM3 A Line sensor 1 (DN1, leftmost) Front expansion
GP23 SPI0 TX UART1 RTS I2C1 SCL PWM3 B Bump sensor emitter control (BE) Front expansion
GP24 SPI1 RX UART1 TX I2C0 SDA PWM4 A Mid expansion
GP25 SPI1 CSn UART1 RX I2C0 SCL PWM4 B Yellow LED / Button A
GP26 SPI1 SCK UART1 CTS I2C1 SDA PWM5 A ADC0 Battery level input (VBAT/11),
Line sensor emitter control (DNE)
Front expansion
GP27 SPI1 TX UART1 RTS I2C1 SCL PWM5 B ADC1 Mid expansion
GP28 SPI1 RX UART0 TX I2C0 SDA PWM6 A ADC2 Mid expansion
GP29 SPI1 CSn UART0 RX I2C0 SCL PWM6 B ADC3 Mid expansion
QSPI_SS_N Flash chip select, BOOTSEL Button B
RUN Active-low reset Reset button Debug header
SWCLK Serial Wire Debug (SWD): clock Debug header
SWDIO Serial Wire Debug (SWD): data I/O Debug header

Related Products

3pi+ 2040 Robot - Standard Edition (30:1 MP Motors), Assembled
3pi+ 2040 Robot - Turtle Edition (75:1 LP Motors), Assembled
3pi+ 2040 Robot - Hyper Edition (15:1 HPCB Motors), Assembled
3pi+ 2040 Robot Kit with 30:1 MP Motors (Standard Edition Kit)
3pi+ 2040 Robot Kit with 75:1 LP Motors (Turtle Edition Kit)
3pi+ 2040 Robot Kit with 15:1 HPCB Motors (Hyper Edition Kit)
3pi+ 2040 Control Board
Pololu Robotics & Electronics
Shopping cart
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors