We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I'm trying to communicate with a SD card on SD bus. now,I read manual LPC23xx in chapter SD/MMC card and Data sheet sandisk SD card.is it enough? Have you got any suggestion to me(or for read)? Have you got any simple piece of software that configure the card. I don't know what to do first? Thank you...
popo+
The question here is if you plan to use the SD card as a raw storage device, or if you intend to store files on it. For accessing raw sectors, it is "enough" to just send the correct commands to the memory card.
With raw sector access, you could start from scratch. Or you could look for any sample code you can find - for just about any processor - to get an idea what the commands looks like.
If the intention is to store files, then you may be better of to google for some code that contains FAT16 and/or FAT32 file system support - with some luck, you may be able to find complete code that both has SD support and file system support, so that your work will just be to port the SD access code to the specific hardware of the LPC2368 chip.
A normal SPI interface has one data line, one MOSI (Master Out Slave In) and one MISO (Master In Slave Out). So each clock transition will transfer a single bit from the memory card to the processor and the reverse.
The SD memories has a mode where they can use four data lines, transmitting a nibble at a time. This is obviously four times faster for a given clock frequency, but will require that you either implement the bit transfers in software, or select a processor with specific support for SD cards.
Your specific processor can run four bits concurrently.
That is, A normal SPI interface has one data line in each direction
The sentence was actually intended to read: "A normal SPI interface has one clock line, one MOSI (Master Out Slave In) and one MISO (Master In Slave Out)."
"one clock line, one MOSI (Master Out Slave In) and one MISO (Master In Slave Out)."
and, in some cases (including the SD card), a Slave-Select (SS) line.
aka "Chip Select".
Yes, a slave select is needed for the slave side to be able to synchronize the bit sequence.
However, a number of SPI controllers do not have a dedicated slave-select signal in master mode and requires you to use a normal GPIO signal. For slave mode, the controller should have a dedicated slave-select line.
Requiring the master to use GPIO signals instead of a dedicated slave-select pin allows the master to have multiple slaves connected. The master may then select which slave to communicate with. And if only the MOSI signal is used, i.e. no data is sent from slave to master, then the master may activate multiple slave-select signals and send the same information to multiple slaves.