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.

TMS320F28388D: SPI Pull High the CS Line for a Cycle with Transmit Delay?

Part Number: TMS320F28388D


Hi all!

I am trying to send data with SPI and tx fifo. Basically I just wanna pull the CS high and stop the clock for a cycle between each sendings. Thus I tried to put transmit delays but I didn't get what I want.

When I add 1 cycle delay then CS stays high for half cycle. When CS low again then clk start after 1.5 Half cycle. To sum up; Clk stops for 2 cycle and CS stays high for half cycle between each sending when the transmit delay is 1 cycle.

Similarly, Clk stops for 3 cycle and CS stays high for 1.5 cycle between each sending when the transmit delay is 2 cycle

Can I just stop the clock and pull the CS high for one cycle between each sendings?

Thanks in advance.

My spi init code example.

SPI CLK is 1MHz 16 bit data length and the data is 0xaaaa

void initSPIFIFO()
{
    //
    // Must put SPI into reset before configuring it
    //
    SPI_disableModule(SPIA_BASE);

    //
    // FIFO configuration
    //
    SPI_enableFIFO(SPIA_BASE);
    SPI_clearInterruptStatus(SPIA_BASE, SPI_INT_RXFF | SPI_INT_TXFF);
    SPI_setFIFOInterruptLevel(SPIA_BASE, (SPI_TxFIFOLevel)FIFO_LVL,
                             (SPI_RxFIFOLevel)FIFO_LVL);
    SPI_setTxFifoTransmitDelay(SPIA_BASE, 1);


    //
    // SPI configuration. Use a 1MHz SPICLK and 16-bit word size.
    //
    SPI_setConfig(SPIA_BASE, DEVICE_LSPCLK_FREQ, SPI_PROT_POL0PHA0,
                  SPI_MODE_MASTER, 1000000, 16);
    SPI_enableModule(SPIA_BASE);
}

Fig 1: No Tranmist Delay

Fig 2: 1 Cycle Transmit Delay

Fig 3: 2 Cycle Transmit Delay

  • Erhan,

    When I add 1 cycle delay then CS stays high for half cycle. When CS low again then clk start after 1.5 Half cycle. To sum up; Clk stops for 2 cycle and CS stays high for half cycle between each sending when the transmit delay is 1 cycle.

    Whenever CS is pulled low, with even BRR, you will have 1.5 SPI CLK delay from CS. This is defined in datasheet in td(SPC)M Delay time, SPISTE active to SPICLK in Table 7.13.7.1.1.2 SPI Master Mode Switching Characteristics (Clock Phase = 0

    This is the expected behavior. You don't have anyother way to get around this.

    Can I just stop the clock and pull the CS high for one cycle between each sendings?

    No, you cannot.

    Regards,

    Manoj