Universal Synchronous/Asynchronous Receiver/Transmitter (USART/UART, "yoo-sart"/"yoo-art") is a serial communication protocol for symmetric communication between two devices. It is used for a variety of applications across computing, but on EVT, we primarily use it for text-based communication between microcontrollers (uCs) and laptops. For this purpose, we created what is known as the logger. The logger is a powerful tool for organizing and transmitting serial communication messages via UART. It provides a way to handle debugging, information, warnings, and errors by assigning each message a specific log level. This system allows us to control the amount of detail of the output, ensuring that only the most relevant data is transmitted. UART is very similar to USART, except that it doesn't support synchronous communication. For our purposes, synchronization isn't necessary, so we normally use UART instead of fully implementing USART. For the most part, though, the terms can be used interchangeably. More information about USART/UART can be found on Wikipedia.
Electrically, UART is the simplest of the communication protocols we use. It consists of only two wires, TX and RX, used for transmitting and receiving, respectively. The TX line of one device should always be connected to the RX line of another device, and vice versa. This can sometimes be confusing if you connect multiple cables together because some may swap TX and RX, while others may not. If you're having UART issues, it's always worth taking a moment to flip these wires to check that you haven't made a mistake. As in most applications, the two devices must be connected to the same ground (GND) to interpret each other's signals properly.
Data sent over UART is packaged into frames. Each frame represents a single byte with the bits sent least significant first. Because there is no clock signal, both devices on the network must agree on the timing of the data sent, so they can understand each other. This timing is set by establishing a common baudrate, or switching speed. If you're having trouble getting UART, be sure to check that the devices' baudrates are matching. Two common baudrates we frequently use on the team are 9600 and 115200.
Below is a screenshot from Logic, the Saleae logic analyzer software. See Saleae Logic Analyzer for more information. The screenshot shows the signals on one wire of UART communication between two devices, reading out "Hello Saleae." To get Logic to interpret the data correctly, you will have to put the proper baudrate into the settings.