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.

MSP432P401R: What pin to use as the Chip Select when using SDSPI

Part Number: MSP432P401R

I am working on getting an SD card to interface with the MSP432. I looked at the example code in TI Resource Explorer about using fatsd. On the Board.html file it indicates that one option to configure the PINS are as follows:

     P1.5 - CLK, P1.6 - MOSI, P1.7 - MISO, P1.4 - STE

I am trying to connect to an Arduino Micro SD Card Breakout Board. The pins on the SD breakout board are as follows:

     CLK, DataOut, DataIn, and a Chip Select.

I was able to match most of the pins from the example as follows: 

     P1.5(CLK) -> CLK

     P1.6(MOSI) -> DataOut

     P1.7(MISO) -> DataIN

I am confused on where to hook up the CS from the breakout board to the MSP432. The example says to connect the STE(which I am guessing is just another word for chip select) to pin 1.4. However pin 1.4 is one of the 3 buttons on the MSP432. What pin are they using in the example to connect the Chip Select from the SD board to the STE on the MSP432? Also is there another GPIO pin that I could use to function as the chip select?

Any help would be much appreciated!

  • Axel,

    As a part of the MSP_EXP432P401R.c file that is in the fatsd example you've mentioned. Port 4.6 is used as CS/STE. 

    const SDSPIMSP432_HWAttrsV1 sdspiMSP432HWAttrs[MSP_EXP432P401R_SDSPICOUNT] = {
        {
            .baseAddr = EUSCI_B0_BASE,
            .clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
    
            /* CLK, MOSI & MISO ports & pins */
            .sckPin = SDSPIMSP432_P1_5_UCB0CLK,
            .somiPin = SDSPIMSP432_P1_7_UCB0SOMI,
            .simoPin = SDSPIMSP432_P1_6_UCB0SIMO,
    
            /* Chip select port & pin */
            .csPin = SDSPIMSP432_P4_6_CS
        }
    };

    Since chip select is essentially pretty much just a GPIO, you can use almost any GPIO on the MSP432 for CS/STE and that's where in the project you would change it. 

  • Hey Evan,

    Thanks for the response about knowing where the CS/STE pin is located in the example code and how to change it. I was able to wire the board up correctly, however the example fatsd code is still not working. I have the following pins configured:

    P1.5 -> CLK

    P1.6 -> DO(dataout on the micro sd card breakout board)

    P1.7-> DI(datain on the micro sd card breakout board)

    P4.6 ->CS(chip select on the micro sd card breakout board)

    RX and TX pins and LED's are jumpered. 

    I have also set up a putty session so that I can see output on my PC.

    When I run the example code I get the following text on the putty terminal:

    Starting the fatsd example

    Drive 0 is mounted

    Creating a new file "fat:0:input.txt"...

    Error: "fat:0:inut.txt" could not be created

    Please check the Getting started guide if additional jumpers are necessary

    Aborting...

    I then when into the fatsd.c file and found the conditional code that gave message above. The code failed at the following point:

    /* Open file for both reading and writing */
    src = fopen(inputfile, "w+");
    if (!src) {

    Display_printf(display, 0, 0, "Error: \"%s\" could not be created.\n"
    "Please check the Getting Started Guide "
    "if additional jumpers are necessary.\n",
    inputfile);
    Display_printf(display, 0, 0, "Aborting...\n");
    while (1);}

    I went back and checked that all pins and jumpers were correctly set up and I think that they are. I'm kind of lost on why the example code is not working, any help would be much appreciated!

    Thanks!

  • What brand is your breakout board? arduino.cc doesn't seem to list one, I only found reference to the Adafruit and Sparkfun boards.

    The Adafruit DO appears to take data From the SD card To the MCU ("Slave Out" from the breakout board), which would make it MISO, not MOSI.
  • Axel,

    Would be interested to know this as well. Please let us know what board specifically you have and take Bruce's comment in mind.
  • Hey Bruce,

    Thanks for the response, that totally worked. I am using a adafruit "MicroSD card breakout board+". 

    Thanks again for the help!

**Attention** This is a public forum