This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am using microSd(SDHC) for data storage. I a using MSP430BT5190 MCU for communication. Initially everything works fine. For every second i have to write 2048 bytes data to the sd card. I am making data into four 512 blocks and writing to the sd card. I am not using any file systems. I am writing data directly to the sectors also also maintaining one reserved sector for house keeping variables. For each block write or read i am providing 60ms time gap.
My problem is:
After few hours sd card is not able to write the data. CMD24 always responding with 0xFF. I will keep trying for every 60ms. After 10 attempts i will re-boot the device(Software reset). After reset sd card never initialize until i remove the battery and keep it back.
Also i need few clarification
What is the time gap between two successive writes or read? (Using 8GB class 4 microSD)
Is there any command to Format the sd card?
some times single read block is giving the junk data. second or third attempt it will works fine. why? (using DMA)
Note: While sd card initialization SPI clock speed is 1mhz and after initialization i am increasing the SPI clock speed to 20mhz.
Please give me some advice..
Have you tried different SD cards,we did have quite different responses from idfferent manufacturers, so maybe that could be an issue.
Also did you try to use a lower frequency for your SPI-clock, I would try with 1 MHz all the time, additionally did you scope your SPI clock, 20MHz could be pretty advanced for some PCB layouts, dont know in your case.
Also you could , as a workaround, reinitialise your SDcard after each write, or after certain times.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to seb:
In reply to Rajesh T:
I tried your workaround suggestions it didn't worked giving same issue. I tried reducing the clock speed it worked fine at 1MHz and 2MHz. When i try more than 2MHz sd card started hanging after few hours. Slowing down the clock speed doesn't help me because each block writing is taking 10ms. so, i am missing two ads samples for every 500ms. Any more suggestions.
sounds like signal integrity problem, cause the more speed your SPI has the more it looks like a triangle rather than a square wave, and so maybe your SD card simply doesnt understand it. You should watch it with a scope, look how your real signals look like, also important how long the signal lines are, stray capacitances ans impedance matters, the higher the signal speed gets, and so on.
Could of course be something simpler :) in the analog world only testing helps.
In reply to Ilmars:
Rajesh and I are working together on this project.
Following are the details you asked for.
Length of the signals
CLK = 19.01mm
MOSI = 22.03mm
MISO = 24.99mm
CS = 22.21mm
CLK-MOSI at 2MHz
CLK-MISO - at 2MHz
Let us know if anymore checks to be done.
In reply to Arun Kumar27:
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.