adamczykpiotr/pico-mcp2515

Adding information what IO-pins to use

StefanL38 opened this issue · 4 comments

Hi Adam,

I have looked for but did not find any information about which IO-pins are used for the SPI-interface.
I am even more confused as the Pin-outs that can be found for the RP2040 pico show four sets of IO-pins that are named SPI-0.

Huh ? Now which IO-pins do I use? I guess the pico can not autodetect them.

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.print("MOSI: ");
Serial.println(MOSI);
Serial.print("MISO: ");
Serial.println(MISO);
Serial.print("SCK: ");
Serial.println(SCK);
Serial.print("SS: ");
Serial.println(SS);
}

void loop() {
// put your main code here, to run repeatedly:
}
You can use this sketch to find out in arduino ide.

Hi!
I believe there are no limitations in terms of which SPI_TX / SPI_RX pins you can use as long as they belong to the same SPI bus. So if you are using SPI0 you can use any of GP0 / GP4 / GP16 for RX and GP3 / GP7 / GP19 for TX.

Just to clarify things, TX in this context is MISO, RX = MOSI

https://www.raspberrypi.com/documentation/microcontrollers/images/pico-pinout.svg

By default i am using what RPI Foundation suggest as default (defined here), so SPI0, SCK=18, TX = 19, RX = 16, CS = 17.

It would be great if you could create a PR with updated repo or perhaps additional examples. I am currently quite time constrained in terms of my open source contributions but I'm glad to handle any PRs and help anyone creating them