I2C SD Card Interface

David Johnson-Davies' SD card storage module runs on an ATtiny1614, saves IO with I2C.

Jeremy Cook
2 years ago

SD cards, or more often than not, microSD cards, are fantastic for storing various types of data in microcontroller projects. Up until now, using them required an SPI interface, meaning tying up four data lines, plus power and ground. Given David Johnson-Davies' penchant for using microcontrollers with limited IO, it would be convenient to be able to utilize I2C, which ties up only two IO pins.

After finding no I2C interface code available, Johnson-Davies took matters into his own hands and created the required interface, which runs on an ATtiny1614 microcontroller. His circuit design employs an Adafruit microSD card breakout to handle the actual card interface, which. In addition to being easy to breadboard, it features a logic-level shifter, which allows it to work with either 3.3V or 5V as needed.

The SD card breakout pipes data to an ATtiny1614 for translation. Components are installed on a mini breadboard, and the ATtiny1614 has its own SOIC-14 breakout for for attachment. A bicolor red and green LED is also implemented to provide visual feedback for usage and errors.

The device has been tested with an Arduino Uno, and would presumably work with any other I2C capable device as well. The post goes over how it works in some detail, and also notes that while the essential read/write functionality is present, there are still improvements that could be made. If you’d like to use it yourself, and/or perhaps even make a few improvements, code is available via the project writeup linked above or on GitHub.

Jeremy Cook
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles