Page 1 of 1

Fast SDCard existence detect

Posted: Fri Jul 26, 2019 12:05 am
by KanyeKanye
If there is no SD Card in the slot, sdmmc_card_init returns (with 0x107) after about 29ms for SDMMC Mode and 21ms for SPI Mode.
It's way too long. How to detect SD card existence faster?

Re: Fast SDCard existence detect

Posted: Fri Jul 26, 2019 8:50 am
by mikemoy
don't know why 21ms needs to be faster. A human cannot even react to 21ms.
But anyway, you can read or set up a IRQ to check the SDCard switch on the socket.

Re: Fast SDCard existence detect

Posted: Fri Jul 26, 2019 9:59 am
by KanyeKanye
I have no more pins for CD pin. I store data in the loop and 28ms is much too long for waiting. I believe there is some way (sanding some CMDx command) that would answer immediately on every card.