2

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.?

Aircraft
  • 1,666
  • 1
  • 12
  • 26

2 Answers2

3

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.

Arsenal
  • 17,464
  • 1
  • 32
  • 59
  • what is this SDIO interface. Is it different from SPI.? BTW thanks for wiki page.! – Aircraft Sep 08 '15 at 10:40
  • @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. – Arsenal Sep 08 '15 at 10:43
  • @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). – Arsenal Sep 08 '15 at 11:11
  • ok no problem.! – Aircraft Sep 08 '15 at 11:23
1

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.

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