UART is a hardware communication protocol that uses asynchronous serial communication with configurable speed. Asynchronous means there is no clock signal to synchronize the output bits from the transmitting device going to the receiving end.
It uses 2 cables, RX and TX. In the first device we will transmit with TX, and receive with RX. In the second device will happen the same, but the TX of the first device will be connected to the RX of the second device.
It is an asynchronous communication, that is each device has their own clock. The communication relays that they have the same internal clock speed, that is the baud rate. The allowed values of baud rate are: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1000000, 1500000.
Data transmission
- It starts with a Start Bit that is low for 1 clock cycle.
- The data frame is LSB first, and 8 bits long.
- Paarity bits (optional)
- Stop bit, put the signal in high voltage for 1 bit.
Implementation from NANDLAND. It is a simple implementation of 8 bits of data frame, without parity check and 1 stop bit.