The Serial Asynchronous Communication Interface UART (Universal asynchronous transceiver) is commonly used in full-duplex Serial Asynchronous Communication.
UART consists of transmitters, receivers, control units, and baud rate generators.
The sender is responsible for sending characters, either in FIFO mode or in normal mode. The sent characters are first sent to the buffer register, and then sent to the control unit in one-bit sequence through the txdn pin through the shift register. In FIFO mode, the message is sent only when all n Bytes are in place. Different embedded processing chips have different set N values. When querying the sending method, you must wait until the sending buffer is empty to send the next data. Sending interruption occurs only when the sending buffer is empty. Therefore, you can send the next or next group of data (in FIFO mode) directly in the sending interruption service program ).
The transceiver is responsible for receiving incoming characters, either in FIFO or normal mode. The characters sent from outside enter the receiving shift register through the rxdn pin. under the control of the control unit, one-bit and one-bit data is transferred to the receiving buffer register. In FIFO mode, only when the buffer period expires will the receiving interrupt and reset the bit sign. In normal mode, when one character is received, the receiving interrupt will be triggered and the flag will be generated.
The status of the receiving and sending buffers is recorded in the UART Status Register, such as usrstatn. By reading its status bit, you can see whether the status of the current receiving or sending buffer meets the receiving and sending conditions.
Serial Asynchronous Communication Interface