Testing Teensy 4.0 and SD card module with SPI to store data on sd card

Status
Not open for further replies.

ArGooN

New member
I would like to test whether my SD card module can be used with the SPI ports on the Teensy 4.0. Is there an example script I can use to test this? I am new to teensy boards and fairly new to programming so I am sorry for being a noob in this. Also are the SPI pins that I would use CS=10, MOSI=11, MISO=12 and SCK=13? I would like to use the arduino IDE with the teensyduino porgram.
 
The simple answer is probably... Obviously may depend on which SD card module you are using. That is it should work

Here is one I have just setup...
IMG_1254.jpg
And ran the list files on current beta code....

Note: You may have to be careful depending on which SD reader. If it has builtin TTL level converters and always ups the signals to +5v, it is an issue for T4 as it is NOT +5v tolerant on IO pins.
This Sparkfun has a level converter, but I have the VCC going to the 3.3v pin so not a problem
 
The simple answer is probably... Obviously may depend on which SD card module you are using. That is it should work

Note: You may have to be careful depending on which SD reader. If it has builtin TTL level converters and always ups the signals to +5v, it is an issue for T4 as it is NOT +5v tolerant on IO pins.
This Sparkfun has a level converter, but I have the VCC going to the 3.3v pin so not a problem
Note that standard SD/micro-SD cards use 3.3v to the card itself (and if you go to UHS-I mode, you need to drop the voltage to 1.8 volts, and 0.4 volts for UHS-II mode).

The last time I was looking at SD/micro-SD card readers, they either accepted 3.3-5v range (with built-in level shifters) or only 3.3v. But there may still be 5v only readers out there that were designed in the era of 5v AVR processors (like the Arduino UNO) that internally use a level shifter to get 3.3v.


I would like to test whether my SD card module can be used with the SPI ports on the Teensy 4.0. Is there an example script I can use to test this? I am new to teensy boards and fairly new to programming so I am sorry for being a noob in this. Also are the SPI pins that I would use CS=10, MOSI=11, MISO=12 and SCK=13? I would like to use the arduino IDE with the teensyduino porgram.
For the first (main) SPI bus, yes you want MOSI=11, MISO=12, and SCK=13. CS can typically be any digital pin. There are some SPI drivers that use hardware tweaks that work better with CS=10, but I don't think the SD card drives are one of those (mostly it is the Teensy optimized libraries for displays).

If you go into Files -> Examples -> SD there are a few tests for SD cards. Check the example code for what CS pin it uses (it likely will use CS=10).

Note, in the Teensy 1.54 beta releases, they are changing the internals of the file system handling (moving from SD to SdFat). You probably want to stick with the 1.53 release for now, to simplify your testing.

With 1.53, the default SD card support can only support VFAT file systems (SD, SD-HC) and not exFAT file systems (SD-XC). This means you need to use a 32GB card or smaller (SD-HC limit is 32GB). When 1.54 comes out, you should be able to use SD-XC cards as well (33GB - 2TB).

I don't know if the even larger SD-UC (> 2TB) cards will be supported. At the moment, I do not see any SD-UC cards for sale at Amazon or B&H photo.
 
Last edited:
Status
Not open for further replies.
Back
Top