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.

TM4C1290NCPDT: SSI communication

Part Number: TM4C1290NCPDT

Hi,

I am using TM4C1290NCPDT customized board. External EEPROM(M95040) read/write not working using SSI2 for communication.

  MAP_SSIConfigSetExpClk(SSI2_BASE, ui32SysClock, SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, 2000000, 8);

Using Manual Chip select PH0, GPIOPinWrite(GPIO_PORTH_BASE, GPIO_PIN_0, GPIO_PIN_0); will it required to make chipselect high low every 8 bit?

Read always getting 0, I have noticed after read instruction & address clock not generated. What could be the reason.

Here I attached signals for reference. 

Kindly help.

Thaniks.

  • HI,

      During read, I don't see the clocks for the data byte in your read waveform. You need to check your code to make sure that it drives 8 more SPI clocks for the data. See below M95040 timing diagram.

      

  • Hi,

    Read needs some dummy data transfer as per TM4C1290 data sheet so we done now , we are getting some data but data not consistent.

     MAP_SSIDataPut(SSI2_BASE, 0x00); //dummy write
    if(SSIDataGetNonBlocking(SSI2_BASE, &uData))
    {
    *bptrReturnValue = (BYTE)(uData);
    bRetVal = 1;
    }
    else
    {
    // Dummy bit is not zero, ERROR
    }

    While dummy write I could see the data in data register but sometimes 0.Any issue with clock or delay needed.

    kindly help.

  • Hi,

      Before you read, please try to first clear out the RXFIFO. See below instruction. This is to make sure the RXFIFO is empty and you are not reading any unwanted junk. 

    //
    // Read any residual data from the SSI port. This makes sure the receive
    // FIFOs are empty, so we don't read any unwanted junk. This is done here
    // because the SPI SSI mode is full-duplex, which allows you to send and
    // receive at the same time. The SSIDataGetNonBlocking function returns
    // "true" when data was returned, and "false" when no data was returned.
    // The "non-blocking" function checks if there is any data in the receive
    // FIFO and does not "hang" if there isn't.
    //
    while(SSIDataGetNonBlocking(SSI0_BASE, &pui32DataRx[0]))
    {
    }

  • while(SSIDataGetNonBlocking(SSI0_BASE, &pui32DataRx[0]))
    {
    } same API only I am using to read data .Is it used to clear receive FIFO? 

    void
    SSIDataGet(uint32_t ui32Base, uint32_t *pui32Data) not have major changes with above API only while loop wait is not there.

    Kindly confirm which one needs to use.

  • What I'm saying is below:

    while(SSIDataGetNonBlocking(SSI2_BASE, &pui32DataRx[0])); // Add this line to clear out RXFIFO before putting out dummy data on TX line.

    MAP_SSIDataPut(SSI2_BASE, 0x00); //dummy write
    if(SSIDataGetNonBlocking(SSI2_BASE, &uData))
    {
    *bptrReturnValue = (BYTE)(uData);
    bRetVal = 1;
    }
    else
    {
    // Dummy bit is not zero, ERROR
    }