Sd card file transferring using 8bit Vs 32bit processing?

josephchrzempiec:
The project I'm researching on will be a Hid device Storage.

Via USB, it would be easy to use if the board can emulate a "Mass Storage Device class" (like a pendrive). A "Human Interface Device class" is usually a one-way communcation, since most of such devices are inputs only (like a mouse). The only exceptions may be keyboards (light indicators for caps and num lock) and joystick controllers (the vibration feature).

The Arduino boards normally gets identified as a serial UART port emulator; although you can still interact with the inserted SD card this way, but you'll need to find/write a specialized program for that.
You may consider ditch out USB for file transfers directly to your Arduino, because I don't see it can emulate a mass storage device, and because serial ports aren't fast enough for that purpose (115200 bps with 8N1 frames transfers data at 10 KB/s).

On the other hand, Ethernet/Wi-Fi is actually the way to go in this case, making the SD card access the only bottleneck. Arduino as a NAS you'll probably have to stick to a TFTP or FTP server; other protocols like the used by Windows (SMB, not iSCSI) might be a headache and too much for an Arduino anyway.

The only thing left is about the SD card acces. Without using its native SDIO protocol, you may not go far away with the speed; remember that you have to stick to the "legacy protocol" (which is SPI) for compatibility with the Arduino.

To give you a frame of reference, an Arduino Nano (same thing as the Uno in this example) topped up to approx. 53 KB/s in writting speed, according to a test I've made long ago under these conditions:

  • SPI bus not shared.
  • SPI at "full speed" (8 MHz clock).
  • Timer0 overflow interrupt enabled (for millis()).
  • Using the IDE's SD library (SdFat ended up being slower for some reason).
  • No extra overhead except the usual "for loop" procedures.
  • File was created from zero.
  • File grew up to 4 MB by writting 512 bytes at a time.

Then I performed a read test in that file, and I think it resulted in something around 70 KB/s.

This behavior is normal in flash memories: reading is faster than writting.

Now with a microcontroller where the SPI's clock signal can reach 20 MHz, I will expect more than double (but less than triple) the speeds of our frame of reference (in theory).
But if the Ethernet/Wi-Fi has to share the same SPI bus, effective data rate gets cut in half (unless somehow module and SD card can talk directly to each other); and it further decreases with the overhead inside your own code.

In a nutshell: you can use an Arduino as a SD card reader or NAS, but at most expect speeds of USB 1.0.