Major Micro SD Weirdness w/ Teensy3.0

Status
Not open for further replies.

Fuzzy

Active member
I am using Teensy3.0 with an adafruit LCD (https://learn.adafruit.com/adafruit-2-4-color-tft-touchscreen-breakout/bitmaps-spi-mode). Everything is working reasonably well and I am able to display BMP files. BUT. It only works the first time I insert the micro SD card. If I restart the Teensy or Power off-on. It fails.

if (!SD.begin(SD_CS)) {
Serial.println("failed!");
}

However if I eject the SD card then reinsert. Bam! It works.

Not sure how/why this is possible. Anyone have an idea for what I can do here? This thing is going to be in an enclosure so the old micro-SD-swaperoo is not gonna happen.

Thanks!
 
Is this happening with code you wrote? An example? Being that I cannot see the code I am going to conclude that there must be a mistake in the code.

Did you notice the forum rule above?
 
OK, so it is Adafruit's example. Open Arduino (which has been 'fitted' with a recent Teensyduino) and go to "File->Examples->ILI9341_T3" to find the example again but this time using a version of the library that has been optimised for Teensy 3.x

The micro SD slot on the ILI9341 display (which PJRC sell for $8.-) has problems, so, if you are using the SD slot on the display from Adafruit then please check that they (pretty much) guarantee that the SD slot on it is problem free - otherwise, please tell all about your SD slot.
 
Try adding delay(5000); at the beginning of setup().

Teensy boots up very fast. Arduino and most other have slow boot times. Sometimes hardware designed for Arduino isn't ready so quickly after powerup, but you can never notice with slow Arduino boards.
 
I also just tried with the Teensy optimized SD library paul wrote. improvement.
now it works if you power on/off.
reset on teensy results in the same issue. but i think with a hard power off-on i should be good to go.
 
Hmmm... do you have other (different brand) SD cards to try?

It's unlikely, but if this is a "strange incompatibility" SD card, I'd really like to get my hands on it. Any chance you'd be willing to swap it for a good quality SanDisk Ultra card?
 
...but if this is a "strange incompatibility" SD card, I'd really like to get my hands on it.

The ones that Micro Center sells as their own brand at the checkout desk ($3.99 for 4GB) always surprise me. I bought a bunch of 10 for my Cansat project and I had at least 3 different error modes. Some work, some don't, some do sometimes (I roughly feel a correlation with the amount of rainfall on the saturday before using them ;)). Once again I learned that there's no such thing as a free lunch...
 
Status
Not open for further replies.
Back
Top