cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO interface - can not use SD card 250ms timeout

kekon1234
Associate III
Posted on July 01, 2013 at 12:55

I have just created my own SDIO library for SD cards. It works pretty well but i noticed one issue with SDIO interface. I use STMF4 device clocked with 168 MHz. At 168 MHz speed the maximum SDIO clock frequency is 24 MHz.  I read in the SD card specification that the maximum write timeout (used when WRITE_BLOCK command is performed for example) is 250 ms. There is a special 32-bit register for counting SD card timeouts ''DTIMER'' that counts SD card clock periods. With 24MHz SD clock freq the maximum timeout that can be counted by DTIMER is: (1/24MHz) * 2^32 = 178.95 ms. It seems that there is no way to use the DTIMER to count 250 ms. Am i right ? Is there any way to use DTIMER to count longer timeouts than 178 ms ?

3 REPLIES 3
Posted on July 01, 2013 at 14:33

Please check the math 4 billion is significantly larger than 24 million.

Surely 178.96 Seconds?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
petrovsky
Associate II
Posted on July 01, 2013 at 14:33

For 24MHz maximum timeout is 178s, not 178ms.

kekon1234
Associate III
Posted on July 04, 2013 at 07:13

Yes, you're right. I made a mistake... It is 178 s not 178 ms... Thanks :)