CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Connecting memory card to PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Andrew Wilson Jones
Guest







Connecting memory card to PIC
PostPosted: Fri Aug 15, 2003 1:29 am     Reply with quote

Hi,
Has anyone connected any plugin memory device (ie Sony memory stick, MMC, SD card, Playstation memory card, or any other type) to a PIC. The playstation card would be the best (lowest cost) but then I need to be able to read and write to it from a PC. I did see a web site years ago that showed you how to connect one to the lpt port, but can't find the site anymore. I could also build a reader/writer that connects to the serial port,so that not too much of a problem. I would like to use one of these devices as a storage device for data that can then read on a PC. Any help, links or code would welcome.

Thanks Andy
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516991
Pete Smith
Guest







Re: Connecting memory card to PIC
PostPosted: Fri Aug 15, 2003 3:36 am     Reply with quote

:=Hi,
:=Has anyone connected any plugin memory device (ie Sony memory stick, MMC, SD card, Playstation memory card, or any other type) to a PIC. The playstation card would be the best (lowest cost) but then I need to be able to read and write to it from a PC.

Hi.

It _is_ possible!

I've managed to connect a 64Mb MMC device to a PIC, and run a primitive FAT16 (short filenames, no long allowed) file system on it, which allows me to open files for block (burst sequential) write, and random byte write, and in principle (but not yet supported) block and byte read.

It only copes with one file handle at once (more FRAM would help with that one).

I use a 2kbyte FRAM partitioned into 4 512 byte pages, to store the directory information, two copies of the FATs, and one for the current file. (With more FRAM, you could have more files open).

The MMC device has the advantage that you can plug it straight into a PC card reader, and all your data is there, ready, and waiting.

There is however a problem. Due to licensing issues, I can't actually give anyone the code :-(

However, if there is a large enough (or if there isn't, and I get enough time), I'll stick up a web page, not providing working code, but with examples (if Tomi is agreeable for me to point to his example for how to access the MMC device), and descriptions of how to suck out the boot sector etc, and then what to do with them.

Pete.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516992
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

Re: Connecting memory card to PIC
PostPosted: Fri Aug 15, 2003 6:49 am     Reply with quote

:=:=Hi,
:=:=Has anyone connected any plugin memory device (ie Sony memory stick, MMC, SD card, Playstation memory card, or any other type) to a PIC. The playstation card would be the best (lowest cost) but then I need to be able to read and write to it from a PC.
:=
:=Hi.
:=
:=It _is_ possible!
:=
:=I've managed to connect a 64Mb MMC device to a PIC, and run a primitive FAT16 (short filenames, no long allowed) file system on it, which allows me to open files for block (burst sequential) write, and random byte write, and in principle (but not yet supported) block and byte read.
:=
:=It only copes with one file handle at once (more FRAM would help with that one).
:=
:=I use a 2kbyte FRAM partitioned into 4 512 byte pages, to store the directory information, two copies of the FATs, and one for the current file. (With more FRAM, you could have more files open).
:=
:=The MMC device has the advantage that you can plug it straight into a PC card reader, and all your data is there, ready, and waiting.
:=
:=There is however a problem. Due to licensing issues, I can't actually give anyone the code :-(
:=
:=However, if there is a large enough (or if there isn't, and I get enough time), I'll stick up a web page, not providing working code, but with examples (if Tomi is agreeable for me to point to his example for how to access the MMC device), and descriptions of how to suck out the boot sector etc, and then what to do with them.
:=
:=Pete.
I rolled my own over 2 year's ago only I used a 4M SIMM30 DRAM interface to the MMC instead of the FRAM.( the MMC requires a 512 byte buffer for file write only) The 4m DRAM allows for mutliple files to be open for read and write) The code to interface to the MMC is the basic SPI interface and the specifics of read write addressing the MMC I believe are in the open domain. You seen to know that you shouldn't distribute FAT16 code without anticipating an 800 pound gorilla owned by the worlds richest guy might stomp on you. Now showing how to access the boot sector and read the FAT16 directories and cluster tables and the files may be ok ...there have been articles in circuit cellar showing how to do FAT16 for Smart media cards and compact flash. For historical reasons patents( royalties) often control the writing of file formats and leave the status of reading files in a gray area.
Compuserve years back learned this with GIF files. You owe royalties even if the files belong to your users. Any comercial use or non commercial use that reduces the amount of money an 800 lb gorilla can eat may get it stomping on you. The web site idea without the Gorilla's blessing could get it mad at you.

___________________________
This message was ported from CCS's old forum
Original Post ID: 144516994
Pete Smith
Guest







Re: Connecting memory card to PIC
PostPosted: Fri Aug 15, 2003 1:36 pm     Reply with quote

:=:=:=Hi,
:=:=:=Has anyone connected any plugin memory device (ie Sony memory stick, MMC, SD card, Playstation memory card, or any other type) to a PIC. The playstation card would be the best (lowest cost) but then I need to be able to read and write to it from a PC.
:=:=
:=:=Hi.
:=:=
:=:=It _is_ possible!
:=:=
:=:=I've managed to connect a 64Mb MMC device to a PIC, and run a primitive FAT16 (short filenames, no long allowed) file system on it, which allows me to open files for block (burst sequential) write, and random byte write, and in principle (but not yet supported) block and byte read.
:=:=
:=:=It only copes with one file handle at once (more FRAM would help with that one).
:=:=
:=:=I use a 2kbyte FRAM partitioned into 4 512 byte pages, to store the directory information, two copies of the FATs, and one for the current file. (With more FRAM, you could have more files open).
:=:=
:=:=The MMC device has the advantage that you can plug it straight into a PC card reader, and all your data is there, ready, and waiting.
:=:=
:=:=There is however a problem. Due to licensing issues, I can't actually give anyone the code :-(
:=:=
:=:=However, if there is a large enough (or if there isn't, and I get enough time), I'll stick up a web page, not providing working code, but with examples (if Tomi is agreeable for me to point to his example for how to access the MMC device), and descriptions of how to suck out the boot sector etc, and then what to do with them.
:=:=

:=I rolled my own over 2 year's ago only I used a 4M SIMM30 DRAM interface to the MMC instead of the FRAM.( the MMC requires a 512 byte buffer for file write only) The 4m DRAM allows for mutliple files to be open for read and write)

Mmmm. Lots of RAM! Did you use a controller, or do all the refreshing yourself?

:=The code to interface to the MMC is the basic SPI interface and the specifics of read write addressing the MMC I believe are in the open domain.

It is indeed. It's much easier when you can see how others have done it though :-)

:=You seen to know that you shouldn't distribute FAT16 code without anticipating an 800 pound gorilla owned by the worlds richest guy might stomp on you.

Interesting. It isn't because of any FAT licensing issues. I thought that the FAT format was in the "public domain". It's actually because I've developed the code on my own time, and circumstances may arise where I could make some cash out of it, so I don't want to spread the code all over the net. Not very altruistic I know, but there'll be a baby to feed soon ;-)

:= Now showing how to access the boot sector and read the FAT16 directories and cluster tables and the files may be ok ...there have been articles in circuit cellar showing how to do FAT16 for Smart media cards and compact flash. For historical reasons patents( royalties) often control the writing of file formats and leave the status of reading files in a gray area.

When I was developing my application, it required quite a lot of trawling round, looking for information. I thought that if I could concatenate all this information, it may help others.

:=Compuserve years back learned this with GIF files. You owe royalties even if the files belong to your users. Any comercial use or non commercial use that reduces the amount of money an 800 lb gorilla can eat may get it stomping on you. The web site idea without the Gorilla's blessing could get it mad at you.

:-)

Like I said, I won't be posting code, but I may well post links to other sites that may contain information that if read in the correct way, may allow you to understand what the hell is going on :-) Possibly!

Pete.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144517001
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group