View previous topic :: View next topic |
Author |
Message |
arrow
Joined: 17 May 2005 Posts: 213
|
Writting/ Reading from Flash Card |
Posted: Tue May 17, 2005 4:02 am |
|
|
Hi
I am a newbie, and would like to read/ write to a Flash card using the PIC16F876.
The flash card is the usual one used in pda's mp3 players, and cellular phones.
Can someone please tell me how to do this? or point me in the right direction?
Thank you in advance.
a. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue May 17, 2005 4:38 am |
|
|
My guess is you mean the MMC card type, a Compact flash card would be too large for use in a telephone?
For MMC you can have a look at the mmc.c example file supplied with the CCS compiler.
Problem with writing to the MMC is that it requires a 512 byte RAM buffer, that's more than available in a PIC16F876. This can be solved by using an external FRAM chip from RAMtron, but it's going to be cheaper to use another PIC with more internal RAM. |
|
|
arrow
Joined: 17 May 2005 Posts: 213
|
|
Posted: Tue May 17, 2005 4:44 am |
|
|
Hi Ckielstra
Thank you for your reply.
The package does say "MMC" (I am not sure what that means).
It has 128MBytes in it.
Can I find the mmc.c example on line? (I have a rather old PICC compiler that does not have this example).
Also, if I dont require fast writting/ reading- do I still require the 512byte buffer?
All the best
arrow |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue May 17, 2005 5:13 am |
|
|
Quote: | The package does say "MMC" (I am not sure what that means). | Multi Media Card
Quote: | Can I find the mmc.c example on line? (I have a rather old PICC compiler that does not have this example). | No. When you search this forum you will find some references to other MMC libraries.
Quote: | Also, if I dont require fast writting/ reading- do I still require the 512byte buffer? | The buffer has nothing to do with speed requirements but is a nasty thing in the protocol, data can only be written in blocks of 512 bytes. Reading data can be done in smaller blocks down to a single byte. |
|
|
arrow
Joined: 17 May 2005 Posts: 213
|
|
Posted: Tue May 17, 2005 5:17 am |
|
|
Hi
Thank you very much for the explanation.
Could you tell me the smallest chip of the 16F series that can be used?
Will the 16F877 do the trick?
If I need to write in 512byte chunks, can I not pad things with 0s?
Once again thank you
arrow |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue May 17, 2005 6:07 am |
|
|
Quote: | Hi
Thank you very much for the explanation.
Could you tell me the smallest chip of the 16F series that can be used?
Will the 16F877 do the trick? |
None. You would need one with more than 512 bytes
Quote: |
If I need to write in 512byte chunks, can I not pad things with 0s?
Once again thank you
arrow |
If you are just storing your own data in raw format then you could "waste" data by writing a smaller amount and padding the rest. |
|
|
|