Teensy 4.1 - Two SD cards possible?

Status
Not open for further replies.

peterwilson

New member
Hi, I'm experimenting with a 4.1 for use in a logging application and am successfully using the SD library to write to the inbuilt SD card.

Ideally, I would have a second SD card and write to both cards more or less simultaneously to improve reliability. Access speed is not critical.

Is there a way to achieve this?

Thanks in advance for any advice anyone can give on this.
 
Simple answer is yes: Only one SDIO one, but you can have one or more external SD card adapters using SPI, where each one has it's own SPI CS pin. Some of the tests we have been playing with on MTP, I have some of the tests
configured to use the SD on the T4.1/3.6... and the one off of an Audio Adapter, but could just as be any other external sd with using I believe pin 10 as the chip select pin. Or any other pin that is just what the define value I have set
 
Awesome. I didn't realize I could use SPI. I think I can take it from here - I see lots of data on this out there.
Thanks very much for your very helpful reply.
 
Make sure you're using the latest software, or at least version 1.54. Older versions have the ancient Arduino SD library which can't possibly use more than 1 card. Newer versions use SdFat, where SD is a thin wrapper for SdFat.

A similar question came up a week ago. Maybe this thread can help?

https://forum.pjrc.com/threads/6925...)-Not-Initializing-on-Teensy-4-1-Audio-Shield

I updated the SdFat_Usage example to show how to use SPI1. It's newer than version 1.56, so get the updated example on github if you need to initialize a different SPI port.

https://github.com/PaulStoffregen/S...15d2/examples/SdFat_Usage/SdFat_Usage.ino#L54

https://github.com/PaulStoffregen/SD/blob/Juse_Use_SdFat/examples/SdFat_Usage/SdFat_Usage.ino
 
Status
Not open for further replies.
Back
Top