I am trying to write to an SD card from an atmega328 through the SPI port, on C or preferably C++. My project has been developed on C++ so I cannot use the "Arduino option" for writing on the SD card. I already have the FAT filesystem code and have been able to white to the SD card through the bitbanging mode that comes in the FatFS examples but I have been unable to modify it so it can work through the SPI port. Any ideas or suggestions about where to look?