Communicating with SDcard via I2C

There have been lots of projects like I2SD. Some use serial some I2C. Most, like I2SD use a 328 connected to the SD and communicate higher level file commands to the Arduino.

I2CSD just uses SD.h on the 328 board. Its API has a message to open a file, read bytes from a file, write bytes to a file, and seek to some position.

Lot of users have done the same thing with SdFat or SD.h and a second Arduino.

The I2SD code is here so you could buy something like a Pro Mini and a micro SD module and make your own. The code is very simple.

I2C on Arduino is very limited, the buffer in Wire is 32 bytes so I2SD has warnings like this:

Long reads happen most efficiently if the reads occur in blocks of size
I2C_BUFFER_LEN - 1: 31. If not, a seek is preformed to realign the SD
file back to what will be expected. This results in a loss of efficiency
for two reasons:

  1. a seek uses the bus
  2. data is always sent from I2SD_Slave in 32 byte chunks.
    (save one byte for I2SD_READ_MSG: 32 = 1 + 31)