This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

sd card

Other Parts Discussed in Thread: MSP430F5529

I need to interface msp430f5529 with a SD card. I of course will use the new HAL_SDcard, but I miss two things:

1) which is the best configuration in terms of connection between MSP430 pin and SD card PIN.

2) how can I use the function in HAL_SDCard in a main (project); I mean, have I got to take into account some delays or a specific sequence of instruction?

many thanks

  • HI,

    I am assuming that you are meaning the HAL_SDCard.c file that is included with the MSP430F5529 Experimenter board.

    1) At the beginning of the file there are a number of definitions:

    // Pins from MSP430 connected to the SD Card
    #define SPI_SIMO BIT1
    #define SPI_SOMI BIT2
    #define SPI_CLK BIT3
    #define SD_CS BIT7

    // Ports
    #define SPI_SEL P4SEL
    #define SPI_DIR P4DIR
    #define SPI_OUT P4OUT
    #define SPI_REN P4REN
    #define SD_CS_SEL P3SEL
    #define SD_CS_OUT P3OUT
    #define SD_CS_DIR P3DIR

    These show the MSP430 port pins that need to be connected to the SD card pins for the software to operate correctly.
    If you need to change this assignment it may be possible but for the routines in this file to operate you must use one of the USCI ports that supports SPI, and if you change the hardware port from USCI_B1 to another port you will need to change the software to use a different port.

    2) This file is simply a low level driver that provides routine to initialize the interface and to read or write a buffer of data to/from the card. The routines look to be self contained and the read and write routines loop over the complete buffer and do not return until all of the data has been transferred, so you do not need to bother about any specific delays, at the level of these routines. However the way in which you call these routines, the rate at which you call them, and the data that you put into the buffers, all need careful consideration about what you are trying to achieve, and the properties of the SDcard you are using.

    Studying the way this file is used in the User Experience Demo code should point you in the right direction.

    Regards
    Roy

**Attention** This is a public forum