0

So I am trying to connect and then launch the SD card reader to Raspberry Pico using SPI1 and not the default pico one because the default one is taken by a LoRa module.

I am using the arduino core.

  SPI1.setRX(12); // 16 12
  SPI1.setTX(15); // 20 15
  SPI1.setSCK(14); // 19 14
  SPI1.setCS(13); // 17 13

I figured out this the way to define my SPI1 pins, but I still have no clue how to launch the SD card library on SPI1 and not the default SPI0.

I know that the defining code is right because I tested the SD card module on alternative SPI0 pins and it worked. I also asked the wise man that created the core how to do it and that's what he replied:

"There are 2 SPI port, SPI and SPI1. You can use the 2nd port, SPI1 at the same time as SPI. I don't think it's safe from the SPI protocol to change pins between transactions (glitches/etc. might upset the devices)."

But I still have no clue on how to run a SPI device on SPI1.

0andriy
  • 4,183
  • 1
  • 24
  • 37

1 Answers1

0

you can use SD.begin(SD_SPI1_CSn, SPI1); after setting the SPI pins

starball
  • 20,030
  • 7
  • 43
  • 238