sd card and quickstart board
amossam
Posts: 35
While surfing around, I noticed that you can connect SD card directly to mcu... so I give it a go!
Check attached pics for my setup, and wiring and idea I got from here...
After hardware setup, I copied quickstart.cfg to quickstartsd.cfg and added folowing lines to end of file:
"sdspi-do" is MISO on card, and "sdspi-di" is MOSI on card
to my big surprise, it worked!! tried with 2 cards, one SanDisk microSD 2GB, second one SanDisk microSDHC 8GB
is it a big problem absence of pullup resistors and 0.1uF capacitor between GND and Vcc (3.3V)?
and most important question; can I damage board with this setup??
thx
Check attached pics for my setup, and wiring and idea I got from here...
After hardware setup, I copied quickstart.cfg to quickstartsd.cfg and added folowing lines to end of file:
sd-driver: sd_driver.dat sdspi-do: 0 sdspi-clk: 2 sdspi-di: 1 sdspi-cs: 3according to this thread, and also used code from that thread to check is it working...
"sdspi-do" is MISO on card, and "sdspi-di" is MOSI on card
to my big surprise, it worked!! tried with 2 cards, one SanDisk microSD 2GB, second one SanDisk microSDHC 8GB
is it a big problem absence of pullup resistors and 0.1uF capacitor between GND and Vcc (3.3V)?
and most important question; can I damage board with this setup??
thx
Comments
Many SD cards have pull-up resistors built-in. I have a few where the pull-ups must be added - I've used 10K to 100K no problem. Typically you should add a 0.1uF decoupling capacitor between power and ground close to a component. Long and/or thin leads tend to introduce inductance that cause high frequency noise on power connections and may spill into I/Os that will may trouble over a long time, so use a capacitor if possible.
Your connections look fine to me. Your hardware should be Ok as is. Consider the capacitor for good measure.
Thx. I was surprised that worked from the second try only!!
So, I should add pull-ups between MISO and MOSI lineas and Vcc? And capacitor between GND and Vcc? Ok, will do!
Btw, jazzed, on my previous thread you mentioned another way of creating delay in C, not with usleep nor waitcnt. (quote: "There is another method that will be faster for normal C programs, but requires more code rework. ") What had you in mind? empty loops? thx
If you plan to use more than one type of SD card, put 100K pull ups on ChipSelect, MISO, and MOSI.
I've added an example in your other thread that uses waitcnt2.