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.

CCS/EK-TM4C1294XL: EK-TM4c1294xl: SPI Rx FIFO

Part Number: EK-TM4C1294XL

Tool/software: Code Composer Studio

Connected and configured  SPI on EK-TM4c1294xl to communicate with a slave device. Slave returns data. Rx FIFO indicates data is received. Issue: no data is read from FIFO by statement

SSIDataGet(SSI2_BASE, &pui32DataRx[ui32Index]);

Variable Window

  • Hi,

      First of all, did you try to attach some screenshot images? It is not visible.

      What data did you read on pui32DataRx? What was the expected data? Are you in interrupt mode or polling mode? Are you saying that RXRIS bit was set before you call SSIDataGet()?

  • I'd like to send some captures of the debugger screen. What image file type should I used and where in the Forum page may place it. this edit box won't accept Windows Snipping Tool cut and paste.

    This is what I've got:
    Before SPI transmission (I'm monitoring it on my scope),
    Register SSI_SR, bits SSI_SR_RNE and SSI_SR_RFF = 0
    After SPI one byte transmission (Scope shows MISO--Slave xmission)),
    SSI_SR_RNE=1 and SSI_SR_RFF = 0
    The following stament
    SSIDataGet(SSI2_BASE, &pDataRx);
    returns (Monitored in the Expression Window)
    pDataRx=0

    Code (Peripheral Setup done based on examples in Workshop):
    //Configure the SPI port on SSI2
    SSIConfigSetExpClk(SSI2_BASE, ui32SysClkFreq,
    SSI_FRF_MOTO_MODE_1,SSI_MODE_MASTER, 1000000, 8);//

    //initialize LTC2894 mem for reading (Note: No SSIBusy(SSI2_BASE) allowed)
    SSIDataPut(SSI2_BASE, 0x03);
    SSIDataPut(SSI2_BASE, 0x00);//MSB address xferd
    SSIDataPut(SSI2_BASE, 0xf0);//LSB address xferd

    //Keep CS asserted for as long as the # of bytes to read
    SSIDataPut(SSI2_BASE, 0x00);//one byte to read
    //Wait until dummy data transmits
    while(SSIBusy(SSI2_BASE)) {};
    //Read RxFIFO
    SSIDataGet(SSI2_BASE, &pDataRx);//&pui32DataRx[ui32Index]);
  • Hi Bide,

    When you reply you will see at the lower right corner that says "Use rich formatting" like below screenshot. Click on it and attached the screenshot via the Insert/Edit Media. 

    The pDataRx is a pointer to your data array. Are you saying only the fist element of the array is 0 or all elements are zero? Since the SSI is duplex, while you transmit 4 data out (you had 4 SSIDataPut() calls) you should receive 4 data in the receive FIFO. On your scope do you see the correct data being returned by the slave on the RX pin?

  • OK, issue solved! I was unclear about the mechanism of the duplex operation. Now I found why my statement for reading the FIFO was an issue. Note: pDataRis actually a single-value variable, not an array. I replaced it with an array that received the result of N reads from the FIFO. N=#of RX bytes.

    FYI: The first 3 bytes xmtd by SSIDataPut() to Slave are really setup data; so, Rx line remains 0 for 3 bytes. The Slave xmtd a single byte-0x55--for the last byte sent by SSIDataPut(). I wasn't expecting the first 3 0s in the Rx FIFO, due to the duplex mechanism.

    Org--MOSI (Master)

    Grn--MISO (Slave)

  • Hi Blde,
    Glad your problem is solved. You are correct that you will receive four data in the receive FIFO as I explained. As you noted the first 3 data will be of no significance and you can treat them as dummy data returned by the slave. Only the fourth data is the real returned data.

    If you question is answered can you please click the 'Verify Answer' button to close the thread? Thanks.
  • What's the procedure to reopen this thread? Later, I will use DMA for SPI comm and may need to continue this dialogue.
  • Hi Blde,

    I thought your question about SPI FIFO is answered and ask for you to close the thread if no further questions. You can always open a new thread to discuss new subjects, i.e. DMA related. If you want to keep this thread open it is also fine.