The UART module has the ability to operate in the loopback mode. This mode allows performing the corresponding self-tests. In order that the UART module operates in the loopback mode, it is required that the LPBACK (UxMODE<6>) control bit is set. In this mode the UxTX output is internally connected to the UxRX input, and the UxRX pin is disconnected from the internal UART receive logic. However, the UxTX pin still functions normally. Sending a message by the UART transmitter causes the reception of this message by the UART receiver. This allows checking if the UART module functions correctly.
To configure the UART module to operate in this mode, the following steps should be taken: