Teensy 3 MicroSD guide

Status
Not open for further replies.
Thanks. Yep, it can be used any way one would use any of the many SD breakout boards available (as long as it is used with 3.3v signals).
 
I can't verify this, but in a separate thread it was said to be the Hirose DM3D-SF (the same one you've linked to).
 
Last edited:
If you use a 2-row pin header cut to size...

IMG_4234.jpg

...and slightly bend the top pins inwards....

IMG_4233.jpg

...you have a super-simple breadboard friendly SD adaptor that allows easy card insertion/removal.
 
I am using the cardinfo program but I get this error:

Sd2Card.cpp:77:2: error: #error "MK20DX128 bus frequency must be 48 or 24 MHz"

What do I need to change here to get rid of it?
 
Hello Paul,
Adafruit 2.8" TLT & microSD pins to Teensy 3.1 - see sketch bellow;
- is 3,3V needed ? and where to connect RST to Teensy
2,8TLT&Teensy31.png
Thanks,
mike
 
Paul, can answer better than I can!

The Reset Pin on the T3.1 is on the bottom of the board, with a small pad, that you can solder a wire to and then connect it to the Reset circuit. However warning, that pad is fragile and I have had the wire I soldered on the T3.1 pull the pad off on a couple of occasions. Alternatively there are spring loaded pins (pongo ?) that you can get that solder into the board and use spring pressure pushing up to make contact. I have not personally tried them yet. Not sure how much clearance these need on the top and bottom of the board to work.

Good Luck.
 
On Arduino, the reset button has something of a dual personality. It can be used to put the Arduino into programming mode, or to reboot the board to your application, after a delay when the programming mode gives up.

On Teensy, the programming mode doesn't time out. So you really need to decide what the purpose of the RST signal really is. Or you could design a jumper or switch onto your board, if you can't decide, or wish to change your mind later.
 
Hello,
I don't think my question was clear enough and therefore the answers are kind of confusing..
Let me put the question this way:
1) On Arduino Touch Shield 2.8" touch screen shield there is a microSD card socket installed and connected to the same pins (Pin 11, 12, 13) as the TFT (correct ??).

In addition to this pins (11,12,13) ->> which TFT pins I need to wire-up to Teensy3.1 to get the SD card running?

2) After studying the schematics from TFT 2.8" Touch ShielD I see that my above PCB wire up to Teensy3.1 is completly wrong becouse ICSP /SPI on TFT 2.8" I do not need to use because I have pins (Pin 11, 12, 13) already ready to use for SD but I need some additional
--->> which ones would be needed to connect in addition to Teensy3.1??

Thanks,
Mike
 
Mike, which display are you using? I see "Adafruit 2.8" TLT & microSD" in msg #58 and "Arduino Touch Shield 2.8" touch screen shield" in msg #61. You mentioned the schematic too.

Can you please post a link to the exact product you really have, and a direct link to its schematic. I can take a look and try to give you some specific advice. Direct links to the correct technical info would really help me to try to help you.
 
First, thanks Ztik for making the guide.

Now my problem. I'm trying to use a microSD card (Samsung 16GB Evo SDHC) to record data from an MPU9250 from Invensense via Teensy 3.1. I've got everything wired up correctly, as far as I can tell and I've done about 10 times now, and I'm using the CardInfo example from Arduino. However, as I watch the serial monitor, it keeps saying that it can't find the microSD card. I've tried another card as well, no dice. I've contemplated using some of the clever ideas here in this thread utilizing microSD to SD adapters but the one that I have I need to read the data on my laptop from the microSD. Is there a way to tell if the Teensy adapter is faulty?

Thanks
 
Hello Paul,
I am using 2.8TFT Touch Shield Arduino Resistive Touch ID: 1651 with micro SD.
I have made a PinOut as per EagleCad from your web and MIRRORED the 2.8 as it is installed on my carrier PC board for Teensy3.1
Adafruit2.8TLT_v2.png 2,8TLT&Teensy31.png

Pls refer as well to;
https://forum.pjrc.com/threads/2571...-for-Arduino-for-Teensy-3-1?p=69925#post69925 see #36& #37

Here the overall picture in real life;
TFT+PCB.jpg

I hope this will work now - I will need some support with the code for microSD and data-logging!!

Thanks,
Mike
 
OK. it works.
I connected the microUSB adapter hack to OctoWS2811 + Teensy 3.1 + VideoSDcard.ino

Wiring:
* The SD CS leg goes to OctoWS811 pin 4 (and not to 10, as the original example, which is good too, but for teensy only)
* Followed the instructions at
https://github.com/PaulStoffregen/OctoWS2811/blob/master/examples/VideoSDcard/hardware.jpg
by
disconnecting teensy pin 3 and pin 4 from octows2811, and
attaching teensy pin 3 to octows2811 pin 4 and
octows8211 pin 4 to SD CS.

I had another problem with the program which used to hang on memcpy.
I am using width 145 and height 24.
To workaround this memory issue, I marked out the audio lines from the program, and it released some more memory, and now the program works with no issue.
 
I am having a problem increasing the buffer size for my microSD implementation.

When I use a 1022byte buffer, everything works fine:

Code:
Use a freshly formatted SD for best performance.

Type any character to start
Free RAM: 58235
Type is FAT32
Card size: 31.91 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL32G
Version: 8.0
Serial number: 0X8D4E026
Manufacturing date: 6/2014

File size 1 MB
Buffer size 1022 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
324.31,130960,1268,3144

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
1177.29,4108,424,866
1182.86,899,424,863
1182.86,900,424,863
1182.86,900,424,863
1182.86,900,423,863

but when I increase it to 1024, I get read errors (0x3, 0x7, sometimes 0x1, 0x3)

Code:
Use a freshly formatted SD for best performance.

Type any character to start
Free RAM: 58235
Type is FAT32
Card size: 31.91 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL32G
Version: 8.0
Serial number: 0X8D4E026
Manufacturing date: 6/2014

File size 1 MB
Buffer size 1024 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
426.92,132825,1544,2394

Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
error: read failed
SD errorCode: 0X3,0X7

I am using a Sandisk Ultra 32Gb HC card. Is this a problem with my card? I only have one to test right now. I just ordered a samsung Evo to see if that helps my situation...
 
Hope it is oké to reuse this threat for a question.

I have a couple of Teensy 3.1 boards for a GPS logging project I started.
On my breadboard I just used a DX/Banggood microSD adapters and before that just a soldered SD adapter.
With my portable prototype I choose to use more PJRC and EU sourced parts.

And now the trouble starts...
The microSD cards I used on my breadboard didn't function in the PJRC sd-slot, after some searching I found this threat.
Is there a simple way to get my other sd-card brands to work with the PJRC adapter or am I bounded to the Sandisk cards? (confirmed working)
Or do I need to switch to the China sourced no-name sd-slot adapters?

The small increase in investment when using the PJRC is not the issue, it's the loss of flexibility as it is quite possible my final design will ship across the globe.
I can't guarantee that they will sell THAT sd-card in the country where I ship the unit to...
 
First up, is this the SD card socket with level converters? The Teensy3 runs at 3.3 volts natively so works fine connected directly to the SD card, where the SD adaptor boards level convert to 5V for the Teensy 1/2 and Uno.

Otherwise most likely issue with SD cards is either incorrect formatting prior to using them or trying to use cards that are too large. I think there can also be issues using the latest high speed cards that try and run an internal clock as well. So you and your customers are not restricted to Sandisk, but are restricted to older(or at least cheaper spec) and smaller cards.

See https://github.com/greiman/SdFat
and
http://www.arduino.cc/en/Reference/SDCardNotes
 
It is the latest available for the Teensy 3 : http://floris.cc/shop/en/teensy/992-micro-sd-card-adaptor.html

Funny thing is that the cards that don't work are "old" Sandisk Premier TF 2GB and unbranded class-4 4GB models.
Used them for XenServer in the past, so I formatted the old cards with the SdFat library to make sure/test they would function. (Formats correctly in the breadboard setup)
Bought a new Transcend class-10/HC-1 16GB card yesterday to try something else, same issue... (Formats correctly in the breadboard setup)

Card that is working is a SanDisk Ultra HC-1 16GB that I received months ago and normally use for my RPI-2
 
Ok, that one has a level converter on it so look like you have a couple of cards that can tolerate the out of spec voltages while the others can't. If you want you can covert that one by jumpering the level converter IC or keep it for another project and plan on using a straight card socket for your current design.
 
3.3V is not the issue. However, the current source may or may not have the oomph to make it happen. Running a TFT and a SD card off a Teensy power supply is unlikely to have a happy ending.

For that reason, I always use a external voltage regulator and a series of capacitors (0.1 and 10uF) for a SD card power supply. I am also a big fan of the Yamaichi PTH micro-SD card holder. The only (AFAIK) through-hole micro-SD card holder available (PJS0008).
 
I've seen uSD read mode power consumption of about 20-30mA and write mode 60-100mA. Sleep mode < 1mA. Indeed, uSD can be power hungry for a 100mA source with other loads too.
 
Status
Not open for further replies.
Back
Top