MicroSD card SPI schematic recommendation

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi All

 

I have not used a micro SD card for a project for many years. Previously I had simply connected all the pins to an SPI port and used FatFS. But there was no pullup or protection, which I believe this is necessary for a reliable data logger circuit. This my schematic, does it need any additional components? I have used pullups on all SPIs pins.

 

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


djoshi wrote:
does it need any additional components?
Yes; a bit of series termination increases ESD tolerance (R-TVS-R)

 

The Art of Electronics 3rd Edition | by Horowitz and Hill

Download a sample chapter

[page 16, middle of right column]

12.1.5 Input protection 804

ESD and Transient Protection Using the SP720 | Littelfuse AN9304.4

[page 7, bottom right]

FIGURE 13B. POSITIVE ESD DISCHARGE MODEL

[next page for how to calculate RI]


SMF15CT1G onsemi | Mouser

 

 

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Once the SD card is inserted it will not be changing. Do I need the additional resistor? If so what value?

 

 

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I have used pullups on all SPIs pins.

Why?

 

Maybe I just need a little more sleep, or some caffeine, ...

 

I thought the SPI Bus did not routinely use pull-up resistors, and an I2C bus did use pull-up resistors.

 

In this case, you should check the data sheet for SD / uSD cards and see if Chip Select is CS or CS\, and then select either a pull-up or pull down as is appropriate, to NOT select the chip until the uC is specifically doing so.

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
Once the SD card is inserted it will not be changing. Do I need the additional resistor?
No if CMOS handling procedures are implemented and all is on top of a ground plane; otherwise, yes for series terminator.

djoshi wrote:
If so what value?
Series termination value(s) are dependent on the injection current limits of the MCU/MPU/APU and the SD memory card; injection current is the primary cause of CMOS latch-up (a device may have ratings on ESD and latch-up)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A pull up or (down?) on the memory CS line might not bad idea.   You don't want CD floating while power up is applied & have the memory enabled.  Maybe the SD card already has this (or fancier) CS protection built in?

 

Is C1 a ceramic?  The symbol suggests it is, and that is what you want.  

 

I did see this from SanDisk, which seems to favor the resistors (for SD mode, vs SPI? )

 The extended DAT lines (DAT1-DAT3) are input on power up. They start to operate as DAT lines after the SET_BUS_WIDTH command. It is the responsibility of the host designer to connect external pullup resistors to all data lines even if only DAT0 is to be used. Otherwise, non-expected high current consumption may occur due to the floating inputs of DAT1 & DAT2 (in case they are not used).

perhaps this is only for "sd mode"?

 

Here are some sd specific parts and some very detailed specs

https://www.mouser.com/catalog/s...

noting that:

Even though the MMC and SD-memory card specifications state exact minimum and maximum values for the various internal and external pull-up and pull-down resistors, a majority of

implemented interfaces in available appliances do not follow these recommendations

interesting!!!

of course, they wan to sell parts....

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:

Once the SD card is inserted it will not be changing. Do I need the additional resistor? If so what value?

 

I wouldn't have thought you need any protection at all. No resistors, no diodes, no nothing. We don't put those on memory chips do we? So why a permanently mounted SD card (which is, after all, a memory chip in a plastic housing).

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

 I have used pullups on all SPIs pins.

Why?

 

Maybe I just need a little more sleep, or some caffeine, ...

 

I thought the SPI Bus did not routinely use pull-up resistors, and an I2C bus did use pull-up resistors.

 

In this case, you should check the data sheet for SD / uSD cards and see if Chip Select is CS or CS\, and then select either a pull-up or pull down as is appropriate, to NOT select the chip until the uC is specifically doing so.

 

JC 

 

This is reference design I seen, plus as a good practice I though adding pull up could be necessary. 

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

A pull up or (down?) on the memory CS line might not bad idea.   You don't want CD floating while power up is applied & have the memory enabled.  Maybe the SD card already has this (or fancier) CS protection built in?

 

Is C1 a ceramic?  The symbol suggests it is, and that is what you want.  

 

I did see this from SanDisk, which seems to favor the resistors (for SD mode, vs SPI? )

 The extended DAT lines (DAT1-DAT3) are input on power up. They start to operate as DAT lines after the SET_BUS_WIDTH command. It is the responsibility of the host designer to connect external pullup resistors to all data lines even if only DAT0 is to be used. Otherwise, non-expected high current consumption may occur due to the floating inputs of DAT1 & DAT2 (in case they are not used).

perhaps this is only for "sd mode"?

 

Here are some sd specific parts and some very detailed specs

https://www.mouser.com/catalog/s...

noting that:

Even though the MMC and SD-memory card specifications state exact minimum and maximum values for the various internal and external pull-up and pull-down resistors, a majority of

implemented interfaces in available appliances do not follow these recommendations

interesting!!!

of course, they wan to sell parts....

 

What about the other lines?

 

Yes C1 is a ceramic cap.

 

I think you are correct, I have seen this reference design on a SD mode. 

 

So maybe no protection is necessary.

 

Does it make any difference if my microcontroller is on PCB A and Micro SD is on PCB B? 
 

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So maybe no protection is necessary.

Well, it is a logger...things can happen and get zapped...so protection is a good idea.  You are talking about a few pennies, don't be scrooge McDuck!

What would be the cost of lost data, collected over days/months, or a blown out logger? 

How many customers would go elsewhere?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sat. Apr 30, 2022 - 05:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, it's an audio capture application. I am capturing audio and storing it locally continuously, which then get transmitted using wifi over to a cloud storage.

 

If I am correct in microSD the CS is active low. 

Thanks

Regards

DJ

Last Edited: Sat. Apr 30, 2022 - 05:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely the only reason for pull-up/pull-down is on lines that might float? As long as there is an SD card present they won't. So are you saying you need to cater for the case when a card is removed? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


If the Card is removed, the board will be powered off. Therefore would this be more appropriate?

Some reference designs using 10uH chip inductors on the VCC line.

 

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MicroSD chip select is active low. I always put a large value (say 100K) pull-up on that chip select because, during power up, there will always be some time when that MCU pin that drives CS will be a floating input. That will be the time during which the MCU clock stabilizes, then does the .init stuff, then what ever main() code there is before it reaches that instruction that sets the MCU CS drive pin to be a high output. And, I always take pains to insure that it never goes through a low output state before it becomes a high output. And, similar pains shutting down.  So far, I have never had an SD card problem related to power up or shut down on several hundred units.  

 

The cost of these precautions? Maybe up to two lines of code not otherwise needed. As far as I am concerned, this is really cheeeeep insurance!

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
The cost of these precautions?
The #13 below 50 cents

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.