I have built a mp3 player that uses a micro SD card for the storage media.
The sd card is connected to the Teensy 4.0, audio adapter and a TFT display, ILI9488.
I have included 2 files: MP3PLAYER1.ino and MP3PLAYER1.h
Most of the time the SD card is recognized and everything works as expected.
Once in a while the program hangs up trying to initialize the SD card.
The code is in the ino file at the end of the file.
I used this code:
if (!(SD.begin(SDCARD_CS_PIN)))
{
tft.println("No SD card"); (Hangs up here)
while(1);
}
LINE2
tft.println("initialization done.");
It hangs up displaying "No SD Card"
Here is the real problem.
Once this occurs, I can remove power and reapply power and the problem still exists.
I can leave power off for 1 minute or 10 days and the card is not recognized.
To clear the issue, I have to remove the SD card from the socket and then reinsert it and reapply power and everything is good for awhile (undetermined time).
I've measured the pins on the card holder when power is removed and there is no stray voltage.
The SD card does not appear to have been modified.
I turn the unit on and off the same way every time - there is an ON/OFF switch that switches the battery power.
I purchased the sd card adapter from Adafruit -
Thank You
Forest
The sd card is connected to the Teensy 4.0, audio adapter and a TFT display, ILI9488.
I have included 2 files: MP3PLAYER1.ino and MP3PLAYER1.h
Most of the time the SD card is recognized and everything works as expected.
Once in a while the program hangs up trying to initialize the SD card.
The code is in the ino file at the end of the file.
I used this code:
if (!(SD.begin(SDCARD_CS_PIN)))
{
tft.println("No SD card"); (Hangs up here)
while(1);
}
LINE2
tft.println("initialization done.");
It hangs up displaying "No SD Card"
Here is the real problem.
Once this occurs, I can remove power and reapply power and the problem still exists.
I can leave power off for 1 minute or 10 days and the card is not recognized.
To clear the issue, I have to remove the SD card from the socket and then reinsert it and reapply power and everything is good for awhile (undetermined time).
I've measured the pins on the card holder when power is removed and there is no stray voltage.
The SD card does not appear to have been modified.
I turn the unit on and off the same way every time - there is an ON/OFF switch that switches the battery power.
I purchased the sd card adapter from Adafruit -
Adafruit Micro SD SPI or SDIO Card Breakout Board - 3V ONLY!
Any guidance on this issue would be very helpful - I have run out of ideas.Thank You
Forest