Teensy 4.1 to use SPI instead of SDIO for on-board SD card

WMXZ

Well-known member
I can easily access the on-board SD card of T4.1 using standard sdio.
Now I wanted to test it using the SPI interface (I guess SPI2)
However, the following code
Code:
Serial.println(SPI2.pinIsChipSelect(46));
      Serial.println(SPI2.pinIsMISO(43));
      Serial.println(SPI2.pinIsMOSI(45));
      Serial.println(SPI2.pinIsSCK(44));
return only zeros (fails)

Is there anything else I should do, or am I completely off?
 
Last edited:
I could be completely wrong (it has happened before :D )
My quick look a long time ago, the SPI2 pins don't align with the SDIO ones...
1742230512739.png

And if you look at an Adafruit adapter that supports both SDIO and SPI:
1742230613693.png

It sort of implies that: SD(CLK) and SPI(CLK) should be the same pin.
But the SD_B0_01 pin is the CLK for SDIO and a CS pin for SPI2...
 
So, there seems to be no way to use the on-board SD disk with SPI.
Why I'm interested in using a slower SPI, is that with SPI and CS I can deactivate the SD disk between writes by simply putting SPI into shared mode, which significantly reduces the consumption. Not sure if that can be done with SDIO.
Unfortunately a T4.0 lacks the 16 MB PSRAM, that is my data buffer.
 
Back
Top