OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 12:21 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Using SD cards with microcontrollers; where to find good inf
PostPosted: Tue Jan 17, 2023 1:10 pm 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
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.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
 Post subject: Re: Using SD cards with microcontrollers; where to find good
PostPosted: Tue Jan 17, 2023 1:45 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5103
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.)


Top
 Profile  
 
 Post subject: Re: Using SD cards with microcontrollers; where to find good
PostPosted: Wed Jan 18, 2023 7:34 am 
Offline
Member
Member

Joined: Tue Jun 07, 2022 11:23 am
Posts: 78
Location: France
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 :)

_________________
https://github.com/cheyao/Achieve-Core


Top
 Profile  
 
 Post subject: Re: Using SD cards with microcontrollers; where to find good
PostPosted: Fri Jan 20, 2023 4:25 am 
Offline
Member
Member
User avatar

Joined: Mon May 22, 2017 5:56 am
Posts: 812
Location: Hyperspace
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.

_________________
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group