4
\$\begingroup\$

I am having trouble communicating with an microSD card with an AVR on a board I'm working on. I used an oscilloscope to have a look at the signals coming out of the microSD socket on my board. I saw nice 3.3V MOSI and SCK signals between the AVR and the microSD socket. What I saw on the MISO trace however surprised me. It looked kind of like a superposition of the MOSI and SCK scaled down to under 100mV. My interpretation of this is that the MISO line must be floating and what I'm seeing on the scope is basically cross talk / AC pickup from adjacent signal traces.

The possible causes of this that I've come up with are:

  • The Slave Select trace is not making it all the way to the SD card (i.e. either the SD slot is not well connected to the board on that pin or the card is not making good contact within the slot)
    • My reasoning on this is that if the card were powered and the Slave Select pin were low the card would actively drive the MISO line (i.e. it would not float).
  • Likewise for the 3.3V power or GND signals to the card
    • My reasoning on this is that if the card were not getting power / GND, it wouldn't matter what was happening on the SPI bus.

My questions are:

  1. Are the conclusions I'm drawing sound based on the information I've provided?
  2. Are there other possibilities I've overlooked?
  3. How can I isolate / diagnose the problem further?

Edit #1

The following scope trace illustrates the description I gave above:

enter image description here

\$\endgroup\$
10
  • 1
    \$\begingroup\$ What's stopping you from checking your connections? Also, adding scope shots might help. \$\endgroup\$ – Armandas May 8 '12 at 16:34
  • \$\begingroup\$ @Armandas it's difficult to know what is going on inside the microSD slot with the microSD card seated. As far as I can tell the microSD slot mounted to the board properly. \$\endgroup\$ – vicatcu May 8 '12 at 17:01
  • \$\begingroup\$ @Armandas I may be able to get a scope capture to post later tonight. \$\endgroup\$ – vicatcu May 8 '12 at 17:09
  • 1
    \$\begingroup\$ @Armandas scope trace added for your viewing pleasure \$\endgroup\$ – vicatcu May 9 '12 at 4:42
  • 1
    \$\begingroup\$ Yes, but look when MOSI is low: it also puls MISO lower. But now I see that it's like exponentially going to 0, so I don't know. Maybe it's only coupling, but it's quite clear that nothing is driving it properly. \$\endgroup\$ – clabacchio May 9 '12 at 13:42
2
\$\begingroup\$

I just looked at an example circuit from Microchip http://ww1.microchip.com/downloads/en/DeviceDoc/DS-51583b.pdf

It shows a pull up resistor on the MISO line to the card. It's possible that the card has an open collector output that needs a pull-up resistor on your board to work.

\$\endgroup\$
4
  • \$\begingroup\$ My circuit is based directly on sparkfun.com/datasheets/DevTools/Arduino/… \$\endgroup\$ – vicatcu May 16 '12 at 18:38
  • 1
    \$\begingroup\$ @vicatcu - That's nice, but I'd trust Microchip over Sparkfun every time. Microchip is a member of the SD Association, Sparkfun is not. It's possible that some cards have an open collector output, and that Sparkfun hasn't seen these cards, or that some SD cards have weak internal pullups while others have totem-pole outputs, or...any number of things. Get your schematics from the most official source possible. \$\endgroup\$ – Kevin Vermeer May 16 '12 at 18:45
  • \$\begingroup\$ @KevinVermeer that is good advice, and I'll add pull-ups to the MISO pin in my next revision of the board definitely... I think I will generate a new question about my overall SPI design topology \$\endgroup\$ – vicatcu May 16 '12 at 19:25
  • \$\begingroup\$ The reason I suggested what I did was not so much just that Microchip does it so you should to, but rather based on the weird signal he's seeing on the MISO line. Usually when I see a signal like that it's because I don't have the I/O pin configured correctly or I'm missing a pull-up resistor. \$\endgroup\$ – mjh2007 May 17 '12 at 3:21

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.