PropBASIC - SD card / FAT working anyone?
simonl
Posts: 866
Has anyone got FAT working with SD cards using PropBASIC yet? I thought I saw someone mention it a while back - may have been FSRW via dispatcher? - but I can't find any mention of it in my searches.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
Comments
Ray
Not given up just yet... only not able to work the last couple of weeks. The SD card dev. platform is sitting on my shiny new desk and I will be back to it this week. (That said the holiday season is about to start and I am planning to be away for most of the next 3 months, so depending on progress I may not post anything new with any great pace until September).
My plan does not currently involve FAT though. I would probably use one of the SPIN objects for that at the moment as it seems FAT implementation is not a part-time project [noparse]:)[/noparse]
My intention is to create a library of PropBASIC functions that allow an SD card to be used for mass storage of data instead of an eeprom. So I will not be concerned with filenames etc.. Just reading and writing to logical memory addresses.
I will be using it for a datalogging project - so the plan is to write "raw" data to the SD card, then at the end of each month simply plug the card into a PC and read the data into a spreadsheet or database table for processing.
Anyhow, I will certainly keep posting with any useful progress,
Cheers, Max.
@maxwin: Yay, I'm looking to do datalogging to SD too! I'm just wondering how you'll be able to read the SD on the PC if the card's not got some form of FAT on it - can PCs read raw?
I wish I understood PropBASIC dispatcher - I'd have a go at doing this with FSRW myself.
I'm looking forward to September - LOL
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
Announcement: To cut costs in the current economic climate, we have switched-off the light at the end of the tunnel.
PCs can read raw with ease!
For example, with .NET code, open a file stream to the SD card but using ".\PhysicalDriveX" as the drive name instead of C, D, E, whatever... (where X is a physical drive number, eg. 4). You can find the PhysicalDrive number by checking control panel/administrative functions/computer management/disc management.
There are also some freeware apps that will allow you to get the raw data and export to a text file. WinHex is one.
Some other tips on coding here: www.fort-awesome.net/blog/2010/03/25/MBR_VBR_and_Raw_Disk
-Mike
http://forums.parallax.com/showthread.php?122615-PropBasic-SD-Card
The final code was attached to the first post.
Enjoy!
-Mike
Probably 16GB could be made to work... could it be something silly like the total sector number is bigger than one long, and so that would need to be stored across two (or more) longs, or divided by a suitable value before storing to one long?
-Mike
Good stuff! Don't give up.. I am still using this code in a project logging sensor data to 1 & 2gb cards, which is working well even after two years of service.
I will try to find a moment to try some larger cards next week, but if you have some success yourself in upgrading the code, then please do post - it would be really interesting to see the capability continued in PropBasic for the future (and more modern) generations!!
-Mike