PDA

View Full Version : SD or MMC card as storage for logging



HYETİK
- 29th March 2009, 13:43
I want to use 16,32 or 64 mb mmc or sd card to save log file and some constant and glcd image codes.

Do you help me about this problem.
I searched on internet but I only find MMC/SD card reader with RS-232 inteface. I dont want to use rs-232, I only use it as storage device for pic micro.

Another question:
can I change code inside the Pic, without programming it again. I heard that 18f series can do it but how??

Thanks for your helps:)

Hasan...

Darrel Taylor
- 30th March 2009, 02:05
I want to use 16,32 or 64 mb mmc or sd card to save log file and some constant and glcd image codes.

sdfs3.zip
http://melabs.com/resources/samples.htm

Requires an 18F PIC, PBP 2.50b using PBPL.

See the sdreadme.txt, and SDschem.pdf files in the zip.
<br>

Chris Barron
- 31st March 2009, 09:18
sdfs3.zip
http://melabs.com/resources/samples.htm

Requires an 18F PIC, PBP 2.50b using PBPL.

See the sdreadme.txt, and SDschem.pdf files in the zip.
<br>

I'll vouch for that !

I downloaded it, fully expecting to have to make some changes(other than pin assignments). I compiled the code and it worked the very first time .

What I would say in all seriousness though, is to check the pinout ever so carefully. Although in the schematic diagram the pic pins (via buffers) are wired to the correct SD card 'pins' you mut take care to note that the indented pin on the edge connector of the SD Card is pin number 9. You might then assume that next to it is pin 8, but no , the next pin along is pin 1

I took the indented pin to be pin 1 and the next pin to be 2, etc, and blew my first test SD card because there was a power reversal. (Pic was undamaged)

In summary, from the underside of the SD card with the pads exposed and the indent to the bottom, the pinout is like this..

8
7
6
5
4
3
2
1
~9


Other than that, the supporting code simply works as it should, many thanks to the author for that !

HYETİK
- 31st March 2009, 15:20
thanks for it I wil try:)
I will report the result:)

SOMRU
- 31st March 2009, 20:56
Hey there...
have been working on similar project,
check out

http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/434/Default.aspx?txtSearch=usb%20data%20logger&SortField=ProductName,ProductName

really cool device...

cheers

mackrackit
- 31st March 2009, 23:24
Hey there...
have been working on similar project,
check out

http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/List/1/ProductID/434/Default.aspx?txtSearch=usb%20data%20logger&SortField=ProductName,ProductName

really cool device...

cheers
Tell me how you are going to stick an SD card into that?

SOMRU
- 1st April 2009, 13:29
mybad...
try this

http://www.roguerobotics.com/products/electronics/ummc

good luck.

Chris Barron
- 1st April 2009, 13:53
mybad...
try this

http://www.roguerobotics.com/products/electronics/ummc

good luck.

Yep thats neat , especially if you are pushed for space.

The SDFS software in picbasic doesn't require any other hardware though, apart from a socket for the card In my case I recovered one from a broken SD card reader (New ones cost less than £1 !), so it cost me nothing to get basic SD functionality

mackrackit
- 1st April 2009, 14:39
Yep thats neat , especially if you are pushed for space.

The SDFS software in picbasic doesn't require any other hardware though, apart from a socket for the card In my case I recovered one from a broken SD card reader (New ones cost less than £1 !), so it cost me nothing to get basic SD functionality

And the support from MeLabs can not be beat. A month or so ago I found a problem with APPEND. I am not good enough with FAT16 to fix it myself, so I told Jeff about it and now it is fixed. That is why it is now SDFS3. Where else can you get support like that?

I have tested SDFS more ways than I can count, even wore a SD card out reading and writing over and over.

SDFS just plain works.

Luckyborg
- 1st April 2009, 16:05
Out of curiosity how many read/writes do you think you got out of that card. I'm always curious as to how accurate data sheets are for things like that, which I can't actually measure practically.

David

Jerson
- 2nd April 2009, 04:44
Could anyone using the SFS3 please enlighten me on the amount of flash/ram it consumes? I cannot check it since I do not have PBPL yet.

thanks

mackrackit
- 2nd April 2009, 14:02
Could anyone using the SFS3 please enlighten me on the amount of flash/ram it consumes? I cannot check it since I do not have PBPL yet.

thanks
Here is what I have on a basic setup.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3295&stc=1&d=1238651243">

Out of curiosity how many read/writes do you think you got out of that card. I'm always curious as to how accurate data sheets are for things like that, which I can't actually measure practically.

David
That is a hard question.

The card that failed was an old 64 MB. Well used to begin with.
When I first started playing with SDFS I was using a 1 GB card, that is when there was an append problem. I tried several cards as not all manufactures sizes are the same. The append problem was SDFS would not append a file past the sector the file originated in. It would write multiple file though. I got to testing with the 64MB card. The first sector took a beating. Fill the sector, erase or format, bang on the keyboard some more...

I do not have any idea how many times I did this.

After Jeff fixed the problem, skimask and I was doing some write speed test. I set up a loop to write 8 bytes, read, append 8 more, read... This particular card was running that loop at 3.55Hz.

The way I understand it, the MBR is in the first sector, more abuse.

I think I was about 4 hours into that test before failure.

mister_e
- 2nd April 2009, 14:30
In theory it has to be something like 10K writes cycles, and it depends of the brand. But how 10K is 10K... that's another story ;)

mackrackit
- 2nd April 2009, 14:55
Could anyone using the SFS3 please enlighten me on the amount of flash/ram it consumes? I cannot check it since I do not have PBPL yet.

thanks

The attachment did not attach the last time??
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3297&stc=1&d=1238680436">

Jerson
- 2nd April 2009, 15:13
thank you Dave :)

Caveman
- 15th January 2012, 04:08
sdfs3.zip
http://melabs.com/resources/samples.htm

I searched for the ZIP file but all I found was the PICBasic program. Just wondering if anyone might still have the ZIP version with schematics, text files, etc.Or, is there a newer version available?Can a Caveman really do it?

ScaleRobotics
- 15th January 2012, 05:38
Looks like a bad link. Here's one I found from Dave: http://www.picbasic.co.uk/forum/showthread.php?t=15603&p=108632#post108632

Caveman
- 16th January 2012, 02:07
Thanks, I'll download this and see what I can learn. I appreciate your help.

Mike