View previous topic :: View next topic |
Author |
Message |
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
MMC read_block problem |
Posted: Fri Mar 31, 2006 3:41 pm |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
|
Posted: Sat Apr 01, 2006 12:01 am |
|
|
bump for help guys. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Apr 01, 2006 12:30 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
f00dstamps
Joined: 28 Mar 2006 Posts: 10 Location: Kansas City, MO
|
|
Posted: Sat Apr 01, 2006 2:16 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Apr 01, 2006 3:30 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|