2013-07-01 03:55 AM
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 ?
2013-07-01 05:33 AM
Please check the math 4 billion is significantly larger than 24 million.
Surely 178.96 Seconds?2013-07-01 05:33 AM
For 24MHz maximum timeout is 178s, not 178ms.
2013-07-03 10:13 PM
Yes, you're right. I made a mistake... It is 178 s not 178 ms... Thanks :)