I have an ATtiny85 which I can successfully program with my Arduino, however, I wish to connect an SD Shield to my ATtiny85 to read and write data, there are enough pins but I am unsure on how to re-map them to the ATtiny85 pins.
The write function has some restrictions listed below:
Cannot create file. Only existing file can be written.
Cannot expand file size.
Write operation must start/stop on the sector boundary.
File write operation must be done in following sequence.
pf_lseek(ofs); read/write pointer must be moved to sector boundary prior to initiate write operation or it will be rounded-down to the sector boundary.
pf_write(buff, btw, &bw); Initiate write operation. Write first data to the file.
pf_write(buff, btw, &bw); Write next data. Any other file function cannot be used while a write operation is in progress.
pf_write(0, 0, &bw); Finalize the write operation. If read/write pointer is not on the sector boundary, left bytes in the sector will be filled with zero.
The read/write pointer in the file system object increases in number of bytes written. After the function succeeded, *BytesWritten should be checked to detect end of file. In case of *BytesWritten < ByteToWrite, it means the read/write pointer reached end of file during the write operation. Once a write operation is initiated, it must be finalized or the written data can be lost.
Write always has severe restrictions for small memory since you can't create or extend files without a 512 byte buffer.
You can rewrite selected portions of an existing file assuming each write starts on a 512 byte boundary and the write record will be filled to the next 512 byte boundary, usually with zeros.
Write always has severe restrictions for small memory
Thanks for the information
I was looking at the Petit Fat documentation for writing files.
As far as I can see it is not easy to do as you also point out
Anyway, I think it's impressive to see my little ATtiny85 sit and read a big file.
I am sure that a read only solution can be useful in various projects with tiny's