Shop OBEX P1 Docs P2 Docs Learn Events
Pros/Cons of In-Line Protection (Not Pull-Up) Resistors for SD Card Lines — Parallax Forums

Pros/Cons of In-Line Protection (Not Pull-Up) Resistors for SD Card Lines

Hi, all, As the title indicates, I'm wondering if it's advisable to put in-line series resistors (such a few hundred ohms) in the signal lines for an SD card (between the Prop pins and SD card socket pins). I'm not talking about pull-up resistors (there are plenty of threads--an opinions--on that) but rather just in-line resistors to offer protection from shorts. I haven't used them before and haven't had any shorts (even from probing pins or whatever), but perhaps I've just been lucky. Would, say, resistors on the order of 200 ohms significantly compromise signal integrity at normal SPI signaling speeds (I'm using Kye's driver, if that's germane)? What do you folks normally do/recommend? If I had to decide right now, I'd leave them out only because I've done that in the past and things worked, but maybe they would be a good idea to protect the Prop pins. Thought? --Jim

Comments

  • I don' use them. I'm not certain, but the output from the card is open-collector, anyway, which is what necessitates the pull-ups. As long as you don't foul pin assignments, or have a bad driver (I prefer FSRW), you should have any problems. I've used the attached circuit in several designs without any trouble at all.
    800 x 558 - 132K
  • I think that sd-card sockets are quite foolproof, so protect the propeller-pins from what accident? OK the big ones someone could insert a dime, but else the contacts are usually well hidden.

    @Peter J. goes a step more and uses one of the pins without pull up to test if a card is inserted. If I remember correct CS (or D0?) is internally pulled up by the sd-card and pulling low then test for high shows if a sd-card is present or not (and the pin is floating).

    @Peter mentioned that trick a couple of times, but I can't find a link right now, sorry.

    Enjoy!

    Mike
  • Thanks, Jon. Then maybe I don't have to feel guilty about not using them. I guess I was mostly worried about a conductive object shorting the pins to ground and potentially frying a Prop output or two. Thanks for the nice schematic! And based on a recommendation somewhere, in addition to the 0.1uF cap, I also use a 10uF. By the way, I'm using a full-sized SD card socket. Regarding drivers, I know that Kye has said that FSRW is considerably faster, but I want/need sub-directories (and I like the built-in boot function). Thanks for the feedback.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2017-12-09 04:20
    Thanks, Mike. Yes, Peter has spread the Gospel of not pulling up the CS line far and wide, so I don't/didn't (even if I haven't bothered so far to try to detect a card). Heck, he (or someone) even measured the PU resistance of various cards on the CS line. Thanks for the reminder, Mike. And thanks, Peter, for disseminating that useful information.

    Protect the pins from what, you ask? Metallic cockroaches, of course! No, I was just worried that some metallic object might get inside the housing and touch the exposed pins on the back of the socket where it's soldered to the PCB. I like your idea about inserting a dime in the socket itself, though. Is that with or without peanut butter? Anyway, currently, I have the Prop socketed, so if something did happen to it, it wouldn't be the end of the world (just a bad hour).
  • That dime thing happened somewhere here on the forum, @erco? @Phil? found one in some laptop or such.

    Mike
  • Cluso99Cluso99 Posts: 18,069
    I only have a pullup on nCS. Peter doesn't even use that!
    Contrary to belief, pullups are not required on any other SD pins.

    I have had no problems and my tiny boards (P8XBlade2 & RamBlade) come with microSD as standard.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-12-09 05:12
    Jon, none of the pull-up resistors are necessary--SD card outputs are driven, not open collector.

    I usually tie DAT1 and DAT2 together and pull them both high with one single resistor, those do nothing in SPI mode. About the capacitor, SD cards themselves have an internal capacitor, 100s of microfarads, so the external capacitor may be superfluous. There is quite a large surge of current when power is applied to an SD card.

    The SD Consortium document suggests that it is possible to turn off the internal pull-up resistor on the CS line
    ACMD42: Connect[1]/Disconnect[0] the 50 KOhm pull-up resistor on CS (pin 1) of the card. The pull-up may be used for card detection.
    I've never seen a card without that pull-up enabled.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2017-12-09 05:55
    I usually tie DAT1 and DAT2 together and pull them both high with one single resistor, those do nothing in SPI mode.

    That's what I did on my last couple boards, too (no doubt got that from someone). But I didn't want to mention it above for fear of causing a debate. As for the pull-ups, from reading about them on the forum here, I suspect you are right. But it doesn't seem to hurt things too much. Hopefully, they're superfluous at worst (despite a little extra current draw, capacitance and BOM costs).
  • Jon, none of the pull-up resistors are necessary--SD card outputs are driven, not open collector.
    I stand corrected.
  • ercoerco Posts: 20,256
    msrobots wrote: »
    That dime thing happened somewhere here on the forum, @erco? @Phil? found one in some laptop or such.

    Mike

    GREAT memory, Mike! My kids jammed a coin in the USB slot on my desktop and burned a trace on the PCB. Nothing that couldn't be solved by soldering on a piece of bypass wire.

  • I have two external standard sd sockets on my p2 motherboard all without any extra resistors, and they work great. If someone sticks a dime in there i wouldn't be at all worried about the signal lines as cmos is pretty resilient to shorts but I'd be more worried about the supply itself. But then again if all that happened I'd put it in the same basket as lightning.

    However in saying all this as I've been pushing the clock speed and looking at using smart pins and I'm thinking of adding series resistors to help with line termination, but these would be less than 100R though. No pullup on the cs though, that signal is defined as cs/cd where cd is card detect, so 4 i/o is all you need.
  • Clock LoopClock Loop Posts: 2,069
    edited 2020-09-16 09:23
    Not to yank a thread out of the freezer, but the above schematic is for MICRO sd cards.
    101bbf35d1d488a2d6e5dfd3573b79.jpg

    Full size sd cards have a different pinout. (that cost me some time, lol)

    I can verify no resistors are needed with the p1 also.
    sd-card-pinout.png

    Yes, im working on the sound for this---> https://forums.parallax.com/discussion/172107/model-railroad-engine-controller-activityboardwx-dualmc33926-sound-smoke-axlesensor-14vdcc-supercap/p1
    Hooking up 5 different (regular) sd cards to a prop now. :cold_sweat:
    447 x 499 - 59K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-09-16 12:58
    One recommendation that I would make now is to add a 1M pulldown to the CS/CD line to help software detect a high or a low for card detect rather than having to test for a floating line. The alternative is you can wire the card-detect switch to the CS line so that this switch is normally closed when no card is inserted, so the CS/CD line will be low but high when a card is inserted due to the card's internal pullup on this pin.
Sign In or Register to comment.