I am using msp430f2274 to do my project, now I want the microcontroller to interface with a SD card, simply is just to write something into the SD card.
I downloaded an example code of MMC from TI, which was slac128b(if I am not wrong), and I want to modify the sample code. But I have no idea how to modify it and I dont even know whether the microcontroller can detect the SD card.
I connected the SD card and msp430 like this:
8 and 9 are not connected
GND and VCC I used the port on the board, should I use an external power supply for SD card?
And is it ok for 3 and 6 share the same GND?
anyone know how to interface with SD card please help me! Thanks !
I suspect the writes to P1OUT are to provide an observable indicator of an error on read.
What value are you getting in the buffer array? I would suggest looking at the signals to the SD card and determine if you are getting expected activity on the mmcWriteSector() and mmcReadSector().
// Write Data to MMC for (i = 0; i < 512; i++) buffer[i] = i; mmcWriteSector(0, buffer); // write a 512 Byte big block beginning at the (aligned) adress
for (i = 0; i < 512; i++) buffer[i] = i+64; mmcWriteSector(1, buffer); // write a 512 Byte big block beginning at the (aligned) adress
mmcReadSector(0, buffer); // read a size Byte big block beginning at the address. for (i = 0; i < 512; i++) if(buffer[i] != (unsigned char)i) P1OUT |= 0x04;
mmcReadSector(1, buffer); // read a size Byte big block beginning at the address. for (i = 0; i < 512; i++) if(buffer[i] != (unsigned char)(i+64)) P1OUT |= 0x08;
When I use mouse to see the content of buffer[ ] array in above code, I can see the expected results
however, if I point to the buffer[ ] where I defined it at the beginning of this program ( unsigned char buffer ;), it shows content error.
And could you please also check out another question?
Thank you very much.
Hi, I am attempting the same interfase (SD card / ez430 module), would it be possible to gain access to the code you used?
Hi, were you able to get the code working? If so, can you please tell me what hardware you used and possibly provide the source code?
I am also trying to program EZ430-RF2500 with SD card. Is it necessary to include a card detect pin?
If it does, is it the reason chip select pin shared with cc2500 so its better to implement another detector to enable SPI communication?
Is it possible to provide the source code? Thank you very much
Ben PengIf it does, is it the reason chip select pin shared with cc2500
A card detect pin is not really necessary, but it helps detecting whether a card has been inserted instead of either constantly trying to initialize one or trying once at startup and then never again.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.