Recording to an SD card in FAT32

eggie

Member
I do love a challenge - especially when it works!!

I have, over several months, been developing a programme that will write data to an SD Card in FAT32 format. It has not been an easy ride and did feel like giving up at times. I am please to say that I persevered and now the programme is complete and tested on many of the SD Cards we have in the house.

Attached to this post is a circuit diagram and some notes I have prepared explaining all about the programme and how to use it. Attached to the next post I will be the programmes for Slot 0 and Slot 1.

I was not sure where I should put this post on the forum and so if one of the Moderators considers here to be inappropriate, please feel free to move it to another section.

I would be interested to know how anyone gets on using the code.

Eggie
 

Attachments

Last edited:

Jamster

Senior Member
Well done on your efforts. You have provided an incredibly valuable resource which I shall definitely use in future. :)

Jamster
 

eggie

Member
srnet - Jamster has summed up my dilemma. Rather than being a completed project, it is more of a resource to be developed further to individual requirements, so I was not sure if the completed projects section was the right area.
 

srnet

Senior Member
srnet - Jamster has summed up my dilemma. Rather than being a completed project, it is more of a resource to be developed further to individual requirements, so I was not sure if the completed projects section was the right area.
Code Snippets then ?
 

srnet

Senior Member
Well maybe, but if the code works, its a working project.

I just posted a two slot project based on a 28X2, what puzzled me that every time I changed and then downloaded the slot 1 program, I had to re-program the (unchanged) slot 0 program, never understood why I should need to do this. .
 

MFB

Senior Member
Not to detract from this considerable achievement but I think its been said here before that, although it may be possible to implement an SD card interface, there would be little PICAXE processing power left to do anything else. The accepted approach seems to be to use a dedicated low cost interface module like the OpenLog
 

eggie

Member
Nice work, but 14 bytes of free space is not a lot to do anything else with.
Slot 0 is only to initialise the disc - there are 2000 bytes of programming space in slot 1 which is the slot that does the saving to disc - all explained in the notes
 
Last edited:

eggie

Member
I just posted a two slot project based on a 28X2, what puzzled me that every time I changed and then downloaded the slot 1 program, I had to re-program the (unchanged) slot 0 program, never understood why I should need to do this. .
I have not come across any problems loading the different slots - in the development of the programme I was repeatedly loading slot 1 which had no effect on slot 0. Perhaps this is something technical could advise on.
 

srnet

Senior Member
Slot 0 is only to initialise the disc - there are 2000 bytes of programming space in slot 1 which is the slot that does the saving to disc - all explained in the notes
And presumably another 8192 bytes of free program space in slots 2 and 3 ?
 

hippy

Technical Support
Staff member
I just posted a two slot project based on a 28X2, what puzzled me that every time I changed and then downloaded the slot 1 program, I had to re-program the (unchanged) slot 0 program, never understood why I should need to do this. .
That shouldn't be necessary; it should be a case of downloading slot #1 leaves all other slots unchanged. There might be an issue if slot #0 relies on what is in Data Eeprom and another slot download overwrites that, requiring slot #0 to be re-loaded to get the Data Eeprom into a usable state.
 

srnet

Senior Member
That shouldn't be necessary
Well I cant see what I did wrong, the slot 1 has a table defined, but no shared EEPROM.

Its the GPS Locator project I just added.

I Program the main slot 0 program, makes sure its set not to run the slot 1 program (there is a #define to prevent it running), this program works fine. Next I load the slot 1 program.

Slot 0 program now no longer runs, I can tell by the debug output I added that its getting as far as clearing the RAM from $38\56 upwards (the clearRAMbuffer: routine) and the program stops. I have to reload the Slot 0 program to get it working.

Not a major issue, but I am curious as to what I have done wrong ......
 
Top