SD card write speed improvement
Hello everyone,
I have made a system, that collects data from several microphones and sends it to PC. I am using PIC33fj128GP802 microcontroller and FT232rl serial to usb converter chip. So far, the system is capable of recording signals from 4 microphones, with a sampling rate of 15KHz for each and sending the data to PC in real-time. However, I want to back-up all the data on the SD card, so that in case of the transmission errors, I could still retrieve the data. To do that, I connected an SD card to the system via SPI. I use the driver developed by Lucio di Jasio, which is explained in detail in his book "Learning to fly the PIC24". However, when I record the data to the card, I can see discontinuities in the signal now and then. At first I used a standard low speed SD card, and assumed that the card was causing the problems, so I replaced it with SanDisk express 3. There was no improvement in the write speed. On some forums, I have seen posts stating that some guys have achieved write speed as high as 1MByte/s. So could anyone please give me any ideas on how I can improve the write speed to the SD card?
And some more questions:
1) Are there any specific requirements to formatting the SD card, like setting the specific block size? When I format the card in Windows, it doesn't allow me to set any block size except 16 kilobytes.
2) In the driver that I am using now, single block write and read commands are used for data transfers. So I am wondering if the multiple block writes would increase the write speed significantly? Has anyone got any experimental data, comparing write speeds using single and multiple block writes?
3) Could it be the mocrocontroller that is limiting the write speed? (SPI clock set to 10MHz), system clock 40MHz. For data transfers between ADC and RAM DMA is used, so the CPU isn't loaded too much.
4)I have also noticed that when I read data from file, the data rate is also limited to roughly 240Kbit/s. To test it, I played a wave file from the card via microcontroller and when I set DAC output frequency above 15K. I can hear distortion in the signal.
Looking forward to your replies, would be very grateful for any help.