Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Teensy 3.2 Having Problems with MicroSD

  1. #1
    Junior Member
    Join Date
    Aug 2018

    Teensy 3.2 Having Problems with MicroSD


    I've been doing a few tests with this TFT display from Adafruit: and have been running into problems with initializing and loading files from the included microSD slot.

    It seems to happen at random. Sometimes, I can load an image to the screen fine with only a few lost pixels. Other times, the image is partially corrupted when it loads or can't be found at all. And other times still, the SD card itself fails to initialize. The only thing I'm doing between each attempt is plugging and unplugging the USB.

    I know it's a Teensy problem because I wired it up on an Arduino Uno and the microSD + display have been working flawlessly. I suspect it has something to do with how fast the Teensy is compared to the Arduino, but I don't know enough to be able to fully pinpoint the problem myself.

    I've attached the script I've been running to this post. The SD card I'm using is a SanDisk microSDHC formatted FAT32. I've tried everything from decreasing the buffer size to adding a delay both in this script and in the SD library to give it more time to boot up to switching libraries from SD to SdFat and so far nothing has worked. Any insight or suggestions would be appreciated!
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Nov 2015
    Cold hollow VT
    There have been problems reported in the past that were solved by putting a 10K pull-up on the CS lines to hold them inactive (not floating) when the Teensy started to execute its setup(). Aparently some SD cards were getting confused during initialization of other devices. There have also been reports here of TFT displays not properly tri-stating their MISO lines when another device was attempting to use the SPI bus. Use Google to do a search of this forum for similar problems. I would recomend trying the resistors and setting all CS lines HIGH asap in your program, then proceding to initializing the TFT and SD card. You may also want to ask this question in the ADAFRUIT forum and relay their answer back here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts