Shop OBEX P1 Docs P2 Docs Learn Events
SD card detection without additional pins — Parallax Forums

SD card detection without additional pins

RaymanRayman Posts: 14,827
edited 2009-05-05 11:59 in Propeller 1
My SD card adapter has a switch to detect the presence of a card.· (There's also another switch to check the write-protect status).

I was thinking that additional pins would be needed to use this feature.· But, now I'm considering double use of 2 of the SD card pins.

I'm guessing that the SD card is disabled when it's CS pin is low.· Also, the·SD card·outputs or inputs shouldn't mind they're connected to a say 10k resistor to either GND or VDD.· The SD adapter switches ground when activated.· So, 10k pull-ups to those pins and then series 10k to·1 (or two)·of the SD card IO pins should do the trick...

Anybody tried this? (Or, think it won't work?)

Update:· It works! (but not the way I originally wanted...)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
visit http://www.rayslogic.com

Post Edited (Rayman) : 5/5/2009 11:57:41 AM GMT

Comments

  • TubularTubular Posts: 4,706
    edited 2009-05-04 02:07
    Good idea Rayman.

    I'm not sure about the best way to do it but happy to investigate further.

    I use a molex 47309-2651 microsd header. The detect switch actually comes out to 2 separate pads so it would be possible to connect one end to something other than ground (though that is the easiest given the pad layout)

    cheers
    tubular
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-05-04 05:35
    Rayman,

    if you get this to work, could you please elaborate on how to actually implement it?

    thanks,
    Mark
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-05-04 09:25
    I'd use the Din pin, as Din is actually a bus line and is designed to be shared by different devices. You have to pull it up, when a SD card is inserted (switch is closed) and pull it down, if no SD card is inserted. So, as long as you did not select the SD Card with CS the input of this pin will show you if the SD-card is inserted or not. If card is inserted and is selected it works as normal.
  • RaymanRayman Posts: 14,827
    edited 2009-05-05 11:59
    It works! But, I have to use the two output pins of the Prop (clock and data out to SD) as inputs to do it. So, this means that I have to "unmount" the SD card in order to make it work. But, that's not so bad.

    Wanted to use the one input to the Prop (data out from SD) to do it, but that doesn't work because the SD card drives that pin high once it's been accessed, even if unmounted.

    Besides, there's really two switches I want to monitor "card detect" and "write protect"...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    visit http://www.rayslogic.com
Sign In or Register to comment.