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

MMC read_block problem

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



Joined: 28 Mar 2006
Posts: 10
Location: Kansas City, MO

View user's profile Send private message AIM Address

MMC read_block problem
PostPosted: Fri Mar 31, 2006 3:41 pm     Reply with quote

i am having a problem reading a block from MMC. i can successfully RESET, INITialize, and SET_BLOCKLEN.

when i send the command to READ_BLOCK, i never get the FEh start byte. i either get 00h or FFh's.

any ideas?
f00dstamps



Joined: 28 Mar 2006
Posts: 10
Location: Kansas City, MO

View user's profile Send private message AIM Address

PostPosted: Sat Apr 01, 2006 12:01 am     Reply with quote

bump for help guys.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Apr 01, 2006 12:30 pm     Reply with quote

Search the internet for the terms "spi timing" and MMC, this will give you several links to a 3-page document with timing diagrams for the MMC cards in SPI bus mode, for example http://kilm.by.ru/im/flash/mmc/pdf/spitiming.pdf

The sequence for executing the read from MMC is as follows:
- Send the Read command (51h)
- Read 1 to max. 8 bytes of 0xFF until you get a 0x00, this is the command acknowledge.
- Read 1 to many (depending on card) bytes of 0xFF until you get the 0xFE start byte.
- Read all data bytes (length set by CMD16).
- Read the two crc-bytes.
f00dstamps



Joined: 28 Mar 2006
Posts: 10
Location: Kansas City, MO

View user's profile Send private message AIM Address

PostPosted: Sat Apr 01, 2006 2:16 pm     Reply with quote

ckielstra - thanks for your response. i already have the spitiming diagram and i already follow the sequence you outline.

i send the read command until i get 00h returned. after that i send the read command until i get FEh returned. i read up to 8192 times but i have yet to get the FEh.

perhaps i have a problem with my open_file function.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Apr 01, 2006 3:30 pm     Reply with quote

Can you post your read function here? If you can't for confidential reasons, then mail it to me using the mail function of this forum.
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