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.

TMS570LS1227: the use of SCI multi-buffer

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN, TMS570LS1224

Dear team,

The customer is currently debugging the SCI multi-buffer of TMS570LS1227.

According to the specification, the sci of the LS1227 chip has an 8-byte buffer.

Set bit10 in GCR1, which is mbuf mode, to 1, and write all bits 16-bit18 of SCIFORMAT register to 1 to achieve multi-buffer function.

He tried to change GCR1 and SCIFORMAT ,but the parameters cannot be modified.

As the following code in sciInit:

/** - global control 1 */
sciREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 10U) /* mbuf mode */
| (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */
| (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */
| (uint32)((uint32)0U << 3U) /* even parity, otherwise odd */
| (uint32)((uint32)0U << 2U) /* enable parity */
| (uint32)((uint32)1U << 1U); /* asynchronous timing mode */

/** - transmission length */
sciREG->FORMAT = ((8U - 1U) | 0x70000U); /* length */

But after the function exits, bit10 of GCR1 is still 0 and the value of FORMAT is still 7. Why?


In addition, the specification does not introduce how to read the RD register when the muti-buffer mode is in the muti-buffer mode. Is the RD register read continuously after the RDY is detected?

BR,

Susan 

  • Hello Susan,

    TMS570LS1224 has two SCI modules: LIN/SCI, and SCI. The HALCOGen calls LIN/SCI as SCI2, and another is called SCI.

    LIN/SCI module supports multi-buffered mode, but another SCI module don't support multi-buffered mode. 

    The multi-buffered mode is mainly used to reduce CPU load when receiving or transmitting data in interrupt mode or DMA mode. 

    A RX interrupt and a RXRDY flag, as well as a DMA request (RXDMA) could occur after receiving data. The user needs to read all the data from linREG->RDx registers. I prefer to use DMA.

  • Thanks for your reply.

    Do we have any example code about the multi-buffered mode?

  • Besides,sci/lin can send data normally, but when I set the MBUF MODE of GCR1 to 1, the serial debugging assistant cannot receive data.

       /** - global control 1 */
    
       scilinREG->GCR1 = (uint32)((uint32)1U << 25U)  /* enable transmit */
    
                       | (uint32)((uint32)1U << 24U)  /* enable receive */
    
        | (uint32)((uint32)1U << 10U)  /* mbuf mode */
    
                       | (uint32)((uint32)1U << 5U)   /* internal clock (device has no clock pin) */
    
                       | (uint32)((uint32)(1U-1U) << 4U)  /* number of stop bits */
    
                       | (uint32)((uint32)0U << 3U)  /* even parity, otherwise odd */
    
                       | (uint32)((uint32)0U << 2U)  /* enable parity */
    
                       | (uint32)((uint32)1U << 1U);  /* asynchronous timing mode */
    
       /** - set baudrate */
    
       scilinREG->BRS = 520U;  /* baudrate */
    
       /** - transmission length */
    
       scilinREG->FORMAT =( 8U - 1U)|(7<<16);  /* length */

    In user's guide

    29.5.2.2 Transmitting Data in Multi-Buffer Mode
    Multi-buffer mode is selected when the MBUF MODE bit in SCIGCR1 is set to 1. Like single-buffer mode,
    you can use the polling, interrupt, or DMA method to write the data to be transmitted. The transmitted data
    has to be written to the SCITD registers. SCI waits for data to be written to the SCITD register and
    transfers the programmed number of bytes to SCITXSHF to transmit one by one automatically.

  • Hi Susan,

    The TD and RD registers in multi-buffer mode is LINTD[1:0] and LINRD[1:0].

    Please refer to this app note:

    https://www.ti.com/lit/an/spna213/spna213.pdf?ts=1596649942063&ref_url=https%253A%252F%252Fwww.google.com%252F