ZTiK.nl
Well-known member
Hello everybody,
I had some problems connecting/using the MicroSD adapter from PJRC with my Teensy 3.0 so I decided to make a small guide about it.
First off, I am new to all this, so any corrections/tips/criticism is welcome
The very first thing to do is solder the 3V pads on the bottom of the MicroSD adapter.
This is because Teensy 3 = 3.3v, while other/older Teensy's are 5v.
The MicroSD adapter can work at both voltages, all that is required is to connect 2 pads together to set it to 3.3v:
Here is my attempt (my first soldering ever!):
After this has been done, you can start connecting the adapter to the Teensy.
At this point I ran into some trouble until I found a post by pixelk explaining it quite well, thanks pixelk !
Connections on the MicroSD adapter:
+5V goes to 3.3V (100 mA max)
Ground goes to GND
MOSI goes to pin 11, DOUT
MISO goes to pin 12, DIN
SCLK goes to pin 13, SCK
SS goes to pin 10, CS
MicroSD wired up to Teensy:
+5V goes to 3.3V (red wire)
Ground goes to GND (black wire)
MOSI goes to pin 11 (blue wire)
MISO goes to pin 12 (green wire)
SCLK goes to pin 13 (white wire)
SS goes to pin 10 (yellow wire)
Additional warning, with thanks to LarryP:
When you connect the MicroSD adapter to the Teensy, take into account which direction the MicroSD card holder is facing!
Take another look at the image above to make sure
Once you have done this, you should be able to run the cardinfo example.
Dont forget to set your Teensy to Serial and to set the ChipSelect variable in cardinfo example to 10 instead of 4.
To test all this I bought a spanking new MicroSD card, but I kept getting errors during initializing SD card.
After a lot of checking code and rechecking my connections, I 'obtained' a MicroSD card from my mothers HTC mobile phone, and suddenly the cardinfo example started working automagically.
In case you run into trouble during init phase, try another card, it seems not all are created equal.
For what it is worth, the first MicroSD I used was a 2GB non-HC by Icidu, the one that did work was a Kingston SDHC 8gb.
Additional tip with thanks to linuxgeek:
If you are able to read but not write (or experience any similar issues), try to format the SD card using the SdFat SdFormatter example.
This should be enough for this firstpost, in the next one I'll post a few benchmarks and how I improved read/write speed with a factor 10x !
I had some problems connecting/using the MicroSD adapter from PJRC with my Teensy 3.0 so I decided to make a small guide about it.
First off, I am new to all this, so any corrections/tips/criticism is welcome
The very first thing to do is solder the 3V pads on the bottom of the MicroSD adapter.
This is because Teensy 3 = 3.3v, while other/older Teensy's are 5v.
The MicroSD adapter can work at both voltages, all that is required is to connect 2 pads together to set it to 3.3v:
Here is my attempt (my first soldering ever!):
After this has been done, you can start connecting the adapter to the Teensy.
At this point I ran into some trouble until I found a post by pixelk explaining it quite well, thanks pixelk !
Connections on the MicroSD adapter:
+5V goes to 3.3V (100 mA max)
Ground goes to GND
MOSI goes to pin 11, DOUT
MISO goes to pin 12, DIN
SCLK goes to pin 13, SCK
SS goes to pin 10, CS
MicroSD wired up to Teensy:
+5V goes to 3.3V (red wire)
Ground goes to GND (black wire)
MOSI goes to pin 11 (blue wire)
MISO goes to pin 12 (green wire)
SCLK goes to pin 13 (white wire)
SS goes to pin 10 (yellow wire)
Additional warning, with thanks to LarryP:
When you connect the MicroSD adapter to the Teensy, take into account which direction the MicroSD card holder is facing!
Take another look at the image above to make sure
Once you have done this, you should be able to run the cardinfo example.
Dont forget to set your Teensy to Serial and to set the ChipSelect variable in cardinfo example to 10 instead of 4.
Code:
Initializing SD card...Wiring is correct and a card is present.
Card type: SDHC
Volume type is FAT32
Volume size (bytes): 3519021056
Volume size (Kbytes): 3436544
Volume size (Mbytes): 3356
Files found on the card (name, date and size in bytes):
BENCH.DAT 2000-01-01 01:00:00 5000000
To test all this I bought a spanking new MicroSD card, but I kept getting errors during initializing SD card.
After a lot of checking code and rechecking my connections, I 'obtained' a MicroSD card from my mothers HTC mobile phone, and suddenly the cardinfo example started working automagically.
In case you run into trouble during init phase, try another card, it seems not all are created equal.
For what it is worth, the first MicroSD I used was a 2GB non-HC by Icidu, the one that did work was a Kingston SDHC 8gb.
Additional tip with thanks to linuxgeek:
If you are able to read but not write (or experience any similar issues), try to format the SD card using the SdFat SdFormatter example.
This should be enough for this firstpost, in the next one I'll post a few benchmarks and how I improved read/write speed with a factor 10x !
Last edited: