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.

MSP432E401Y: Asserting slave select pin ( FSS) manually in Legacy SPI Mode

Part Number: MSP432E401Y

Hello,

I'm trying to access a Flash Memory chip in SPI Legacy ( Motorola) mode.

my Problem is that i need to keep the FSS Pin asserted as long as the transmission is ongoing.

here is an example i used for a Microchip µC:

FRAM_CS_IO = 0;  // Assert chip
_Send(FRAM_CMD_RDSR); // Send Command
Dummy = _Get(); // Get Status register contents
FRAM_CS_IO = 1; // deassert chip

// Ti Setup:
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    MAP_GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    MAP_GPIOPinConfigure(GPIO_PA3_SSI0FSS);
    MAP_GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
    MAP_GPIOPinConfigure(GPIO_PA5_SSI0XDAT1);
    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_3 |
                                           GPIO_PIN_4 | GPIO_PIN_5));

    MAP_SSIConfigSetExpClk(SSI0_BASE, g_ui32SysClock, SSI_FRF_MOTO_MODE_0,
                           SSI_MODE_MASTER, (g_ui32SysClock/24), 8);
    MAP_SSIEnable(SSI0_BASE);

// Requesting Status Register from Flash:
 MAP_SSIDataPut(SSI0_BASE, FLASH_CMD_RDSR);

    ii = 0;

    /* Wait for the data to be transmitted out of the SSI0 by checking on
     * the busy status from the SSI controller*/
    while(MAP_SSIBusy(SSI0_BASE));

    /* Flush the Receive FIFO as the data shifted in is not a valid
     * response from the slave yet */
    while(MAP_SSIDataGetNonBlocking(SSI0_BASE, &getResponseData));

    /* Send the polling request to see if the slave responds when it is
     * ready with the response packet */
    MAP_SSIDataPut(SSI0_BASE, sendDummyData);
    MAP_SSIDataGet(SSI0_BASE, &getData[ii]);

  • Hello Simon,

    Can you help me understand the question? The following is what the TRM says:

    This means that if you transmit using any of the Freescale SPI Frame Formats (from the code, looks like you are using Freescale SPI Frame Format), the FSS pin will be asserted.

    Thanks,

    Sai

  • Hi,

    actually its not pulled low the entire transmission, it get up high after 1 byte is sent out.

    I can not use the automatic FSS mode, so i changed over to a manual way, by configuring the Pin as GPIO output and doing this manually.

    But i got another Problem, the Clock Output signal is very weak, and the answer of the SPI Flash Memory is not reliable.

    It gets even worst if i connect the scope to the clock line.

    Is there a way to get more power out of the Clock Pin?

    Or are there any Pull Ups or downs connected internally?

        // Flash SPI0
        ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    
        //MAP_GPIOPinConfigure(GPIO_PA3_SSI0FSS);  // Automatic slave select
        GPIOPadConfigSet(GPIO_PORTA_BASE,GPIO_PIN_3,GPIO_STRENGTH_10MA,GPIO_PIN_TYPE_OD);
        ROM_GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3, GPIO_PIN_3); // Set High
        ROM_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_3); // SLave select
    
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
        MAP_GPIOPinConfigure(GPIO_PA2_SSI0CLK);
        MAP_GPIOPinConfigure(GPIO_PA4_SSI0XDAT0);
        MAP_GPIOPinConfigure(GPIO_PA5_SSI0XDAT1);
    
        // Manual slave select
    //    MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_3 |
    //                                            GPIO_PIN_4 | GPIO_PIN_5));
    
        MAP_GPIOPinTypeSSI(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5));

  • After adding a series resistor (33 R) on the SPI clock line the signal gets better.

    I count the errors in software and get 347 errors of 4084023 messages, so 0,008% error rate, can this be better?
  • Please confirm that you are running the SPI at 5Mhz and that the GPIO is in the high output mode.  

    Adding a series resistor and seeing improvement in the signal quality would suggest that you are seeing some transmission line issues like reflections.  Can you lower the speed to see if the waveform improves?

    Chris

**Attention** This is a public forum