# SPI library for RP2350

**URL:** <https://forum.arduino.cc/t/spi-library-for-rp2350/1366548>\
**Category:** Programming\
**Created:** [March 23, 2025, 6:38pm UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548 "2025-03-23T18:38:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![isa\_gmz](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isa_gmz/32/1105336_2.png) [@isa\_gmz](https://forum.arduino.cc/u/isa_gmz)\
**Post date:** [March 23, 2025, 6:38pm UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548/1 "2025-03-23T18:38:41Z")

</div>

Hi all,

I am pretty new to implementing SPI communication but I seem to have the code working on an Arduino UNO - yay! However, my project requires me to use a Raspberry Pi PICO 2350 as the microcontroller. I have downloaded the appropriate board manager from [Earlephilhower](https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json) and selected Raspberry Pi Pico for the board. I verified that I am able to see the serial monitor and upload code to the Pico with a simple print statement - yay! Next, the problem comes when trying to reconfigure the hardware to the appropriate pins on the PICO so that they match defaults in the built-in SPI library. I can't seem to get any data from my code when connected to the default SPI pins of the RP Pico (Pins 21, 22, 24 & 25). Is there a way to explicitly define these pins in the code?

I used this code to try to get the defaults:  
CODE:

```arduino
  Serial.print("Default SPI0 MOSI: ");                   
  Serial.println(PIN_SPI0_MOSI);
  Serial.print("Default SPI0 MISO: "); 
  Serial.println(PIN_SPI0_MISO);
  Serial.print("Default SPI0 SCK: "); 
  Serial.println(PIN_SPI0_SCK);

```

OUTPUT:  
Default SPI0 MOSI: 23  
Default SPI0 MISO: 20  
Default SPI0 SCK: 22

This doesn't make sense to me since pin 23 on the RP Pico is ground. Any guidance would be super helpful. Thanks! 🙂

TLDR: What are the default pin numbers on RP Pico 2350 to use with SPI library?

---

<div class="post-metadata">

**Author:** ![MrY](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mry/32/624544_2.png) [@MrY](https://forum.arduino.cc/u/MrY)\
**Post date:** [March 23, 2025, 6:50pm UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548/2 "2025-03-23T18:50:36Z")

</div>

Are you using a Raspberry PI Pico 2? If so, you need to select that as your board in the IDE.

The SPI pins are defined as:

```arduino
// SPI
#define PIN_SPI0_MISO (16u)
#define PIN_SPI0_MOSI (19u)
#define PIN_SPI0_SCK (18u)
#define PIN_SPI0_SS (17u)

#define PIN_SPI1_MISO (12u)
#define PIN_SPI1_MOSI (15u)
#define PIN_SPI1_SCK (14u)
#define PIN_SPI1_SS (13u)

```

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [March 23, 2025, 8:30pm UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548/4 "2025-03-23T20:30:47Z")

</div>

> [@isa\_gmz](#):
>
> RP Pico 2350

[https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html)

Has nice pinout diagrams

---

<div class="post-metadata">

**Author:** ![isa\_gmz](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/isa_gmz/32/1105336_2.png) [@isa\_gmz](https://forum.arduino.cc/u/isa_gmz)\
**Post date:** [March 24, 2025, 4:05am UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548/5 "2025-03-24T04:05:20Z")

</div>

> [@MrY](#):
>
> ```arduino
> #define PIN_SPI0_MISO (16u)
> #define PIN_SPI0_MOSI (19u)
> #define PIN_SPI0_SCK (18u)
> #define PIN_SPI0_SS (17u)
> 
> ```

This worked! Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 20, 2025, 4:06am UTC](https://forum.arduino.cc/t/spi-library-for-rp2350/1366548/6 "2025-09-20T04:06:15Z")

</div>

Closed on September 20, 2025, 4:06am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
