| FORUM

FEDEVEL
Platform forum

SD card communication issue

Primitive , 10-09-2017, 10:15 AM
Hello everyone, Robert !

I started learning hardware design in your video 2 years ago, since then I never add big trouble with my projects. But right now I'm facing a hardware issue that I can't solve myself. I've tried everything I could without success, and I don't want to send new prototype for manufacturing without being sure that I know the source of the problem !

So here it is : I'm developing a music sequencer for modular synthesizer, it's based on a stm32 chip, and I placed a SD card reader to store projects on the last prototype. Problem, the SD Card doesn't work. At first I thought it was a software problem, but when I probed the communication pins I found out that something was wrong. There is some sort of "capacitive effect" going on when the host try to communicate with the SD card.
Check photo 1 for the oscilloscope response : yellow is the clock and blue is CMD Pin. During initialization signal is very slow (400kHz). When the SD Card "answer" to the host, the clock signal as well as the CMD signal "charge" and doesn't go back to ground. At one point the SD Card stop communicating, and the error appears. The first few response from SD Card are correct. In ST document AN4661 (hardware recommendations), they recommend a 50Ohm trace impedance, but it's impossible given my design (I would need 2.6mm wide trace).

So my question is this : Have you ever encountered such problem ? If yes, what could it be ? Length matching ? Bad grounding ? Trace impedance ? Bad power ?
I also put a screen-shot of the connections between the SD Card reader and the micro-controller.

What I tried so far : change the pull-up resistor value (from 10k to 100k). Add resistor in series with the communication line (22R, 150R, 1k). The 22R resistor improved a little bit, there was like 1 more communications with the SD card but that's it.

Thanks a lot for your help.

Best,
Mathieu



robertferanec , 10-09-2017, 10:37 AM
How many layers is the PCB and what is the stackup?
Primitive , 10-09-2017, 11:04 AM
Thanks for your quick reply !
It is a standard FR-4 1.6mm 2 layer PCB. Also note that on the picture I joined I deleted a few components and the ground planes to make the trace more visible.
robertferanec , 10-09-2017, 11:18 AM
2 layer PCB may be the problem.
Primitive , 10-09-2017, 11:23 AM
Is there any way I could try to make it work with 2 layers, maybe with wider tracks ? Better grounding ?
We have another project with a standard SD-card that works properly.
robertferanec , 10-09-2017, 11:38 AM
We have another project with a standard SD-card that works properly.
Do not be surprised if you find out some versions or batches of boards may have occasionally problems.

I believe it is possible to use SD card on 2 layer PCB, however keep the tracks short and ideally you would like to have solid GND plane under the tracks connecting the slot and chip.

Power distribution is also extremely important and it will influence your circuit a lot. When I saw the VCC tracks, I immediately knew it is a 2 layer PCB. Have a look at my Learn to Design Your Own Boards course, I do speak there a little bit about power distribution and layout on 2 layer PCB. You really may not want to distribute your power through tracks, but you may want to create planes. I have not seen your schematic, but you may want to be very careful about decoupling around the chips and SD card.
Primitive , 10-09-2017, 11:42 AM
Thanks a lot for these advice, I am currently re-watching "Learn to Design Your Own Boards" on Udemy, I will apply all your advice for the next prototype batch, hopefully it will work !
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?