OK, So here it is "SDplay.pbas" !
I have moved the core code into sd.lib
Functions currently included are:
BB_PUT <index> - Helper routine to pack 512 bytes into 128 longs; needed as COG limit is 496 longs without LMM!
Assumes you have a serial terminal connected at 57600 on pin 30, and the SD card reader attached according to the pins in SDplay.pbas
Run the program ( a 2500ms delay at the start is to allow me time to click Enable on the PST after upload! )
Then the PST will blank and prompt you to insert card.
A screenshot of what to expect is attached, along with the all files you need. I am attaching 2 files by JonnyMac (delays.lib, serial.lib) without his permission, so hopefully I will not get beaten!
Note, I had the lib files in a subfolder "Library". You might need to check the LOAD statements in SDplayXX.pbas if you store your libs elsewhere!
As said before, the concept here is to provide mass storage (ala EEprom). It is not a FAT based library. This lib will be ideal for dataloggers who would have a dedicated PC program to read back the data and stick into a spreadsheet or database for analysis. (I could write the necessary program if someone needs it). -- OR just use it as cheap mass storage on your Propeller project and never move the SD card to your PC!
Finally, this is still a work in progress. I have more methods to add and no doubt stuff to improve.
If you use this, please do send feedback good or bad (especially bad!). I really would like to fix any bugs, and the more cards that can be tested the better!
2010.Sep.24 - sd.lib updated to fix misreading of the card multiplier (thanks to MAX72)
2010.Sep.14 - Modified blocksize to always be 512 bytes/sector and calculate totalsectors correctly (as we always read/write in 512byte blocks, regardless of the card block size)
2010.Sep.09. - 1st Version