Simple SPI communication example for Raspberry Pi Pico using Arduino Framework

Hello,

I am trying to use my Raspberry Pi Pico as a slave SPI device.

How can I use the Arduino framework to assign the pins I will be using? For example I have hooked up physical pins 21, 22, 24, and 25 (RX, SCn, SCK, TX).

I am unsure of how to perform the setup. I simply want to write a single value to a register.

Can anyone point me in the right direction?

This is a duplicate of Change Pi Pico Serial and I2C Pins and use both I2C Ports - #4 by maxgerhardt.

1 Like

It is! Thanks! Will try this solution proposed here Change Pi Pico Serial and I2C Pins and use both I2C Ports - #4 by maxgerhardt

But what if you need to work with existing libraries? You can’t tell them to use your own SPI object over whatever the default is

In the Arduino-Pico core, the pins for the default SPI objects are reassignable per docs. With ArduinoCore-mbed, you’re out of luck. Easier to adapt the library to accept a SPI*.