ForYourHealth
New member
Hello All!!! I'm new to the Teensy 4.1 and this forum!
I wish to switch between the Teensy 4.1 on board SD slot on SPI2 (MOSI2, MISO2, SCK1, CS2), the Audio Shield on board SD slot on the first SPI (MOSI, MISO, SCK, CS) and add an external third SD card slot on SPI1 (MOSI1, MISO1, SCK1, CS1). (I'd like to use all three SD cards simultaneously, but I know that's probably too much to ask.)
I can get the first two SD card slot reading perfectly. However, I cannot get the third external SD card to be recognized on SPI1 (MOSI1, MISO1, SCK1, CS1), as it will not initialize.
For reference only, I've tried two different SD card readers linked here:
https://www.adafruit.com/product/4682
https://www.adafruit.com/product/254
Here's my simple test source code and wiring:
My gut tells me I am either missing something simple, or it's some special functionality/requirement I am completely unaware of.
Any thoughts on this and how to get this third SD slot working you be much appreciated!
Thank you in advance for any comments provided!
I wish to switch between the Teensy 4.1 on board SD slot on SPI2 (MOSI2, MISO2, SCK1, CS2), the Audio Shield on board SD slot on the first SPI (MOSI, MISO, SCK, CS) and add an external third SD card slot on SPI1 (MOSI1, MISO1, SCK1, CS1). (I'd like to use all three SD cards simultaneously, but I know that's probably too much to ask.)
I can get the first two SD card slot reading perfectly. However, I cannot get the third external SD card to be recognized on SPI1 (MOSI1, MISO1, SCK1, CS1), as it will not initialize.
For reference only, I've tried two different SD card readers linked here:
https://www.adafruit.com/product/4682
https://www.adafruit.com/product/254
Here's my simple test source code and wiring:
Code:
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#define SDCARD_CS_PIN 0 //CS1 ---> CS Pin
#define SDCARD_MISO_PIN 1 //MISO1 ---> DO Pin
#define SDCARD_MOSI_PIN 26 //MOSI1 ---> DI Pin
#define SDCARD_SCK_PIN 27 //SCK1 ---> CLK Pin
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
SPI.setMOSI(SDCARD_MOSI_PIN);
SPI.setSCK(SDCARD_SCK_PIN);
if (!(SD.begin(SDCARD_CS_PIN))) {
while (1) {
Serial.println("Unable to access the SD card!");
delay(2000);
}
}
Serial.println("Successfully access the SD card!");
}
void loop() {
// put your main code here, to run repeatedly:
}
My gut tells me I am either missing something simple, or it's some special functionality/requirement I am completely unaware of.
Any thoughts on this and how to get this third SD slot working you be much appreciated!
Thank you in advance for any comments provided!
Last edited: