SDCard Component Speed | Cypress Semiconductor
SDCard Component Speed
I've used this component for a project in which I'm working on but I need to be able to write to the SD Card about 40 bytes in less than 2.5 ms.
Using a 512MB class 2 card and what it seems to be 48Mhz of SPI clock (I Commented the part in the library where it changes the speed programatically and I've tested that when I decrease the speed of the SPI Clock the transmission speed decreases). when I look at the clock speed using an oversampling of 6 in the SPI I get 8Mhz and then if I change the oversampling to 3 (The minimun it lets me use) I still get 8Mhz.
Anyway, I can "write" the 40 bytes in about 0.31ms but of course this just saves them in a buffer. Adn then when I fill the 512 bytes, the library physically writes the SD Card and it takes between 5.5 and 6.5 ms to do that and of couser that is more than the 2.5ms that I'm allowed to use so I loos samples.
So is there anyway to increase the writting speed? I guess that making a buffer would work for the SD but since I have to send the same that over bluetooth and it is shown in real time in the computer, making a buffer would mean a non fluid reception or a delay in the display of the data so I would like to avoid that.
Also, would changing the SD card for a better class one would have any improvement in the speed?
Since this info my be useful for someone else, I will attach an Image of the delays. In channel 4 I toggle a pin everytime I write 40bytes and in Channel 5 you can see the SPI clock. In the top right side of the image you have the delays of writting the 512byte to the SD and the time it takes to the PSoC 4 @ 48Mhz to write the 40bytes to the SD library's buffer.
Thank you in advance.