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

Writting/ Reading from Flash Card

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

Writting/ Reading from Flash Card
PostPosted: Tue May 17, 2005 4:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 17, 2005 4:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 17, 2005 4:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 17, 2005 5:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 17, 2005 5:17 am     Reply with 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?
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

View user's profile Send private message Send e-mail

PostPosted: Tue May 17, 2005 6:07 am     Reply with quote

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.
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