6.9. Pin assignments

<p>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.</p> <p>The &#8220;RP2040 functions&#8221; column lists the most relevant RP2040 peripheral functions. The peripheral functions commonly used by our example code are shown in <b>bold</b>. For a complete list of these functions, see the &#8220;GPIO functions&#8221; section of the <a href="https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf">RP2040 datasheet</a>.</p> <p>The &#8220;3pi+ 2040 functions&#8221; column documents the electronics that the pin is connected to on an unmodified 3pi+.</p> <p>The &#8220;3pi+ header&#8221; column says which of the expansion headers, if any, include the pin. The locations of these headers are shown in <a href="/docs/0J86/6.8">Section 6.8</a>.</p> <style type="text/css"> table.pin_assignment_new { margin-bottom: 1em; border-collapse: collapse; } table.pin_assignment_new td { border: 1px solid #aaa; padding: 0.3em; margin: 0em; text-align: left; font-family: Arial,sans-serif; font-size: 90%; } table.pin_assignment_new th { border: 1px solid #aaa; font-family: Arial,sans-serif; font-size: 90%; padding-left: 3px; padding-right: 3px } table.pin_assignment_new tr:nth-child(2n+1) { background-color: #eee; } tr.new_section { border-top: 5px solid #aaa} tr.funcsel td:nth-child(n+2):nth-child(-n+6) {border-left: none; border-right: none; color: rgba(0, 0, 0, 0.6);} tr.funcsel td:nth-child(n+2):nth-child(-n+5) {padding-right: 1em;} tr.funcsel strong {color: black;} </style> <table class="pin_assignment_new"> <tr> <th>Pin</th> <th colspan="5">RP2040 functions</th> <th>3pi+ 2040 functions</th> <th>3pi+ header</th> </tr> <tr class="new_section funcsel"> <td>GP0</td> <td>SPI0 RX</td> <td>UART0 TX</td> <td>I2C0 SDA</td> <td>PWM0 A</td> <td></td> <td>Button C<br>Display data/command select (D/<span class="overline">C</span>)</td> <td>Display</td> </tr> <tr class="funcsel"> <td>GP1</td> <td>SPI0 CSn</td> <td>UART0 RX</td> <td>I2C0 SCL</td> <td>PWM0 B</td> <td></td> <td>Display reset (<span class="overline">RESET</span>)</td> <td>Display</td> </tr> <tr class="funcsel"> <td>GP2</td> <td><strong>SPI0 SCK</strong></td> <td>UART0 CTS</td> <td>I2C1 SDA</td> <td>PWM1 A</td> <td></td> <td>Display clock (SCK)</td> <td>Display</td> </tr> <tr class="funcsel"> <td>GP3</td> <td><strong>SPI0 TX</strong></td> <td>UART0 RTS</td> <td>I2C1 SCL</td> <td>PWM1 B</td> <td></td> <td>Display data (MOSI),<br>RGB LED data</td> <td>Display,<br>RGB (indirect)</td> </tr> <tr class="funcsel"> <td>GP4</td> <td>SPI0 RX</td> <td>UART1 TX</td> <td><strong>I2C0 SDA</strong></td> <td>PWM2 A</td> <td></td> <td>Inertial sensors SDA</td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP5</td> <td>SPI0 CSn</td> <td>UART1 RX</td> <td><strong>I2C0 SCL</strong></td> <td>PWM2 B</td> <td></td> <td>Inertial sensors SCL</td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP6</td> <td><strong>SPI0 SCK</strong></td> <td>UART1 CTS</td> <td>I2C1 SDA</td> <td>PWM3 A</td> <td></td> <td>RGB LED clock</td> <td>Mid expansion,<br>RGB (indirect)</td> </tr> <tr class="funcsel"> <td>GP7</td> <td>SPI0 TX</td> <td>UART1 RTS</td> <td>I2C1 SCL</td> <td><strong>PWM3 B</strong></td> <td></td> <td>Buzzer PWM</td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP8</td> <td>SPI1 RX</td> <td>UART1 TX</td> <td>I2C0 SDA</td> <td>PWM4 A</td> <td></td> <td>Right encoder A</td> <td></td> </tr> <tr class="funcsel"> <td>GP9</td> <td>SPI1 CSn</td> <td>UART1 RX</td> <td>I2C0 SCL</td> <td>PWM4 B</td> <td></td> <td>Right encoder B</td> <td></td> </tr> <tr class="funcsel"> <td>GP10</td> <td>SPI1 SCK</td> <td>UART1 CTS</td> <td>I2C1 SDA</td> <td>PWM5 A</td> <td></td> <td>Right motor direction</td> <td></td> </tr> <tr class="funcsel"> <td>GP11</td> <td>SPI1 TX</td> <td>UART1 RTS</td> <td>I2C1 SCL</td> <td>PWM5 B</td> <td></td> <td>Left motor direction</td> <td></td> </tr> <tr class="funcsel"> <td>GP12</td> <td>SPI1 RX</td> <td>UART0 TX</td> <td>I2C0 SDA</td> <td>PWM6 A</td> <td></td> <td>Left encoder A</td> <td></td> </tr> <tr class="funcsel"> <td>GP13</td> <td>SPI1 CSn</td> <td>UART0 RX</td> <td>I2C0 SCL</td> <td>PWM6 B</td> <td></td> <td>Left encoder B</td> <td></td> </tr> <tr class="funcsel"> <td>GP14</td> <td>SPI1 SCK</td> <td>UART0 CTS</td> <td>I2C1 SDA</td> <td><strong>PWM7 A</strong></td> <td></td> <td>Right motor PWM</td> <td></td> </tr> <tr class="funcsel"> <td>GP15</td> <td>SPI1 TX</td> <td>UART0 RTS</td> <td>I2C1 SCL</td> <td><strong>PWM7 B</strong></td> <td></td> <td>Left motor PWM</td> <td></td> </tr> <tr class="funcsel"> <td>GP16</td> <td>SPI0 RX</td> <td>UART0 TX</td> <td>I2C0 SDA</td> <td>PWM0 A</td> <td></td> <td>Right bump sensor (BR)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP17</td> <td>SPI0 CSn</td> <td>UART0 RX</td> <td>I2C0 SCL</td> <td>PWM0 B</td> <td></td> <td>Left bump sensor (BL)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP18</td> <td>SPI0 SCK</td> <td>UART0 CTS</td> <td>I2C1 SDA</td> <td>PWM1 A</td> <td></td> <td>Line sensor 5 (DN5, rightmost)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP19</td> <td>SPI0 TX</td> <td>UART0 RTS</td> <td>I2C1 SCL</td> <td>PWM1 B</td> <td></td> <td>Line sensor 4 (DN4)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP20</td> <td>SPI0 RX</td> <td>UART1 TX</td> <td>I2C0 SDA</td> <td>PWM2 A</td> <td></td> <td>Line sensor 3 (DN3)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP21</td> <td>SPI0 CSn</td> <td>UART1 RX</td> <td>I2C0 SCL</td> <td>PWM2 B</td> <td></td> <td>Line sensor 2 (DN2)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP22</td> <td>SPI0 SCK</td> <td>UART1 CTS</td> <td>I2C1 SDA</td> <td>PWM3 A</td> <td></td> <td>Line sensor 1 (DN1, leftmost)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP23</td> <td>SPI0 TX</td> <td>UART1 RTS</td> <td>I2C1 SCL</td> <td>PWM3 B</td> <td></td> <td>Bump sensor emitter control (BE)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP24</td> <td>SPI1 RX</td> <td>UART1 TX</td> <td>I2C0 SDA</td> <td>PWM4 A</td> <td></td> <td></td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP25</td> <td>SPI1 CSn</td> <td>UART1 RX</td> <td>I2C0 SCL</td> <td><strong>PWM4 B</strong></td> <td></td> <td>Yellow LED / Button A</td> <td></td> </tr> <tr class="funcsel"> <td>GP26</td> <td>SPI1 SCK</td> <td>UART1 CTS</td> <td>I2C1 SDA</td> <td>PWM5 A</td> <td><strong>ADC0</strong></td> <td>Battery level input (VBAT/11),<br>Line sensor emitter control (DNE)</td> <td>Front expansion</td> </tr> <tr class="funcsel"> <td>GP27</td> <td>SPI1 TX</td> <td>UART1 RTS</td> <td>I2C1 SCL</td> <td>PWM5 B</td> <td>ADC1</td> <td></td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP28</td> <td>SPI1 RX</td> <td>UART0 TX</td> <td>I2C0 SDA</td> <td>PWM6 A</td> <td>ADC2</td> <td></td> <td>Mid expansion</td> </tr> <tr class="funcsel"> <td>GP29</td> <td>SPI1 CSn</td> <td>UART0 RX</td> <td>I2C0 SCL</td> <td>PWM6 B</td> <td>ADC3</td> <td></td> <td>Mid expansion</td> </tr> <tr class="new_section"> <td>QSPI_SS_N</td> <td colspan="5">Flash chip select, BOOTSEL</td> <td>Button B</td> <td></td> </tr> <tr> <td>RUN</td> <td colspan="5">Active-low reset</td> <td>Reset button</td> <td>Debug header</td> </tr> <tr> <td>SWCLK</td> <td colspan="5">Serial Wire Debug (SWD): clock</td> <td></td> <td>Debug header</td> </tr> <tr> <td>SWDIO</td> <td colspan="5">Serial Wire Debug (SWD): data I/O</td> <td></td> <td>Debug header</td> </tr> </table> <div class="clear">

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
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors