Main Content

UART/USART

Use the UART/USART parameters to configure the UART/USART# module.

You can set these parameters to configure the UART/USART.

Configure UART/USART#

Select the USART/UART module to configure.

Transmit mode

Select one of the following parameters of transmit mode to configure USART/UART module. By default, Buffered mode using TXE interrupt is selected.

  • Buffered mode using TXE interrupt

  • Buffered mode using DMA

  • Polling mode

Note

Ensure in polling mode that the data register is read faster to prevent overrun.

Receive mode

Select one of the following parameters of receive mode to configure USART/UART module. By default, Buffered mode using RXNE interrupt is selected.

  • Buffered mode using RXNE interrupt

  • Buffered mode using DMA

  • Polling mode

Transfer buffer length

Specify the transfer buffer length.

Receive buffer length

Specify the receive buffer length.

Stop receiving data on error until erroneous data is read

Select to stop receiving data on error until erroneous data is read.

In case of Buffered mode using RXNE and Buffered mode using DMA, if error flag is set while receiving the data, we have two options:

  • When Stop receiving data on error until erroneous data is read parameter is disabled, the receiving of data will continue, but the error bit will be set in status output of the next time step read operation itself irrespective of whether the error byte is read from the buffer in that time step or later.

    Using this option, we might not know which time step actually reads and outputs the error byte from the buffer, if reading of data happens at a slower rate.

  • When Stop receiving data on error until erroneous data is read parameter is enabled, DMA/interrupt will be disabled if any error byte is received till that error byte is read from the buffer.

    This option will lead to loss of any data transmitted between receiving of an error byte and reading it from the buffer, if reading is happening at a slower rate in the model.

    However using this option ensures that the error bit will be set in status output only when error data is read from the buffer