# UART

UART, short for Universal Asynchronous Receiver-Transmitter, is a fundamental serial communication protocol widely used in electronics. The Binho Mission Control app facilitates seamless interaction with the UART protocol, providing users with an intuitive interface for setting up and executing UART communication.&#x20;

## **Command Panel Overview**

When the UART protocol is selected and activated, the Command Panel is divided into three main sections: **Bus Voltage**, **Settings**, and **Transactions**.

<figure><img src="https://1059373410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHsTSGN4n74wHqBYxgF3t%2Fuploads%2FSWyzXNCTyx4M3Ve8PPWA%2FUART_panel_1.png?alt=media&#x26;token=cec8edad-1be9-4ee5-874c-d5cee3eb59f5" alt=""><figcaption><p>Screenshot of the UART command panel</p></figcaption></figure>

### **Bus Voltage**

This section allows users to configure and monitor the UART bus voltage. It includes the following functionalities:

* **Set Voltage**: Users can set the bus voltage (from 1.2 V to 3.3 V) by specifying the desired value.
* **Measure Voltage**: Measure the current voltage on the bus.
* **Use External Voltage**: Select an external voltage source for powering the UART bus.\*

### Settings

The Settings section provides options for configuring key UART parameters, allowing users to adjust the communication to match the requirements of their target devices:

| Parameter | Admitted Values                           | Description                             |
| --------- | ----------------------------------------- | --------------------------------------- |
| Baudrate  | 11 available values (e.g., 115200, 19200) | Communication speed in bits per second. |
| Parity    | Even, Odd or No Parity                    | Error-checking mechanism.               |
| Data Size | 7 bits or 8 bits                          | Number of bits per word.                |
| Stop Bits | 1 or 2                                    | Number of stop bits.                    |
| RTS/CTS   | Enabled, Disabled                         | Hardware flow control option.           |

**Example**: In the provided screenshots, one configuration uses a baud rate of 115200 bps with even parity while another uses 19200 bps, odd parity, and 8-bit data size (see below).

### Transactions

The Transactions section is where users define and execute data transfers between the UART interface and the connected device. It includes:

* **Write Buffer**: Input field for specifying the data to send (e.g., `1A.2B.3C.4D`).
* **Transfer Button**: Executes the data transmission.
* **Incoming Data**: When a target sends data to the host adapter, is received as a notification shown in the BMC App's transaction log.

<figure><img src="https://1059373410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHsTSGN4n74wHqBYxgF3t%2Fuploads%2FFfSOoifVgTzBfbmm1ve3%2FUART_panel_2.png?alt=media&#x26;token=7ebf111d-7bdc-4710-aab8-9e53bf5224fe" alt=""><figcaption><p>Another screenshot of the UART panel</p></figcaption></figure>

## Real-world Example

### **Echo/Loopback Test**

A loopback test involves connecting the RX and TX pins directly. This simple yet effective diagnostic tool ensures that data sent is received back correctly.\
Example:

1. Configure UART with a baud rate of 19200 bps, odd parity, and an 8-bit data size.
2. Input the payload `1A.2B.3C.4D` in the Write Buffer and click **TRANSFER**.
3. The terminal log shows:
   * Data `1A.2B.3C.4D` sent successfully.
   * Notification: The same data is received, confirming proper operation.

<figure><img src="https://1059373410-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHsTSGN4n74wHqBYxgF3t%2Fuploads%2F2dnZAATlI93KrnQTzDxT%2FUART_terminal.png?alt=media&#x26;token=2f39ed50-bf5a-4ba7-9ca7-c09cf93146a6" alt=""><figcaption><p>Terminal view showing some transactions performed in the echo test</p></figcaption></figure>

\*When USE EXTERNAL button is pressed, what happens under the hood is that the host adapter measures the voltage in VTAR and then sets the bus voltage to that value using its internal circuitry.
