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 !
The following application note Interfacing the MSP430 With MMC/SD Flash Memory Cards (SLAA281) is available to illustrate the connection and provides example software. This is built for a MSP430x1xx family device, but should be applicable.
In this scenario, the MSP430 will be configuring the USCI interface as a SPI Master. Unfortunately, the UCB0STE does not function as a chip select in this mode. Therefore, you will need to implement the chip selection functionality with the P3.0 pin as a GPIO. I would also suggest the following pin connections based on the application note.
1------->P3.0(UCB0STE)2------->P3.1(UCB0SIMO)3------->GND4------->VCC5------->P3.3(UCB0CLK)6------->P3.67------->P3.2(UCB0SOMI)
I suggested using P3.6 as GPIO for the CD (Card Detect). I don't know if you need the P3.6/A6 for another purpose, so then you can use a different GPIO.
Brandon
ForzaJuve: I noticed that P3.6 does't have a hole for pin connection on the board, I am using EZ430-RF2500, then how should I connect 6 to P3.6?
I noticed that P3.6 does't have a hole for pin connection on the board, I am using EZ430-RF2500, then how should I connect 6 to P3.6?
I simply suggested P3.6 as a potential option, knowing nothing about the constraints of the board you were using.
Looking at the eZ430-RF2500 schematics found in the User's Guide for the kit, it appears P2.0 is available on the expansion connector point.
Keep in mind, that the SPI connection on this board is also connected to the CC2500 radio. You will likely need to use a different GPIO instead of P3.0 for the chip select. Activating P3.0 for the chip select would address the on-board CC2500.
ForzaJuve: And once I finish the connection how should I set P3.6, I found P3.6 does not have a GPIO function.
And once I finish the connection how should I set P3.6, I found P3.6 does not have a GPIO function.
I disagree. P3.6 is the GPIO function. It is multiplexed with the ADC10 analog input A6. However, the Port 3 pin schematic for P3.6 is described in the MSP430F2274 datasheet on page 70.
Yes. I would suggest configuring this pin as P2.0 (General Purpose Input) to use as your detection mechanism of a card.
Hi Brandon,
Thank you for your reply!
I noticed that P3.6 does't have a hole for pin connection on the board, I am using EZ430-RF2500, then how should I connect 6 to P3.6? And once I finish the connection how should I set P3.6, I found P3.6 does not have a GPIO function.
Regards.
so, you mean I can also use P2.0 /A0 as Card Detect ?
I configured P2.0 as below
in hal_MMC_hardware_board.h file:
#define MMC_CD_PxIN P2IN#define MMC_CD_PxDIR P2DIR#define MMC_CD 0x01
in mmc.c file:
MMC_CD_PxDIR &= ~MMC_CD;
however it seems the SD card is still not able to be detected
What is the value you ae getting on P2.0?
P2IN is 0x01, any other value?
Now I am just trying to get the size of the SD card
the program stays here: while ((mmcPing() != MMC_SUCCESS)); // Wait till card is inserted
which means the card is not detected
Are you able to observe the pin on an oscilloscope, or possibly DMM to see any change in state?
I connected MSP430F2274 and SD card as the image shows, I want to know is it ok to connect them directly, or do I need other components like resistors or an external battery to drive SD card?
By the way, I used oscilloscope to monitor P2.0, there was no signal.
Problem settled! Thank you very much! Now the card can be detected!
Out of curiosity, what was the issue?
I made a silly mistake, P2.0 is the pin to detect card, P3 on the expansion connector is P2.0 but I connected to P2
Maybe you already found someting like this out or you're writing raw to the SD-card. I've used this, not for a TI processor but it's said to work with them as well: http://elm-chan.org/fsw/ff/00index_e.html
A filesystem that supports up to FAT32 and is really small.
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS 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. 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.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.