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.

TMS320F28335: Triple-buffered reception of the McBSP interface is not working because the RRDY flag does not signal the second stored SPI character in the triple buffer

Part Number: TMS320F28335


Hello everyone,

I have the following setup:

  • TI TMS320F28335
  • CCS 10.4
  • Compiler: 21.6.0.LTS

I have the following goal:

  • usage of the McBSP-A interface as SPI without DMA
  • highest SPI performance (continues data stream on SPI)
  • usage of the double-buffered transmission and triple-buffered reception functionality of the McBSP

I have the following test case:

  • activating the loopback mode of the McBSP
  • transmitting of 2 SPI characters without reading them back from the receive buffer
  • delay the program to make sure that both character were received by the receive buffer (triple-buffer)
  • read the first received SPI character from receive buffer
  • read the second received SPI character from receive buffer

I have the following problem:

The triple-buffer reception is not working because the RRDY flag is not reset when the triple-buffer contains two received SPI charaters as shown in the following code snipped:

    /* activate the loop back mode */
    McbspaRegs.SPCR1.bit.DLB = 1U;

    /* wait for the transmitter to be ready for the first character */
    while (0U == McbspaRegs.SPCR2.bit.XRDY);
    /* write first 16-bit to transmit buffer */
    McbspaRegs.DXR1.all = 0x1122U;

    /* wait for the transmitter to be ready for the second character */
    while (0U == McbspaRegs.SPCR2.bit.XRDY);
    /* write second 16-bit to transmit buffer */
    McbspaRegs.DXR1.all = 0x3344U;

    /* delay for 1ms to simulate an interruption by an interrupt or a high priority task */
    <1ms delay>;

    /* wait until the first transmitted character has been received */
    while (0U == McbspaRegs.SPCR1.bit.RRDY);
    charRx_u16 = McbspaRegs.DRR1.all; /* 0x1122 is read (RRDY goes to 0 and stays there 
                                         (does not report the second received character) */

    /* wait until the second transmitted character has been received */
    while (0U == McbspaRegs.SPCR1.bit.RRDY); /* !!! hangs here forever (althoug!!! */
    charRx_u16 = McbspaRegs.DRR1.all; /* expect to read 0x3344 */

I have the following expectation:

Like described in the TI reference guide "SPRUFB7B" the RRDY shall signal the second received character in the triple-buffer:

Thanks in advance for your support!

Regards,

Matthias