HI,
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:
1------->P3.0(UCB0STE)
2------->P3.2(UCB0SOMI)
3------->GND
4------->VCC
5------->P3.3(UCB0CLK)
6------->GND
7------->P3.1(UCB0SIMO)
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().
Brandon
// 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[512] ;), it shows content error.
And could you please also check out another question?
http://e2e.ti.com/forums/p/12466/48541.aspx#48541
Thank you very much.
regards.
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?
Hi,
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
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.