SD and MMC memory card read access time (Nac)

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I see from the specs for SD and MMC cards that the time from a read block command is sent and the response is received until data actual is ready for reading, named Nac in timing constant definitions table, must be calculated from the TAAC and NSAC fields in the CSD register to ensure proper readback of data. However, setting a fixed time delay after response received would do the trick in most cases saving me from anoying calculations. For the bunch of you who have allready designed circuits using MMC and SD cards, what is your experience when it comes to this time value?

I guess most cards from different brands have a rather fast access time, but other peoples experience is always appreaciated. Would 1ms(+) do the trick? This is a common value for Hitachi MMC's according to Hitachi spec. where NSAC is set to 100 clk cycles (which when using 3.6864MHz SPI gives +24,13us) and TAAC is set to 1ms. For other card types I guess it is different timings. Your experience is???

Thanks in advance

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After READ SINGLE BLOCK (CMD17) the card tells you when the data is ready by sending you 0xFE, so you don't actually have to wait a fixed delay...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anton Senger wrote:
After READ SINGLE BLOCK (CMD17) the card tells you when the data is ready by sending you 0xFE, so you don't actually have to wait a fixed delay...

Does it? And where is this specifyed? According to spec. for SPI only R1 is aviable before datablock is ready to be clocked out. If toggling SPI CLK while waiting only 0xff should be transmitted, this is for both MMC and SD cards. Prehaps some cards does, prehaps some don't. Note: I am mostly using CMD18 together with CMD23 if card needs this option (By Hitachi this holds the number of blocks to be transmitted when using CMD18)

Any comments?

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ch. 6.6.2.6 in the attachment for example

I tested my SW with toshiba SD 256, SanDisk SD 256, Panasonic SD 16, Formel1 MMC 128, Kingmax DS 1G
;)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm. There is no such chapter in my three versions of specs. And they are newer by year last released than yours but strangly not in version number. By the way, ch. 6.6.2.6 in your spec is the same as ch. 5.18.5 in mine sandisk mmc spec. and this is for data written response not for data block ready to be read. Did u mean another chapter? I understand that your sw works by using 0xef as a trigger, and it would be wonderful for me to do so too, but I need to know why things seem to work since my customer relys on me.
Also ch. 6.8.2.1 (your spec) shows no shuch bytes as a leading 0xef.

According to spec. version i see that your spec is version 2.11 except if you read the footer at the bottom of each page (yes i know that footers most often is to be found right at the bottom of a page :) ) , here the version number is 3.0 Strange. The difference between mine and your spec. however, which that I beleive clearifyes the difference in our spec version number and age is that mine spec also covers the reduced size MMC which is rather new.

My spec can be found here for a while http://home.no.net/~zainka/dwnl/...

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i just picked up the first mmc spec in my directory, it might not be the most recent one (and it is not it is from 2001). Anyway, the chapter number i gave you is wrong it is not 6.6.2.6, it is 6.6.3. Sorry, stupid my :oops:

Quote:
6.6.3 Data Tokens
Read and write commands have data transfers associated with them. Data is being transmitted or received via data tokens. All data bytes are transmitted MSB first.
Data tokens are 4 to (N + 3) bytes long (where N is the data block length set using the
SET_BLOCK_LENGTH command) and have the following format:
• First byte:
Table 6-6 Format of the Start Data Block Token
Token Type Transaction Type 7 Bit Position 0
Start Block Single Block Read 1 1 1 1 1 1 1 0
Start Block Multiple Block Read 1 1 1 1 1 1 1 0
...

And it is not 0xEF, it is 0xFE
Anyway, i don't think they have removed this from the newer specs (but im too lazy to look it up ;) )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greate, nothing is bether than you beeing right. I don't know why I missed this, but I am sure everybody else do, I am quite absent-minded.... Offcourse sandisk havent removed it, I have read it several times and forgot all aboute it youst as many times (my spec is ch. 5.2.4)...

Life is easy with (0x)fe (in norwegian "fe" means cows...)...

Thanks

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

actually i discovered it by stealing other peoples code, not by reading the spec ;)

Quote:
in norwegian "fe" means cows

oh, you are from norway. i puzzeled what "no are way" means all the time :D
i thought you are from russia, cause 'zainka' means 'little rabbit' in russian and you have a rabbit as your avatar

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Familiar with russian language, are we,? huh.. Yes I am living in Norway but my wife is Russian and I am her little .. you know. Speacing aboute NO(r)WAY, If you forget aboute the (r), you get "No way", I thought that to be "funny" but it is moer lika a "bunnys" senze of humor.. ha ha, i kill my self.

Regards
Vidar (Z)

----------------------------------------------------------

"The fool wonders, the wise man asks"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Example sourcecode for AVR and MMC and FAT filesystem can found at
http://www.metsys.fi/ana/mega32-... Source has some limitations, these are documented in source code (and web page, but only in finnish language because finland is between Norway and Russia, I put them in finnish).
.