Forums

Problem in reading/writing to SD card through MPC5554 using high SPI clock speed

Started by sanaas February 3, 2011
Hi everybody, 

I have interfaced a 4 GB class 4 Kingston micro SD card with MPC5554 using
SPI. I have implemented FAT32 file system driver on it.
Everything(reading/writing files) works fine when I keep SPI clock at 3 MHz
after initialization. With 3 MHz clock I am able to write 1 MB of data in a
file in 1 min which is pretty low speed!! 
But when I turn to SPI clock above 3 MHz, the SD card does not read/write
sectors at all!! All I want to do is to increase this speed of data
transfer.
Has any body done such a thing with speed higher than 3 MHz? I would be so
grateful if any body could help me in this issue as I have been trying to
solve this issue since last so many days but in vain and my FAT32 driver
would be of  no use in my application with such a low speed.

Thanks,
Sana


	   
					
---------------------------------------		
Posted through http://www.EmbeddedRelated.com
In article <KMadnZ_gpIMPMdfQnZ2dnUVZ_uidnZ2d@giganews.com>, 
sanaashaukat@n_o_s_p_a_m.hotmail.com says...
> Hi everybody, > > I have interfaced a 4 GB class 4 Kingston micro SD card with MPC5554 using > SPI. I have implemented FAT32 file system driver on it. > Everything(reading/writing files) works fine when I keep SPI clock at 3 MHz > after initialization. With 3 MHz clock I am able to write 1 MB of data in a > file in 1 min which is pretty low speed!! > But when I turn to SPI clock above 3 MHz, the SD card does not read/write > sectors at all!! All I want to do is to increase this speed of data > transfer. > Has any body done such a thing with speed higher than 3 MHz? I would be so > grateful if any body could help me in this issue as I have been trying to > solve this issue since last so many days but in vain and my FAT32 driver > would be of no use in my application with such a low speed. >
While I am no SPI expert by any means, I have used a LOT of SPI peripherals with nary a problem. I would say you need to start digging out the test equipment and look at what is REALLY going on. A scope to make sure your signals are clean and not ringing/bouncing all over the place is a good start. Does the card have decent power supply decoupling as close to the SD connector as possible? Is your SPI really working at the speeds you think? Is it operating in the mode that you think? Is the chip select signal active when it should be? All things you need to find out. So, a scope and maybe a logic analyzer would be called for and some testing is in order.
On Thu, 03 Feb 2011 07:24:34 -0600, "sanaas"
<sanaashaukat@n_o_s_p_a_m.hotmail.com> wrote:

>Hi everybody, > >I have interfaced a 4 GB class 4 Kingston micro SD card with MPC5554 using >SPI. I have implemented FAT32 file system driver on it. >Everything(reading/writing files) works fine when I keep SPI clock at 3 MHz >after initialization. With 3 MHz clock I am able to write 1 MB of data in a >file in 1 min which is pretty low speed!! >But when I turn to SPI clock above 3 MHz, the SD card does not read/write >sectors at all!! All I want to do is to increase this speed of data >transfer. >Has any body done such a thing with speed higher than 3 MHz? I would be so >grateful if any body could help me in this issue as I have been trying to >solve this issue since last so many days but in vain and my FAT32 driver >would be of no use in my application with such a low speed. > >Thanks, >Sana
IIRC you need a fair bit of buffering to get high throughput on an SD card.. even fast cards go away for significant stretches of time, like a hundred ms or more.
>On Thu, 03 Feb 2011 07:24:34 -0600, "sanaas" ><sanaashaukat@n_o_s_p_a_m.hotmail.com> wrote: > >>Hi everybody, >> >>I have interfaced a 4 GB class 4 Kingston micro SD card with MPC5554
using
>>SPI. I have implemented FAT32 file system driver on it. >>Everything(reading/writing files) works fine when I keep SPI clock at 3
MHz
>>after initialization. With 3 MHz clock I am able to write 1 MB of data in
a
>>file in 1 min which is pretty low speed!! >>But when I turn to SPI clock above 3 MHz, the SD card does not
read/write
>>sectors at all!! All I want to do is to increase this speed of data >>transfer. >>Has any body done such a thing with speed higher than 3 MHz? I would be
so
>>grateful if any body could help me in this issue as I have been trying
to
>>solve this issue since last so many days but in vain and my FAT32 driver >>would be of no use in my application with such a low speed. >>
Thanks for showing interest in solving my problem and for your suggestions. You are right that there should be buffering but people have achieved speeds in hundreds of KB/s using SD card without using any buffer.My speed is not even 50KB/s!! I do have an oscilloscope and I have observed the signals multiple times. There is no ringing effect as such and you are right that the power supply and controller should be as close as possible to SD card for high frequency operation but I am working on a card which is already designed and manufactured accordingly, so I cannot move any thing!! Well my issue is still unsolved. Although i am able to run it now at 12.5 MHz speed but first of all it does not responds in one go and secondly at this speed card responds too late when I write a sector to it so there is only a few seconds speed difference between the two. I am trying to solve the issue by observing SPI signals clk,data in and out etc. --------------------------------------- Posted through http://www.EmbeddedRelated.com