SD card in "raw" mode

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

SD card in "raw" mode

Postby kscharf » Tue May 22, 2012 12:51 pm

I'd like to use an SD card as a simple (large) eeprom chip. Can I use the basic init, erase, readblock and writeblock functions to store data in absolute block locations on an SD card (sorta kinda seting up my own file system actually)? Sure this will destroy the FAT format on the card (but it can always be reformated on a PC). My application would need to store firmware and setup data for a serial connected slave processor and I would store this on the SD card. Replacement firmware would be sent via a separate serial link to my app which would write it on the card. I'd pick absolute block numbers as to where I'd store the firmware and setup data. I wouldn't need the extra code to support the FAT file system (save flash space for my app). Sure there are advantages to using the fat file system, but the SD card would never be removed from my device (unless it fails) so it would only be used as a large serial eeprom. I was thinking of this because the 2.2" LCD display I'm using already has the SD card socket on it. Otherwise I'd use an (smaller) I2C or SPI 8 pin eeprom.
User avatar
kscharf
 
Posts: 136
Joined: Wed Sep 10, 2008 9:29 am

Re: SD card in "raw" mode

Postby pburgess » Tue May 22, 2012 2:10 pm

Darn, wish I could find the relevant link (I think it was somewhere on hackaday.com), but yes, this is totally doable...I think it was a PIC-based audio player, if that might help in Googling it out.
User avatar
pburgess
 
Posts: 1331
Joined: Sun Oct 26, 2008 1:29 am

Re: SD card in "raw" mode

Postby pburgess » Tue May 22, 2012 2:39 pm

Also, duh, I completely failed to mention doing raw SD block reads & writes when I was testing the CRC16 addition to the SD library. So yes, it's entirely absolutely possible with the library, and yes, will nuke any filesystem on the card.

Still recovering from Maker Faire, mental function not yet at 100%. :)
User avatar
pburgess
 
Posts: 1331
Joined: Sun Oct 26, 2008 1:29 am

Re: SD card in "raw" mode

Postby kscharf » Tue May 22, 2012 4:40 pm

pburgess wrote:So yes, it's entirely absolutely possible with the library, and yes, will nuke any filesystem on the card.

That sounds good. If I only use the raw read/write functions I can probbly leave out alot of code including the fat library functions. I don't care if I nuke the filesystem so long as it's possible to reformat the card on a card reader plugged into a PC running Linux or Windows. The only problem I see is finding a small micro SD card since for my needs even a 512K card would be way overkill. Certainly DON'T need an SDHC type!
User avatar
kscharf
 
Posts: 136
Joined: Wed Sep 10, 2008 9:29 am

Re: SD card in "raw" mode

Postby stephanschulz » Tue Jan 08, 2013 3:43 pm

i was hoping to us a SD card as eeprom replacement too.

do you have an example of how to use the raw read/write function?

I am planning to have a very long counter (290 million) and will use gray code to minimize the amount of bits that are being flipped every time the new counter value is written to the storage.

in fact i was planning to use balanced gray code to make sure all bits are being worn out equally.
then after flipping each bit about 100k times i am planning to move on to the next 32 bits.

does that sound possible; i.e. specify which n-bits to write to?

thx,
stephan
stephanschulz
 
Posts: 1
Joined: Tue Jan 08, 2013 3:35 pm


Return to Arduino Shields from Adafruit

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [100]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]