Compiling an SD/MMC and fat16 library

For an outside was no time, but tested inside. Now the data looks quite good. Saving the offset seams to work now. So the hole thing is still quite dirty, but it seems to work so far.
I take a 1G Kingston card. Data write section starts at offset 4096. The first 4 bytes on the card are for saving the actual offset.
At power on it checks the offset on the card, so it should be cleared on a fresh card or when you want to write from beginning. If it finds offset data, writing starts from there.
(On the PC i read it with HxD http://www.mh-nexus.de thats a raw reader i found for free.
You can read the data with it and clear the card if you want. Useful for test anyway.)
Then the arduino fills the write buffer with 128 bytes, the length of the serial buffer, i thought that may increase speed. Tried that with 512 bytes, i read in the sd card data sheet that this is always that bulk it writes. But that didn´t wanted to work. Went back to 128, no problem. After fill it writes the data on the card, writes the new offset and flushes the cache. Without flushing i had sometimes no data on the card.

After an 1hour test run i converted the data with GPS Babel http://www.gpsbabel.org/ to kml and checked with g**gle earth. For the test run i was on USB.
For the 3.3V i added a low drop regulator a LF33CV. I simply connected it to 5V and ground on my shield, the out pin directly to the Vin of the card. Before i had added an elco to 3.3 and ground at the card, so there was no need for an additional one. The first proposed condensator i saw no need for, cause of the stabilized 5V, but that may not be correct, but works. With my Velleman personal scope voltage looks fine without ripples, ups and downs. The Velleman may not be the best, but it´s very useful for me. Mostly better than a multimeter.

Ok, the code: Binary sketch size: 5348 bytes (of a 14336 byte maximum)
in the next post...