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.

RM57L843: SCI Multi-buffered

Part Number: RM57L843


Tool/software:

Hello,

My questions are about the multi-buffered mode of the SCI.

If the SCI is configured in multi-buffered mode with 8 buffers of 8 bits, would be possible to receive a single byte?

Do RDy registers in the multi-buffered mode, work like a queue? that is, if the RD register is read, is the data in the RDy register shifted to the register (y-1)?

Best regards

Marcio

  • Hi Marcio,

    Apologies for the dealy in the response.

    If the SCI is configured in multi-buffered mode with 8 buffers of 8 bits, would be possible to receive a single byte?

    Yes, it is possible to receive a single byte using the multibuffered mode.

    To achieve this, you need to select length in SCI FORMAT register as 0 as highlighted below.

    Do RDy registers in the multi-buffered mode, work like a queue? that is, if the RD register is read, is the data in the RDy register shifted to the register (y-1)?

    No, it won't work like queue. The data will not get shift in between the RDy registers.

    --
    Thanks & regards,
    Jagadish.

  • Hello Jagadish. 

    Thank you for the response. 

    If I set the LENGTH field of the SCIFORMAT to 0, the SCI would set the RXRDY bit of the SCIFLR when a byte is copied to RD[0] and would not use the RD[1] to RD[7]. Is that correct?

    I want to detect that the SCI received 1 byte, but still want the SCI to buffer up to 8 bytes in RD[0] to RD[7], so my software can use the polling method to receive bytes without losing in 115200bps. Is it possible?

    Best regards,

    Marcio.

  • If I set the LENGTH field of the SCIFORMAT to 0, the SCI would set the RXRDY bit of the SCIFLR when a byte is copied to RD[0] and would not use the RD[1] to RD[7]. Is that correct?

    You are correct!

    I want to detect that the SCI received 1 byte, but still want the SCI to buffer up to 8 bytes in RD[0] to RD[7], so my software can use the polling method to receive bytes without losing in 115200bps. Is it possible?

    No, it is not possible!

    As shown below, the RXRDY flag will get set only after 3bit counters matches, that means after we received the LENGTH number of bytes into the buffers.

    So, it is not possible to use as queue. The main purpose of these multibuffer mode is to receive a frame of data by reducing CPU load. I mean in some situations we no need to process every byte and we can just process frame of data instead of every byte, in those situations it will  be useful.

    However, you won't get the overload issue for 115200 baudrate, because SCI module by default have a double buffering.

    If you are operating with 115200 baudrate, to receive 1 byte it will take ~80uS, but CPU can operate upto 330Mhz

    So, the CPU can easily process the data in 80uS before overrun error.

    If you still want some queue, then you can do one thing. You can use DMA, for example you can choose one DMA channel and can set source as SCIRD register and destination as some 8-buffer array. 

    Now in DMA there are two types of interrupts Block Transfer Complete (BTC) and Half Block transfer Complete (HBC) interrupt. BTC will get trigger after entire block of transfer completes, in this case after 8 bytes received, but HBC will get set after 4 bytes. So, you can use this HBC interrupt and you can process the data before the entire block get fill by DMA from SCI.

    --
    Thanks & regards,
    Jagadish.

  • Hello Jagadish. 

    Thank you very much for the response. 

    I am not familiarised with the DMA. Is it possible to use the DMA just for transferring data from the SCIRD to a buffer (for instance of 16 bytes) and then instead of using an interrupt, make the software to poll the DMA and see if the 1 or more bytes where received. If yes, do you have an example?

    Thank you.

    Marcio.

  • Hi Marcio,

    I don't have any example for this,

    However, in DMA there is a Frame transfer interrupt also, and which will set after a single frame transfer instead of Half block transfer or full block transfer.

    I think you can use this, but the challenging part is to identify the number of bytes transfer by DMA. Just try to go through the DMA completely and try to build the application for your requirement.

    If you stuck at anywhere i will try to assist you on it.

    --
    Thanks & regards,
    Jagadish.