OSDev.org
https://forum.osdev.org/

Using SD cards with microcontrollers; where to find good inf
https://forum.osdev.org/viewtopic.php?f=11&t=56691
Page 1 of 1

Author:  eekee [ Tue Jan 17, 2023 1:10 pm ]
Post subject:  Using SD cards with microcontrollers; where to find good inf

I want to hook up an SD card to a BBC micro:bit. (It's a tiny ARM microcontroller.) Our wiki links this OpenLab Pro page which seems to have most of the info, but has a Valles Marineris size hole in the most crucial bit of info a hardware hacker needs: which pin is which? It gives perfectly good pinout tables for SD cards, and it has nicely-written descriptions on how to connect and use them, but uses completely different pin names for each of these things. The pinouts show the data lines as DAT0 to DAT3, the descriptions exclusively refer to MISO and MOSI. The descriptions talk about the CS (chip select) line, but there is no such acronym in the pinouts. Etc, etc. I could make some guesses, but would prefer not to risk my devices over such a terrible omission in a free tutorial.

If anyone knows a forum where I can ask about this sort of thing, I'd be grateful. Actual info on the topic would be nice too, if anyone here happens to know.

Author:  Octocontrabass [ Tue Jan 17, 2023 1:45 pm ]
Post subject:  Re: Using SD cards with microcontrollers; where to find good

That page is explaining how to interface with SD cards using SPI, so you should be looking at the SPI column for the pinout, not the SD column.

I'm not sure why the article mixes names for the pins, but MISO refers to microcontroller input / SD card output, and MOSI refers to microcontroller output / SD card input. In the pinouts, you can see the SD card's DO and DI pins, which are its data output and input pins, respectively.

You may also find these specification documents useful. (If you need the full specification, you can probably "borrow" a copy using your favorite search engine.)

Author:  Cyao [ Wed Jan 18, 2023 7:34 am ]
Post subject:  Re: Using SD cards with microcontrollers; where to find good

I've got this good article about SDcards http://elm-chan.org/docs/mmc/mmc_e.html, its covers almost everything used to do read and writes. For the full list of commands, just look in the specs that Octocontrabass gove you :)

Author:  eekee [ Fri Jan 20, 2023 4:25 am ]
Post subject:  Re: Using SD cards with microcontrollers; where to find good

Octocontrabass wrote:
That page is explaining how to interface with SD cards using SPI, so you should be looking at the SPI column for the pinout, not the SD column.

I'm afflicted with a strange sort of blindness sometimes; I actually didn't see the SPI column despite looking several times. At least I've got an explanation now. I've recently found my health problems match the symptoms of cerebral hypoxia. One of the symptoms is a difficulty learning complex tasks, and that's exactly what I have. Once information is in my brain, I can use it fairly well on a good day, but my ability to take in new information is throttled.

Thanks for the explanation. Now I know it's there, I should be able to get on with it all right, for the most part. Most of what I'm trying to do isn't too complex. I'm just compiling pforth (which is written in C) with the microcontroller's standard runtime which has a ridiculously large feature set. It just lacks anything to do with mass storage and display. I guess I'll probably embarrass myself again at some point, probably when looking at the documentation for my little screen. I'll try to do it without snark next time, but I said that last time. Different issue; this one is changing a long-standing habit. It's amazing how easy it is to create snark when I'm too unwell to even read properly. Recognizing and processing new information must really use a lot of the brain's processing power.

Octocontrabass wrote:
I'm not sure why the article mixes names for the pins, but MISO refers to microcontroller input / SD card output, and MOSI refers to microcontroller output / SD card input. In the pinouts, you can see the SD card's DO and DI pins, which are its data output and input pins, respectively.

Thanks. Good to have confirmation on that.

Thanks for the links too, both of you.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/