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.

How to receive data from UART during sending data out?

Dear friends,

I want to know how to receive data from UART during sending data out?  The MCU needs to send data out through UART continually and the other side may send some data back to MCU. In this case, the MCU usually loses the coming data when it sending data out. Does anyone know how to send data and never lose the coming data of UART? Thank you.

Sunglin.

  • Sunglin Chen said:
    the MCU usually loses the coming data when it sending data out.

    If you do everything right, everything is ok. So please tell which msp430 you use, how you send and receive UART data?

  • If the MCU is much faster then the UART data-rate, this can be done. Usually, using interrupt is the easiest way.

    When you continuously send data out through UART, you do not need to occupy the MCU  continuously to do that. It only needs to put the next byte into the hardware transmit buffer whenever the buffer is ready for the next byte.

    When the UART received a byte, that byte sits in another hardware buffer waiting for the MCU to take care of it. That byte will be lost only if the MCU waited for too long and the UART already received another byte.

    What is the data-rate you operate the UART? What is the MCU speed and what else must it do during this?

  • i also think problem can be solve using UART interrrupt

**Attention** This is a public forum