2
\$\begingroup\$

I have a SD card module by LC Studio. I am interfacing it with PIC32. This module consist of 6 pins:

CS 
MOSI
MISO
CLK
3v3
GND

I am following Lucio De jasio book to interface SD card. He has described to connect CD pin which is a Card Detect pin to detect the card but in my case I don't have cd pin. How can I detect for card detect state or is there any other option.?

\$\endgroup\$
3
\$\begingroup\$

I'd say that the pin description given by LC Studio is for the SPI access mode. In that mode you don't use the Card Detect as it is used as chip select of the SPI bus.

If you want to use the SDIO interface the CS pin turns into the CD pin. MOSI is command/response and so on. Have a look at the Wikipedia page, it shows the pin mapping for the different modes.

Based on the schematic I found on the forum of element14, you can also see, that pin 1 is directly connected to the CS pin of the header, I don't know all the details, but that might work for SDIO as well.

\$\endgroup\$
  • \$\begingroup\$ what is this SDIO interface. Is it different from SPI.? BTW thanks for wiki page.! \$\endgroup\$ – Aircraft Sep 8 '15 at 10:40
  • \$\begingroup\$ @CZAbhinav: Yes it is different, it's a proprietary interface available on SD cards. It's probably faster because it has a split command and data line, and there is a 4 bit mode available which should quadruple the data throughput and is required for UHS cards. \$\endgroup\$ – Arsenal Sep 8 '15 at 10:43
  • \$\begingroup\$ @CZAbhinav I haven't used a PIC controller, so I can't give a definite answer, it seems like it doesn't have one. At least it's not advertised as it is in other controllers (for example STM32). \$\endgroup\$ – Arsenal Sep 8 '15 at 11:11
  • \$\begingroup\$ ok no problem.! \$\endgroup\$ – Aircraft Sep 8 '15 at 11:23
1
\$\begingroup\$

Any detection pin always have the same way to operate - it's a contact which does short circuit when device is attached. Look carefully as card holder you're using - it must have additional contact for that.

If you're soldered sd card to the pcb then you doesn't have it. It's ok, but you might need to correct your firmware.

\$\endgroup\$
  • \$\begingroup\$ It doesnt have any additional contact for it.! \$\endgroup\$ – Aircraft Sep 8 '15 at 10:39
  • \$\begingroup\$ Ok, can you write the part number of the card holder please? \$\endgroup\$ – Looongcat Sep 8 '15 at 19:27
  • \$\begingroup\$ It doesnt have any part number. This is the module I am using: cdn.instructables.com/FZT/ULKU/H9G19FWD/… \$\endgroup\$ – Aircraft Sep 9 '15 at 4:22
  • \$\begingroup\$ Can you check every contact if it gets shortened on ground when you're plugging the card? According to forum.hobbycomponents.com/viewtopic.php?f=25&t=5 it doesn't have CD function, but you should at least check it. \$\endgroup\$ – Looongcat Sep 9 '15 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.